changeset 9117:453c3d26f4bc draft

(svn r12977) -Codechange: remove quite some redundant (duplicate) function declarations.
author rubidium <rubidium@openttd.org>
date Tue, 06 May 2008 22:17:12 +0000 (2008-05-06)
parents 44beb31166aa
children 6249ec405331
files config.lib src/economy.cpp src/functions.h src/gfx_func.h src/gui.h src/intro_gui.cpp src/players.cpp src/smallmap_gui.cpp src/statusbar_gui.cpp src/stdafx.h src/train.h src/vehicle_gui.cpp src/video/sdl_v.cpp src/video/win32_v.cpp src/viewport.cpp src/window.cpp src/window_func.h src/window_gui.h
diffstat 18 files changed, 14 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/config.lib
+++ b/config.lib
@@ -921,7 +921,7 @@
 		if [ $cc_version -ge 29 ]; then
 			CFLAGS="$CFLAGS -Wall -Wno-multichar -Wsign-compare -Wundef"
 			CFLAGS="$CFLAGS -Wwrite-strings -Wpointer-arith"
-			CFLAGS="$CFLAGS -Wno-uninitialized"
+			CFLAGS="$CFLAGS -Wno-uninitialized -Wredundant-decls"
 
 			CC_CFLAGS="$CC_CFLAGS -Wstrict-prototypes"
 		fi
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -45,6 +45,7 @@
 #include "signal_func.h"
 #include "gfx_func.h"
 #include "autoreplace_func.h"
+#include "player_gui.h"
 
 #include "table/strings.h"
 #include "table/sprites.h"
--- a/src/functions.h
+++ b/src/functions.h
@@ -60,9 +60,6 @@
 
 void UpdateViewportSignPos(ViewportSign *sign, int left, int top, StringID str);
 
-/* callback from drivers that is called if the game size changes dynamically */
-void GameSizeChanged();
-
 int ttd_main(int argc, char* argv[]);
 void HandleExitGameRequest();
 
--- a/src/gfx_func.h
+++ b/src/gfx_func.h
@@ -70,10 +70,8 @@
 void CSleep(int milliseconds);
 void UpdateWindows();
 
-void DrawChatMessage();
 void DrawMouseCursor();
 void ScreenSizeChanged();
-void HandleExitGameRequest();
 void GameSizeChanged();
 void UndrawMouseCursor();
 
@@ -142,9 +140,6 @@
 void SetMouseCursor(SpriteID sprite, SpriteID pal);
 void SetAnimatedMouseCursor(const AnimCursor *table);
 void CursorTick();
-void DrawMouseCursor();
-void ScreenSizeChanged();
-void UndrawMouseCursor();
 bool ChangeResInGame(int w, int h);
 void SortResolutions(int count);
 bool ToggleFullScreen(bool fs);
--- a/src/gui.h
+++ b/src/gui.h
@@ -76,9 +76,6 @@
 	DDSP_PLACE_AUTOROAD,
 };
 
-/* timetable_gui.cpp */
-void ShowTimetableWindow(const Vehicle *v);
-
 /* misc_gui.cpp */
 void PlaceLandBlockInfo();
 void ShowAboutWindow();
--- a/src/intro_gui.cpp
+++ b/src/intro_gui.cpp
@@ -18,6 +18,7 @@
 #include "fios.h"
 #include "gfx_func.h"
 #include "settings_type.h"
+#include "functions.h"
 
 #include "table/strings.h"
 #include "table/sprites.h"
--- a/src/players.cpp
+++ b/src/players.cpp
@@ -614,8 +614,6 @@
 		MaybeStartNewPlayer();
 }
 
-extern void ShowPlayerFinances(PlayerID player);
-
 void PlayersYearlyLoop()
 {
 	Player *p;
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -27,6 +27,7 @@
 #include "vehicle_base.h"
 #include "sound_func.h"
 #include "settings_type.h"
+#include "window_func.h"
 
 #include "table/strings.h"
 #include "table/sprites.h"
--- a/src/statusbar_gui.cpp
+++ b/src/statusbar_gui.cpp
@@ -17,6 +17,7 @@
 #include "player_gui.h"
 #include "window_gui.h"
 #include "variables.h"
+#include "window_func.h"
 
 #include "table/strings.h"
 #include "table/sprites.h"
--- a/src/stdafx.h
+++ b/src/stdafx.h
@@ -283,7 +283,7 @@
 #if defined(__OS2__)
 	#define assert_compile(expr)
 #else
-	#define assert_compile(expr) extern "C" void __ct_assert__(int a[1 - 2 * !(expr)])
+	#define assert_compile(expr) extern const int __ct_assert__[1 - 2 * !(expr)]
 #endif /* __OS2__ */
 
 /* Check if the types have the bitsizes like we are using them */
@@ -292,7 +292,7 @@
 assert_compile(sizeof(uint16) == 2);
 assert_compile(sizeof(uint8)  == 1);
 
-#define lengthof(x) (sizeof(x)/sizeof(x[0]))
+#define lengthof(x) (sizeof(x) / sizeof(x[0]))
 #define endof(x) (&x[lengthof(x)])
 #define lastof(x) (&x[lengthof(x) - 1])
 
--- a/src/train.h
+++ b/src/train.h
@@ -264,7 +264,6 @@
 void ConnectMultiheadedTrains();
 uint CountArticulatedParts(EngineID engine_type);
 
-int CheckTrainInDepot(const Vehicle *v, bool needs_to_be_stopped);
 void CcBuildLoco(bool success, TileIndex tile, uint32 p1, uint32 p2);
 void CcBuildWagon(bool success, TileIndex tile, uint32 p1, uint32 p2);
 
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -35,6 +35,7 @@
 #include "settings_type.h"
 #include "widgets/dropdown_func.h"
 #include "order_func.h"
+#include "timetable.h"
 
 #include "table/sprites.h"
 #include "table/strings.h"
--- a/src/video/sdl_v.cpp
+++ b/src/video/sdl_v.cpp
@@ -15,6 +15,8 @@
 #include "../network/network.h"
 #include "../core/math_func.hpp"
 #include "../core/random_func.hpp"
+#include "../functions.h"
+#include "../texteff.hpp"
 #include "sdl_v.h"
 #include <SDL.h>
 
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -12,6 +12,8 @@
 #include "../network/network.h"
 #include "../core/math_func.hpp"
 #include "../core/random_func.hpp"
+#include "../functions.h"
+#include "../texteff.hpp"
 #include "win32_v.h"
 #include <windows.h>
 #include <tchar.h>
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -45,6 +45,7 @@
 #include "station_func.h"
 #include "core/alloc_type.hpp"
 #include "misc/smallvec.h"
+#include "window_func.h"
 
 #include "table/sprites.h"
 #include "table/strings.h"
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -20,6 +20,7 @@
 #include "vehicle_base.h"
 #include "settings_type.h"
 #include "cheat_func.h"
+#include "window_func.h"
 
 #include "table/sprites.h"
 
--- a/src/window_func.h
+++ b/src/window_func.h
@@ -25,7 +25,6 @@
 void InputLoop();
 void InvalidateThisWindowData(Window *w);
 void InvalidateWindowData(WindowClass cls, WindowNumber number);
-void RelocateAllWindows(int neww, int newh);
 
 void DeleteNonVitalWindows();
 void DeleteAllNonVitalWindows();
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -546,13 +546,6 @@
 void CallWindowEventNP(Window *w, int event);
 void CallWindowTickEvent();
 
-void SetWindowDirty(const Window *w);
-void SendWindowMessage(WindowClass wnd_class, WindowNumber wnd_num, int msg, int wparam, int lparam);
-void SendWindowMessageClass(WindowClass wnd_class, int msg, int wparam, int lparam);
-
-Window *FindWindowById(WindowClass cls, WindowNumber number);
-void DeletePlayerWindows(PlayerID pi);
-void ChangeWindowOwner(PlayerID old_player, PlayerID new_player);
 Window *BringWindowToFrontById(WindowClass cls, WindowNumber number);
 Window *FindWindowFromPt(int x, int y);
 
@@ -566,15 +559,8 @@
 Window *AllocateWindowDescFront(const WindowDesc *desc, int window_number, void *data = NULL);
 
 void DrawWindowViewport(const Window *w);
-void ResizeWindow(Window *w, int x, int y);
 
-void InitWindowSystem();
-void UnInitWindowSystem();
-void ResetWindowSystem();
 int GetMenuItemIndex(const Window *w, int x, int y);
-void InputLoop();
-void InvalidateThisWindowData(Window *w);
-void InvalidateWindowData(WindowClass cls, WindowNumber number);
 void RelocateAllWindows(int neww, int newh);
 
 /* misc_gui.cpp */
@@ -622,10 +608,6 @@
 };
 
 Window *GetCallbackWnd();
-void DeleteNonVitalWindows();
-void DeleteAllNonVitalWindows();
-void HideVitalWindows();
-void ShowVitalWindows();
 Window **FindWindowZPosition(const Window *w);
 
 void ScrollbarClickHandler(Window *w, const Widget *wi, int x, int y);