]> git.saurik.com Git - wxWidgets.git/commitdiff
GdkColor<->wxColour values conversion is not dependent on size of integer types,...
authorVáclav Slavík <vslavik@fastmail.fm>
Fri, 4 Jun 2004 15:57:04 +0000 (15:57 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Fri, 4 Jun 2004 15:57:04 +0000 (15:57 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27624 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/colour.cpp
src/gtk1/colour.cpp

index 98946e16496b8df648ad934c9b019bbc5e94c615..ebb55bb7b01f4fbea09cc3cd74f146773699d6f9 100644 (file)
@@ -146,7 +146,8 @@ void wxColourRefData::AllocColour( GdkColormap *cmap )
 
 #define M_COLDATA ((wxColourRefData *)m_refData)
 
-#define SHIFT (8*(sizeof(short int)-sizeof(char)))
+// GDK's values are in 0..65535 range, our are in 0..255
+#define SHIFT  8
 
 IMPLEMENT_DYNAMIC_CLASS(wxColour,wxGDIObject)
 
index 98946e16496b8df648ad934c9b019bbc5e94c615..ebb55bb7b01f4fbea09cc3cd74f146773699d6f9 100644 (file)
@@ -146,7 +146,8 @@ void wxColourRefData::AllocColour( GdkColormap *cmap )
 
 #define M_COLDATA ((wxColourRefData *)m_refData)
 
-#define SHIFT (8*(sizeof(short int)-sizeof(char)))
+// GDK's values are in 0..65535 range, our are in 0..255
+#define SHIFT  8
 
 IMPLEMENT_DYNAMIC_CLASS(wxColour,wxGDIObject)