pstatserver: Fix compilation error with STDFLOAT_DOUBLE=1

Regression in 7da70cf9399e2703ac9cacbb6977edeb173de159

Fixes #1259
This commit is contained in:
rdb 2022-02-05 22:13:06 +01:00
parent 2a904f3985
commit 5bb616dca7
4 changed files with 24 additions and 24 deletions

View File

@ -274,13 +274,13 @@ get_collector_pattern(int collector_index, bool highlight) {
// Ask the monitor what color this guy should be.
LRGBColor rgb = _monitor->get_collector_color(collector_index);
cairo_pattern_t *pattern = cairo_pattern_create_rgb(
encode_sRGB_float(rgb[0]),
encode_sRGB_float(rgb[1]),
encode_sRGB_float(rgb[2]));
encode_sRGB_float((float)rgb[0]),
encode_sRGB_float((float)rgb[1]),
encode_sRGB_float((float)rgb[2]));
cairo_pattern_t *hpattern = cairo_pattern_create_rgb(
encode_sRGB_float(rgb[0] * 0.75f),
encode_sRGB_float(rgb[1] * 0.75f),
encode_sRGB_float(rgb[2] * 0.75f));
encode_sRGB_float((float)rgb[0] * 0.75f),
encode_sRGB_float((float)rgb[1] * 0.75f),
encode_sRGB_float((float)rgb[2] * 0.75f));
_brushes[collector_index] = std::make_pair(pattern, hpattern);
return highlight ? hpattern : pattern;

View File

@ -55,14 +55,14 @@ GtkStatsLabel(GtkStatsMonitor *monitor, GtkStatsGraph *graph,
// Set the fg and bg colors on the label.
LRGBColor rgb = _monitor->get_collector_color(_collector_index);
_bg_color = LRGBColor(
encode_sRGB_float(rgb[0]),
encode_sRGB_float(rgb[1]),
encode_sRGB_float(rgb[2]));
encode_sRGB_float((float)rgb[0]),
encode_sRGB_float((float)rgb[1]),
encode_sRGB_float((float)rgb[2]));
_highlight_bg_color = LRGBColor(
encode_sRGB_float(rgb[0] * 0.75f),
encode_sRGB_float(rgb[1] * 0.75f),
encode_sRGB_float(rgb[2] * 0.75f));
encode_sRGB_float((float)rgb[0] * 0.75f),
encode_sRGB_float((float)rgb[1] * 0.75f),
encode_sRGB_float((float)rgb[2] * 0.75f));
// Should our foreground be black or white?
PN_stdfloat bright = _bg_color.dot(LRGBColor(0.2126, 0.7152, 0.0722));

View File

@ -242,14 +242,14 @@ get_collector_brush(int collector_index, bool highlight) {
// Ask the monitor what color this guy should be.
LRGBColor rgb = _monitor->get_collector_color(collector_index);
int r = (int)encode_sRGB_uchar(rgb[0]);
int g = (int)encode_sRGB_uchar(rgb[1]);
int b = (int)encode_sRGB_uchar(rgb[2]);
int r = (int)encode_sRGB_uchar((float)rgb[0]);
int g = (int)encode_sRGB_uchar((float)rgb[1]);
int b = (int)encode_sRGB_uchar((float)rgb[2]);
HBRUSH brush = CreateSolidBrush(RGB(r, g, b));
int hr = (int)encode_sRGB_uchar(rgb[0] * 0.75f);
int hg = (int)encode_sRGB_uchar(rgb[1] * 0.75f);
int hb = (int)encode_sRGB_uchar(rgb[2] * 0.75f);
int hr = (int)encode_sRGB_uchar((float)rgb[0] * 0.75f);
int hg = (int)encode_sRGB_uchar((float)rgb[1] * 0.75f);
int hb = (int)encode_sRGB_uchar((float)rgb[2] * 0.75f);
HBRUSH hbrush = CreateSolidBrush(RGB(hr, hg, hb));
_brushes[collector_index] = std::make_pair(brush, hbrush);

View File

@ -44,15 +44,15 @@ WinStatsLabel(WinStatsMonitor *monitor, WinStatsGraph *graph,
update_text(use_fullname);
LRGBColor rgb = _monitor->get_collector_color(_collector_index);
int r = (int)encode_sRGB_uchar(rgb[0]);
int g = (int)encode_sRGB_uchar(rgb[1]);
int b = (int)encode_sRGB_uchar(rgb[2]);
int r = (int)encode_sRGB_uchar((float)rgb[0]);
int g = (int)encode_sRGB_uchar((float)rgb[1]);
int b = (int)encode_sRGB_uchar((float)rgb[2]);
_bg_brush = CreateSolidBrush(RGB(r, g, b));
// Calculate the color when it is highlighted.
int hr = (int)encode_sRGB_uchar(rgb[0] * 0.75f);
int hg = (int)encode_sRGB_uchar(rgb[1] * 0.75f);
int hb = (int)encode_sRGB_uchar(rgb[2] * 0.75f);
int hr = (int)encode_sRGB_uchar((float)rgb[0] * 0.75f);
int hg = (int)encode_sRGB_uchar((float)rgb[1] * 0.75f);
int hb = (int)encode_sRGB_uchar((float)rgb[2] * 0.75f);
_highlight_bg_brush = CreateSolidBrush(RGB(hr, hg, hb));
// Should our foreground be black or white?