Skip to content

Commit

Permalink
use const_cast<gdouble> to avoid narrowing
Browse files Browse the repository at this point in the history
  • Loading branch information
Björn Esser committed Jun 15, 2012
1 parent 1eb6856 commit 02f79a5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/YGBarGraph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ class YGBarGraph : public YBarGraph, public YGWidget

static GdkRGBA ycolorToGdk (const YColor &ycolor)
{
GdkRGBA color = { 0, guint16(ycolor.red() << 8), guint16(ycolor.green() << 8), guint16(ycolor.blue() << 8) };
GdkRGBA color = { 0,
static_cast<gdouble> ( guint16(ycolor.red() << 8 ) ),
static_cast<gdouble> ( guint16(ycolor.green() << 8 ) ),
static_cast<gdouble> ( guint16(ycolor.blue() << 8 ) )
};
return color;
}

Expand Down

0 comments on commit 02f79a5

Please sign in to comment.