(svn r11689) -Fix: compilation error and most of warnings for gcc 4.3
authorsmatz
Sun, 23 Dec 2007 21:02:40 +0000
changeset 8624 c5753e14d8dc
parent 8623 652df321c912
child 8625 917bf7147a48
(svn r11689) -Fix: compilation error and most of warnings for gcc 4.3
config.lib
src/cmd_helper.h
src/rail_gui.cpp
src/table/road_land.h
--- a/config.lib	Sun Dec 23 18:08:39 2007 +0000
+++ b/config.lib	Sun Dec 23 21:02:40 2007 +0000
@@ -885,6 +885,12 @@
 		CFLAGS="$CFLAGS -fno-strict-overflow"
 	fi
 
+	# GCC 4.3+ gives a warning about empty body of
+	# loops and conditions
+	if [ $cc_version -ge 43 ]; then
+		CFLAGS="$CFLAGS -Wno-empty-body"
+	fi
+
 	if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
 		LIBS="$LIBS -lpthread"
 		LIBS="$LIBS -lrt"
--- a/src/cmd_helper.h	Sun Dec 23 18:08:39 2007 +0000
+++ b/src/cmd_helper.h	Sun Dec 23 21:02:40 2007 +0000
@@ -8,7 +8,7 @@
 
 
 template<uint N> static inline void ExtractValid();
-template<> static inline void ExtractValid<1>() {}
+template<> inline void ExtractValid<1>() {}
 
 
 template<typename T> struct ExtractBits;
--- a/src/rail_gui.cpp	Sun Dec 23 18:08:39 2007 +0000
+++ b/src/rail_gui.cpp	Sun Dec 23 21:02:40 2007 +0000
@@ -1173,7 +1173,7 @@
  * @param xrel         the relativ x value of the sprite in the grf
  * @param xsize        the width of the sprite
  */
-static const void DrawSignalSprite(const Window *w, byte widget_index, SpriteID image, int8 xrel, uint8 xsize)
+static void DrawSignalSprite(const Window *w, byte widget_index, SpriteID image, int8 xrel, uint8 xsize)
 {
 	DrawSprite(image + w->IsWidgetLowered(widget_index), PAL_NONE,
 			w->widget[widget_index].left + (w->widget[widget_index].right - w->widget[widget_index].left) / 2 - xrel - xsize / 2 +
--- a/src/table/road_land.h	Sun Dec 23 18:08:39 2007 +0000
+++ b/src/table/road_land.h	Sun Dec 23 21:02:40 2007 +0000
@@ -33,24 +33,24 @@
 };
 
 static const DrawTileSeqStruct _tram_depot_NE[] = {
-	TILE_SEQ_LINE(SPR_TRAMWAY_BASE + 0x35 | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE, 0, 15, 16, 1)
+	TILE_SEQ_LINE((SPR_TRAMWAY_BASE + 0x35) | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE, 0, 15, 16, 1)
 	TILE_SEQ_END()
 };
 
 static const DrawTileSeqStruct _tram_depot_SE[] = {
 	TILE_SEQ_LINE(SPR_TRAMWAY_BASE + 0x31, PAL_NONE, 0, 0, 1, 16)
-	TILE_SEQ_LINE(SPR_TRAMWAY_BASE + 0x32 | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE, 15, 0, 1, 16)
+	TILE_SEQ_LINE((SPR_TRAMWAY_BASE + 0x32) | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE, 15, 0, 1, 16)
 	TILE_SEQ_END()
 };
 
 static const DrawTileSeqStruct _tram_depot_SW[] = {
 	TILE_SEQ_LINE(SPR_TRAMWAY_BASE + 0x33, PAL_NONE, 0, 0, 16, 1)
-	TILE_SEQ_LINE(SPR_TRAMWAY_BASE + 0x34 | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE, 0, 15, 16, 1)
+	TILE_SEQ_LINE((SPR_TRAMWAY_BASE + 0x34) | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE, 0, 15, 16, 1)
 	TILE_SEQ_END()
 };
 
 static const DrawTileSeqStruct _tram_depot_NW[] = {
-	TILE_SEQ_LINE(SPR_TRAMWAY_BASE + 0x36 | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE, 15, 0, 1, 16)
+	TILE_SEQ_LINE((SPR_TRAMWAY_BASE + 0x36) | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE, 15, 0, 1, 16)
 	TILE_SEQ_END()
 };