[goffice] Compilation: make color macros safer.



commit 4b0cbc59b5d21cec540839a1ae0ba8f3b7e37bad
Author: Morten Welinder <terra gnome org>
Date:   Wed Mar 20 19:21:22 2013 -0400

    Compilation: make color macros safer.

 goffice/utils/go-color.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/goffice/utils/go-color.h b/goffice/utils/go-color.h
index 2b253c9..d967b17 100644
--- a/goffice/utils/go-color.h
+++ b/goffice/utils/go-color.h
@@ -42,8 +42,8 @@ typedef struct {
 
 #define GO_COLOR_FROM_GDK_RGBA(c)      go_color_from_gdk_rgba (&(c), NULL)
 
-#define GO_COLOR_FROM_RGB(r,g,b)       
((((guint)(r&0xff))<<24)|(((guint)(g&0xff))<<16)|((guint)(b&0xff)<<8)|0xff)
-#define GO_COLOR_FROM_RGBA(r,g,b,a)    
((((guint)(r&0xff))<<24)|(((guint)(g&0xff))<<16)|((guint)(b&0xff)<<8)|(guint)(a&0xff))
+#define GO_COLOR_FROM_RGB(r,g,b)       GO_COLOR_FROM_RGBA((r),(g),(b),0xff)
+#define GO_COLOR_FROM_RGBA(r,g,b,a)    
((((guint)((r)&0xff))<<24)|(((guint)((g)&0xff))<<16)|((guint)((b)&0xff)<<8)|(guint)((a)&0xff))
 #define GO_COLOR_WHITE  GO_COLOR_FROM_RGB(0xff, 0xff, 0xff)
 #define GO_COLOR_BLACK   GO_COLOR_FROM_RGB(0x00, 0x00, 0x00)
 #define GO_COLOR_RED     GO_COLOR_FROM_RGB(0xff, 0x00, 0x00)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]