From c5b977db0bf02e06f69d0fd4ba2ce6fc1883553b Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 20 Apr 2018 08:27:32 +1000 Subject: Remove casts, drop default argument, use const. --- src/XPM.cxx | 14 +++++++------- src/XPM.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/XPM.cxx b/src/XPM.cxx index f83c3d6a8..04dc530bf 100644 --- a/src/XPM.cxx +++ b/src/XPM.cxx @@ -105,15 +105,15 @@ void XPM::Init(const char *const *linesForm) { for (int c=0; c(colourDef[0]); + const char code = colourDef[0]; colourDef += 4; ColourDesired colour(0xff, 0xff, 0xff); if (*colourDef == '#') { colour.Set(colourDef); } else { - codeTransparent = static_cast(code); + codeTransparent = code; } - colourCodeTable[code] = colour; + colourCodeTable[static_cast(code)] = colour; } for (int y=0; y(colour.GetRed()); - pixel[1] = static_cast(colour.GetGreen()); - pixel[2] = static_cast(colour.GetBlue()); + pixel[0] = colour.GetRed(); + pixel[1] = colour.GetGreen(); + pixel[2] = colour.GetBlue(); pixel[3] = static_cast(alpha); } diff --git a/src/XPM.h b/src/XPM.h index a2bd6cb91..2af0ae84e 100644 --- a/src/XPM.h +++ b/src/XPM.h @@ -59,7 +59,7 @@ public: float GetScaledWidth() const { return width / scale; } int CountBytes() const; const unsigned char *Pixels() const; - void SetPixel(int x, int y, ColourDesired colour, int alpha=0xff); + void SetPixel(int x, int y, ColourDesired colour, int alpha); }; /** -- cgit v1.2.3