Skip to content

Commit 66f6525

Browse files
committed
Fixed some gcc specific conversion warnings
1 parent 9586de2 commit 66f6525

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/css_properties.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,10 @@ void litehtml::css_properties::compute_font(const html_tag* el, const document::
304304
font_size = font_size_table[idx_in_table][sz.predef()];
305305
} else if(sz.predef() == font_size_smaller)
306306
{
307-
font_size = parent_sz / 1.2;
307+
font_size = parent_sz / (pixel_t) 1.2;
308308
} else if(sz.predef() == font_size_larger)
309309
{
310-
font_size = parent_sz * 1.2;
310+
font_size = parent_sz * (pixel_t) 1.2;
311311
} else
312312
{
313313
font_size = parent_sz;
@@ -335,10 +335,10 @@ void litehtml::css_properties::compute_font(const html_tag* el, const document::
335335
font_size = doc_font_size * 2;
336336
break;
337337
case font_size_smaller:
338-
font_size = parent_sz / 1.2;
338+
font_size = parent_sz / (pixel_t) 1.2;
339339
break;
340340
case font_size_larger:
341-
font_size = parent_sz * 1.2;
341+
font_size = parent_sz * (pixel_t) 1.2;
342342
break;
343343
default:
344344
font_size = parent_sz;

src/web_color.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ bool parse_rgb_func(const css_token& tok, web_color& color)
299299
// https://drafts.csswg.org/css-color-4/#hsl-to-rgb
300300
void hsl_to_rgb(float hue, float sat, float light, float& r, float& g, float& b)
301301
{
302-
hue = fmod(hue, 360.f);
302+
hue = (float) fmod(hue, 360.f);
303303

304304
if (hue < 0)
305305
hue += 360;
@@ -309,7 +309,7 @@ void hsl_to_rgb(float hue, float sat, float light, float& r, float& g, float& b)
309309

310310
auto f = [=](float n)
311311
{
312-
float k = fmod(n + hue / 30, 12.f);
312+
float k = (float) fmod(n + hue / 30, 12.f);
313313
float a = sat * min(light, 1 - light);
314314
return light - a * max(-1.f, min({k - 3, 9 - k, 1.f}));
315315
};

0 commit comments

Comments
 (0)