Skip to content

Commit

Permalink
Merge pull request #606 from pabdulin/fix-possible-loss-of-data
Browse files Browse the repository at this point in the history
Suppress compiler `possible loss of data` warning with explicit cast
  • Loading branch information
RobLoach authored Jan 25, 2024
2 parents e410e39 + b3b04fc commit 9d9781d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions nuklear.h
Original file line number Diff line number Diff line change
Expand Up @@ -7662,9 +7662,9 @@ nk_rgb_factor(struct nk_color col, const float factor)
{
if (factor == 1.0f)
return col;
col.r *= factor;
col.g *= factor;
col.b *= factor;
col.r = (nk_byte)(col.r * factor);
col.g = (nk_byte)(col.g * factor);
col.b = (nk_byte)(col.b * factor);
return col;
}
NK_API struct nk_color
Expand Down
6 changes: 3 additions & 3 deletions src/nuklear_color.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ nk_rgb_factor(struct nk_color col, const float factor)
{
if (factor == 1.0f)
return col;
col.r *= factor;
col.g *= factor;
col.b *= factor;
col.r = (nk_byte)(col.r * factor);
col.g = (nk_byte)(col.g * factor);
col.b = (nk_byte)(col.b * factor);
return col;
}
NK_API struct nk_color
Expand Down

0 comments on commit 9d9781d

Please sign in to comment.