X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/655719367ac5e131d9642e5783f3ecf64d1a3385..de63b922cadc81306a1905c81cfd0be7ae32adbb:/src/motif/colour.cpp diff --git a/src/motif/colour.cpp b/src/motif/colour.cpp index 17a8a4e72b..473e202864 100644 --- a/src/motif/colour.cpp +++ b/src/motif/colour.cpp @@ -1,21 +1,17 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: colour.cpp +// Name: src/motif/colour.cpp // Purpose: wxColour class // Author: Julian Smart // Modified by: // Created: 17/09/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// //// TODO: make wxColour a ref-counted object, //// so pixel values get shared. -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "colour.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -92,10 +88,10 @@ wxColour wxColour::CreateByName(const wxString& name) XColor xcol; if ( XParseColor( dpy, (Colormap)colormap, name.mb_str(), &xcol ) ) { - col.m_red = xcol.red & 0xff; - col.m_green = xcol.green & 0xff; - col.m_blue = xcol.blue & 0xff; - col.m_isInit = TRUE; + col.m_red = (unsigned char)(xcol.red & 0xff); + col.m_green = (unsigned char)(xcol.green & 0xff); + col.m_blue = (unsigned char)(xcol.blue & 0xff); + col.m_isInit = true; col.m_pixel = -1; } @@ -130,11 +126,11 @@ int wxColour::AllocColour(WXDisplay* display, bool realloc) XColor color; color.red = (unsigned short) Red (); - color.red |= color.red << 8; + color.red |= (unsigned short)(color.red << 8); color.green = (unsigned short) Green (); - color.green |= color.green << 8; + color.green |= (unsigned short)(color.green << 8); color.blue = (unsigned short) Blue (); - color.blue |= color.blue << 8; + color.blue |= (unsigned short)(color.blue << 8); color.flags = DoRed | DoGreen | DoBlue;