]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/colour.cpp
Applied patch [ 1443707 ] kill "cast truncates constant value" warnings
[wxWidgets.git] / src / motif / colour.cpp
index 17a8a4e72bfb351518a30e1a11266c9e3e948d1f..473e2028645ad8d305defded82c910cf493f32f3 100644 (file)
@@ -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;