Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2006:
[Freeciv-Dev] (PR#15158) __extension__ keyword in gui-sdl
Home

[Freeciv-Dev] (PR#15158) __extension__ keyword in gui-sdl

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#15158) __extension__ keyword in gui-sdl
From: "Christian Prochaska" <cp.ml.freeciv.dev@xxxxxxxxxxxxxx>
Date: Sat, 14 Jan 2006 18:31:11 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=15158 >

Argh, better forget about that last theory ;-)

#define get_wstate(pWidget)                             \
( __extension__                                         \
        (pWidget->state_types_flags & STATE_MASK)       \
)

I thought that were braces, but actually they are parantheses. So I have
no idea again why the __extension__ keyword is there. However, since
removing it gave no extra warnings in "-pedantic" mode and also Jason
didn't find a reason for its existence, I still think that it can be
safely removed. Patch attached.
Index: client/gui-sdl/gui_stuff.h
===================================================================
--- client/gui-sdl/gui_stuff.h  (Revision 11444)
+++ client/gui-sdl/gui_stuff.h  (Arbeitskopie)
@@ -166,9 +166,9 @@
   Uint16 ID;                   /* ID in widget list */
 };
 
-#define scrollbar_size(pScroll)                                        \
-  fc__extension((float)((float)(pScroll->active * pScroll->step) /     \
-               (float)pScroll->count) * (pScroll->max - pScroll->min))
+#define scrollbar_size(pScroll)                                \
+        ((float)((float)(pScroll->active * pScroll->step) /    \
+        (float)pScroll->count) * (pScroll->max - pScroll->min))
 
 /* Struct of basic window group dialog ( without scrollbar ) */
 struct SMALL_DLG {
@@ -400,13 +400,13 @@
        (pWidget)->state_types_flags &= ~((flag) & FLAG_MASK)
 
 #define get_wstate(pWidget)                            \
-       fc__extension((enum WState)(pWidget->state_types_flags & STATE_MASK))
+       ((enum WState)(pWidget->state_types_flags & STATE_MASK))
 
 #define get_wtype(pWidget)                             \
-       fc__extension((enum WTypes)(pWidget->state_types_flags & TYPE_MASK))
+       ((enum WTypes)(pWidget->state_types_flags & TYPE_MASK))
 
 #define get_wflags(pWidget)                            \
-       fc__extension((enum WFlags)(pWidget->state_types_flags & FLAG_MASK))
+       ((enum WFlags)(pWidget->state_types_flags & FLAG_MASK))
 
 
 #define hide_scrollbar(scrollbar)                              \
Index: client/gui-sdl/gui_mem.h
===================================================================
--- client/gui-sdl/gui_mem.h    (Revision 11444)
+++ client/gui-sdl/gui_mem.h    (Arbeitskopie)
@@ -39,11 +39,4 @@
 #define REALLOC(ptr, size) fc_real_realloc((ptr), (size), "realloc", \
                                           __LINE__, __FILE__)
 
-/* Want to use GCC's __extension__ keyword to macros , use it */
-#if defined(__GNUC__)
-#define fc__extension(x)       (__extension__(x))
-#else
-#define fc__extension(x)       (x)
 #endif
-
-#endif

[Prev in Thread] Current Thread [Next in Thread]