(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
--- a/Makefile Sat Jan 22 19:41:30 2005 +0000
+++ b/Makefile Sat Jan 22 20:23:18 2005 +0000
@@ -299,13 +299,13 @@
# GNU make can only test for (in)equality
# this is a workaround to test for >=
ifeq ($(shell if test $(CC_VERSION) -ge 29; then echo true; fi), true)
- CFLAGS += -O -Wall -Wno-multichar -Wsign-compare
+ CFLAGS += -O -Wall -Wno-multichar -Wsign-compare -Wstrict-prototypes
endif
ifeq ($(shell if test $(CC_VERSION) -ge 30; then echo true; fi), true)
CFLAGS += -W -Wno-unused-parameter
endif
ifeq ($(shell if test $(CC_VERSION) -ge 34; then echo true; fi), true)
- CFLAGS += -Wdeclaration-after-statement
+ CFLAGS += -Wdeclaration-after-statement -Wold-style-definition
endif
CDEFS=-DWITH_REV
--- a/ai.c Sat Jan 22 19:41:30 2005 +0000
+++ b/ai.c Sat Jan 22 20:23:18 2005 +0000
@@ -413,12 +413,14 @@
void *to;
} FoundRoute;
-static Town *AiFindRandomTown() {
+static Town *AiFindRandomTown(void)
+{
Town *t = GetTown(RandomRange(_total_towns));
return (t->xy != 0) ? t : NULL;
}
-static Industry *AiFindRandomIndustry() {
+static Industry *AiFindRandomIndustry(void)
+{
Industry *i = GetIndustry(RandomRange(_total_industries));
return (i->xy != 0) ? i : NULL;
}
--- a/aircraft_cmd.c Sat Jan 22 19:41:30 2005 +0000
+++ b/aircraft_cmd.c Sat Jan 22 20:23:18 2005 +0000
@@ -537,7 +537,7 @@
InvalidateWindowClasses(WC_AIRCRAFT_LIST);
}
-void AircraftYearlyLoop()
+void AircraftYearlyLoop(void)
{
Vehicle *v;
@@ -1875,7 +1875,7 @@
}
// need to be called to load aircraft from old version
-void UpdateOldAircraft()
+void UpdateOldAircraft(void)
{
Station *st;
Vehicle *v_oldstyle;
--- a/airport.c Sat Jan 22 19:41:30 2005 +0000
+++ b/airport.c Sat Jan 22 20:23:18 2005 +0000
@@ -22,7 +22,7 @@
/*static void AirportPrintOut(const AirportFTAClass *Airport, const bool full_report);
static byte AirportBlockToString(uint32 block);*/
-void InitializeAirports()
+void InitializeAirports(void)
{
// country airport
CountryAirport = malloc(sizeof(AirportFTAClass));
@@ -97,7 +97,7 @@
Oilrig = Heliport; // exactly the same structure for heliport/oilrig, so share state machine
}
-void UnInitializeAirports()
+void UnInitializeAirports(void)
{
AirportFTAClass_Destructor(CountryAirport);
AirportFTAClass_Destructor(CityAirport);
--- a/airport.h Sat Jan 22 19:41:30 2005 +0000
+++ b/airport.h Sat Jan 22 20:23:18 2005 +0000
@@ -44,8 +44,8 @@
struct AirportFTA *next_in_chain; // possible extra movement choices from this position
} AirportFTA;
-void InitializeAirports();
-void UnInitializeAirports();
+void InitializeAirports(void);
+void UnInitializeAirports(void);
const AirportFTAClass* GetAirport(const byte airport_type);
#endif /* AIRPORT_H */
--- a/airport_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/airport_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -14,7 +14,7 @@
static byte _selected_airport_type;
-static void ShowBuildAirportPicker();
+static void ShowBuildAirportPicker(void);
void CcBuildAirport(bool success, uint tile, uint32 p1, uint32 p2)
@@ -124,7 +124,7 @@
BuildAirToolbWndProc
};
-void ShowBuildAirToolbar()
+void ShowBuildAirToolbar(void)
{
if (_current_player == OWNER_SPECTATOR) return;
DeleteWindowById(WC_BUILD_TOOLBAR, 0);
@@ -232,12 +232,12 @@
BuildAirportPickerWndProc
};
-static void ShowBuildAirportPicker()
+static void ShowBuildAirportPicker(void)
{
AllocateWindowDesc(&_build_airport_desc);
}
-void InitializeAirportGui()
+void InitializeAirportGui(void)
{
_selected_airport_type = AT_SMALL;
_last_built_aircraft_depot_tile = 0;
--- a/clear_cmd.c Sat Jan 22 19:41:30 2005 +0000
+++ b/clear_cmd.c Sat Jan 22 20:23:18 2005 +0000
@@ -729,7 +729,7 @@
MarkTileDirtyByTile(tile);
}
-void GenerateClearTile()
+void GenerateClearTile(void)
{
int i,j;
uint tile,tile_new;
@@ -801,7 +801,8 @@
return;
}
-void InitializeClearLand() {
+void InitializeClearLand(void)
+{
_opt.snow_line = _patches.snow_line_height * 8;
}
--- a/command.c Sat Jan 22 19:41:30 2005 +0000
+++ b/command.c Sat Jan 22 20:23:18 2005 +0000
@@ -385,7 +385,7 @@
return res;
}
-int32 GetAvailableMoneyForCommand()
+int32 GetAvailableMoneyForCommand(void)
{
uint pid = _current_player;
if (pid >= MAX_PLAYERS) return 0x7FFFFFFF; // max int
--- a/command.h Sat Jan 22 19:41:30 2005 +0000
+++ b/command.h Sat Jan 22 20:23:18 2005 +0000
@@ -183,6 +183,6 @@
int32 DoCommandByTile(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
bool IsValidCommand(uint cmd);
-int32 GetAvailableMoneyForCommand();
+int32 GetAvailableMoneyForCommand(void);
#endif /* COMMAND_H */
--- a/console_cmds.c Sat Jan 22 19:41:30 2005 +0000
+++ b/console_cmds.c Sat Jan 22 20:23:18 2005 +0000
@@ -140,7 +140,7 @@
}
extern bool SafeSaveOrLoad(const char *filename, int mode, int newgm);
-extern void BuildFileList();
+extern void BuildFileList(void);
extern void SetFiosType(const byte fiostype);
/* Load a file-number from current dir */
@@ -1167,7 +1167,7 @@
/* debug commands and variables */
/* ****************************************** */
-void IConsoleDebugLibRegister()
+void IConsoleDebugLibRegister(void)
{
// debugging variables and functions
extern bool _stdlib_con_developer; /* XXX extern in .c */
--- a/disaster_cmd.c Sat Jan 22 19:41:30 2005 +0000
+++ b/disaster_cmd.c Sat Jan 22 20:23:18 2005 +0000
@@ -694,10 +694,10 @@
// not used
}
-typedef void DisasterInitProc();
+typedef void DisasterInitProc(void);
// Zeppeliner which crashes on a small airport
-static void Disaster0_Init()
+static void Disaster0_Init(void)
{
Vehicle *v = ForceAllocateSpecialVehicle(), *u;
Station *st;
@@ -730,7 +730,7 @@
}
}
-static void Disaster1_Init()
+static void Disaster1_Init(void)
{
Vehicle *v = ForceAllocateSpecialVehicle(), *u;
int x;
@@ -753,7 +753,7 @@
}
}
-static void Disaster2_Init()
+static void Disaster2_Init(void)
{
Industry *i, *found;
Vehicle *v,*u;
@@ -789,7 +789,7 @@
}
}
-static void Disaster3_Init()
+static void Disaster3_Init(void)
{
Industry *i, *found;
Vehicle *v,*u,*w;
@@ -831,7 +831,7 @@
}
}
-static void Disaster4_Init()
+static void Disaster4_Init(void)
{
Vehicle *v = ForceAllocateSpecialVehicle(), *u;
int x,y;
@@ -856,7 +856,7 @@
}
// Submarine type 1
-static void Disaster5_Init()
+static void Disaster5_Init(void)
{
Vehicle *v = ForceAllocateSpecialVehicle();
int x,y;
@@ -877,7 +877,7 @@
}
// Submarine type 2
-static void Disaster6_Init()
+static void Disaster6_Init(void)
{
Vehicle *v = ForceAllocateSpecialVehicle();
int x,y;
@@ -897,7 +897,7 @@
v->age = 0;
}
-static void Disaster7_Init()
+static void Disaster7_Init(void)
{
Industry *i;
int maxloop = 15;
@@ -954,7 +954,7 @@
};
-static void DoDisaster()
+static void DoDisaster(void)
{
byte buf[8];
byte year = _cur_year;
@@ -973,12 +973,12 @@
}
-static void ResetDisasterDelay()
+static void ResetDisasterDelay(void)
{
_disaster_delay = (int)(Random() & 0x1FF) + 730;
}
-void DisasterDailyLoop()
+void DisasterDailyLoop(void)
{
if (--_disaster_delay != 0)
return;
@@ -989,7 +989,8 @@
DoDisaster();
}
-void StartupDisasters() {
+void StartupDisasters(void)
+{
ResetDisasterDelay();
}
--- a/dock_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/dock_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -10,8 +10,8 @@
#include "sound.h"
#include "command.h"
-static void ShowBuildDockStationPicker();
-static void ShowBuildDocksDepotPicker();
+static void ShowBuildDockStationPicker(void);
+static void ShowBuildDocksDepotPicker(void);
static byte _ship_depot_direction;
@@ -202,7 +202,7 @@
BuildDocksToolbWndProc
};
-void ShowBuildDocksToolbar()
+void ShowBuildDocksToolbar(void)
{
if (_current_player == OWNER_SPECTATOR) return;
DeleteWindowById(WC_BUILD_TOOLBAR, 0);
@@ -278,12 +278,12 @@
BuildDockStationWndProc
};
-static void ShowBuildDockStationPicker()
+static void ShowBuildDockStationPicker(void)
{
AllocateWindowDesc(&_build_dock_station_desc);
}
-static void UpdateDocksDirection()
+static void UpdateDocksDirection(void)
{
if (_ship_depot_direction != 0) {
SetTileSelectSize(1, 2);
@@ -349,14 +349,14 @@
};
-static void ShowBuildDocksDepotPicker()
+static void ShowBuildDocksDepotPicker(void)
{
AllocateWindowDesc(&_build_docks_depot_desc);
UpdateDocksDirection();
}
-void InitializeDockGui()
+void InitializeDockGui(void)
{
_ship_depot_direction = 0;
}
--- a/economy.c Sat Jan 22 19:41:30 2005 +0000
+++ b/economy.c Sat Jan 22 20:23:18 2005 +0000
@@ -584,7 +584,7 @@
return 0;
}
-static void PlayersGenStatistics()
+static void PlayersGenStatistics(void)
{
Station *st;
Player *p;
@@ -633,7 +633,7 @@
*value += (int32)(tmp >> 16) + (low >> 16);
}
-static void AddInflation()
+static void AddInflation(void)
{
int i;
int32 inf = _economy.infl_amount * 54;
@@ -661,7 +661,7 @@
InvalidateWindow(WC_PAYMENT_RATES, 0);
}
-static void PlayersPayInterest()
+static void PlayersPayInterest(void)
{
Player *p;
int interest = _economy.interest_rate * 54;
@@ -680,7 +680,7 @@
}
}
-static void HandleEconomyFluctuations()
+static void HandleEconomyFluctuations(void)
{
if (_opt.diff.economy == 0)
return;
@@ -756,7 +756,7 @@
1000000, // build_industry
};
-void StartupEconomy()
+void StartupEconomy(void)
{
int i;
@@ -988,7 +988,7 @@
InvalidateWindow(WC_SUBSIDIES_LIST, 0);
}
-static void SubsidyMonthlyHandler()
+static void SubsidyMonthlyHandler(void)
{
Subsidy *s;
Pair pair;
@@ -1068,7 +1068,7 @@
SLE_END()
};
-static void Save_SUBS()
+static void Save_SUBS(void)
{
int i;
Subsidy *s;
@@ -1082,7 +1082,7 @@
}
}
-static void Load_SUBS()
+static void Load_SUBS(void)
{
int index;
while ((index = SlIterateArray()) != -1)
@@ -1473,7 +1473,7 @@
return result;
}
-void PlayersMonthlyLoop()
+void PlayersMonthlyLoop(void)
{
PlayersGenStatistics();
if (_patches.inflation)
@@ -1611,14 +1611,14 @@
}
// Prices
-static void SaveLoad_PRIC()
+static void SaveLoad_PRIC(void)
{
SlArray(&_price, NUM_PRICES, SLE_INT32);
SlArray(&_price_frac, NUM_PRICES, SLE_UINT16);
}
// Cargo payment rates
-static void SaveLoad_CAPR()
+static void SaveLoad_CAPR(void)
{
SlArray(&_cargo_payment_rates, NUM_CARGO, SLE_INT32);
SlArray(&_cargo_payment_rates_frac, NUM_CARGO, SLE_UINT16);
@@ -1635,7 +1635,7 @@
};
// Economy variables
-static void SaveLoad_ECMY()
+static void SaveLoad_ECMY(void)
{
SlObject(&_economy, &_economy_desc);
}
--- a/engine.c Sat Jan 22 19:41:30 2005 +0000
+++ b/engine.c Sat Jan 22 20:23:18 2005 +0000
@@ -50,7 +50,7 @@
void ShowEnginePreviewWindow(int engine);
-void DeleteCustomEngineNames()
+void DeleteCustomEngineNames(void)
{
uint i;
StringID old;
@@ -64,13 +64,13 @@
_vehicle_design_names &= ~1;
}
-void LoadCustomEngineNames()
+void LoadCustomEngineNames(void)
{
// XXX: not done */
DEBUG(misc, 1) ("LoadCustomEngineNames: not done");
}
-static void SetupEngineNames()
+static void SetupEngineNames(void)
{
uint i;
@@ -81,7 +81,7 @@
LoadCustomEngineNames();
}
-static void AdjustAvailAircraft()
+static void AdjustAvailAircraft(void)
{
uint16 date = _date;
byte avail = 0;
@@ -116,7 +116,7 @@
}
}
-void AddTypeToEngines()
+void AddTypeToEngines(void)
{
Engine *e;
uint32 counter = 0;
@@ -139,7 +139,7 @@
}
}
-void StartupEngines()
+void StartupEngines(void)
{
Engine *e;
const EngineInfo *ei;
@@ -653,7 +653,7 @@
InvalidateWindowClasses(WC_BUILD_VEHICLE);
}
-void EnginesDailyLoop()
+void EnginesDailyLoop(void)
{
Engine *e;
int i,num;
@@ -781,7 +781,7 @@
}
}
-void EnginesMonthlyLoop()
+void EnginesMonthlyLoop(void)
{
Engine *e;
@@ -876,7 +876,7 @@
SLE_END()
};
-static void Save_ENGN()
+static void Save_ENGN(void)
{
Engine *e;
int i;
@@ -886,7 +886,7 @@
}
}
-static void Load_ENGN()
+static void Load_ENGN(void)
{
int index;
while ((index = SlIterateArray()) != -1) {
@@ -894,7 +894,7 @@
}
}
-static void LoadSave_ENGS()
+static void LoadSave_ENGS(void)
{
SlArray(_engine_name_strings, lengthof(_engine_name_strings), SLE_STRINGID);
}
--- a/engine.h Sat Jan 22 19:41:30 2005 +0000
+++ b/engine.h Sat Jan 22 20:23:18 2005 +0000
@@ -80,8 +80,8 @@
};
-void AddTypeToEngines();
-void StartupEngines();
+void AddTypeToEngines(void);
+void StartupEngines(void);
extern byte _global_cargo_id[NUM_LANDSCAPE][NUM_CARGO];
@@ -130,8 +130,8 @@
void AcceptEnginePreview(Engine *e, int player);
-void LoadCustomEngineNames();
-void DeleteCustomEngineNames();
+void LoadCustomEngineNames(void);
+void DeleteCustomEngineNames(void);
enum {
--- a/fileio.c Sat Jan 22 19:41:30 2005 +0000
+++ b/fileio.c Sat Jan 22 20:23:18 2005 +0000
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "fileio.h"
#if defined(UNIX) || defined(__OS2__)
#include <ctype.h> // required for tolower()
#endif
@@ -21,7 +22,7 @@
static Fio _fio;
// Get current position in file
-uint32 FioGetPos()
+uint32 FioGetPos(void)
{
return _fio.pos + (_fio.buffer - _fio.buffer_start) - FIO_BUFFER_SIZE;
}
@@ -42,7 +43,7 @@
FioSeekTo(pos & 0xFFFFFF, SEEK_SET);
}
-byte FioReadByte()
+byte FioReadByte(void)
{
if (_fio.buffer == _fio.buffer_end) {
_fio.pos += FIO_BUFFER_SIZE;
@@ -64,13 +65,13 @@
}
-uint16 FioReadWord()
+uint16 FioReadWord(void)
{
byte b = FioReadByte();
return (FioReadByte() << 8) | b;
}
-uint32 FioReadDword()
+uint32 FioReadDword(void)
{
uint b = FioReadWord();
return (FioReadWord() << 16) | b;
--- a/fileio.h Sat Jan 22 19:41:30 2005 +0000
+++ b/fileio.h Sat Jan 22 20:23:18 2005 +0000
@@ -3,11 +3,11 @@
void FioSeekTo(uint32 pos, int mode);
void FioSeekToFile(uint32 pos);
-uint32 FioGetPos();
-byte FioReadByte();
-uint16 FioReadWord();
-uint32 FioReadDword();
-void FioCloseAll();
+uint32 FioGetPos(void);
+byte FioReadByte(void);
+uint16 FioReadWord(void);
+uint32 FioReadDword(void);
+void FioCloseAll(void);
void FioOpenFile(int slot, const char *filename);
void FioReadBlock(void *ptr, uint size);
void FioSkipBytes(int n);
--- a/functions.h Sat Jan 22 19:41:30 2005 +0000
+++ b/functions.h Sat Jan 22 20:23:18 2005 +0000
@@ -16,7 +16,7 @@
void CDECL ModifyTile(uint tile, uint flags, ...);
void SetMapExtraBits(uint tile, byte flags);
uint GetMapExtraBits(uint tile);
-void RunTileLoop();
+void RunTileLoop(void);
uint GetPartialZ(int x, int y, int corners);
uint GetSlopeZ(int x, int y);
@@ -58,10 +58,10 @@
byte *GetString(byte *buffr, uint16 string);
void InjectDparam(int amount);
-int32 GetParamInt32();
-int GetParamInt16();
-int GetParamInt8();
-int GetParamUint16();
+int32 GetParamInt32(void);
+int GetParamInt16(void);
+int GetParamInt8(void);
+int GetParamUint16(void);
/* clear_land.c */
@@ -117,13 +117,13 @@
#define RandomRange(max) DoRandomRange(max, __LINE__, __FILE__)
uint DoRandomRange(uint max, uint line, char *file);
#else
- uint32 Random();
+ uint32 Random(void);
uint RandomRange(uint max);
#endif
-void InitPlayerRandoms();
+void InitPlayerRandoms(void);
-uint32 InteractiveRandom(); /* Used for random sequences that are not the same on the other end of the multiplayer link */
+uint32 InteractiveRandom(void); /* Used for random sequences that are not the same on the other end of the multiplayer link */
uint InteractiveRandomRange(uint max);
void SetDate(uint date);
@@ -131,21 +131,21 @@
void DrawPlayerFace(uint32 face, int color, int x, int y);
/* texteff.c */
-void MoveAllTextEffects();
+void MoveAllTextEffects(void);
void AddTextEffect(StringID msg, int x, int y, uint16 duration);
-void InitTextEffects();
+void InitTextEffects(void);
void DrawTextEffects(DrawPixelInfo *dpi);
-void InitTextMessage();
-void DrawTextMessage();
+void InitTextMessage(void);
+void DrawTextMessage(void);
void CDECL AddTextMessage(uint16 color, uint8 duration, const char *message, ...);
-void UndrawTextMessage();
-void TextMessageDailyLoop();
+void UndrawTextMessage(void);
+void TextMessageDailyLoop(void);
bool AddAnimatedTile(uint tile);
void DeleteAnimatedTile(uint tile);
-void AnimateAnimatedTiles();
-void InitializeAnimatedTiles();
+void AnimateAnimatedTiles(void);
+void InitializeAnimatedTiles(void);
/* tunnelbridge_cmd.c */
bool CheckTunnelInWay(uint tile, int z);
@@ -158,18 +158,18 @@
/* network.c */
void NetworkUDPClose(void);
-void NetworkStartUp();
+void NetworkStartUp(void);
void NetworkShutDown(void);
void NetworkGameLoop(void);
void NetworkUDPGameLoop(void);
bool NetworkServerStart(void);
bool NetworkClientConnectGame(const byte* host, unsigned short port);
-void NetworkReboot();
-void NetworkDisconnect();
+void NetworkReboot(void);
+void NetworkDisconnect(void);
void NetworkSend_Command(uint32 tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback);
/* misc_cmd.c */
-void PlaceTreesRandomly();
+void PlaceTreesRandomly(void);
uint GetTileDist(TileIndex xy1, TileIndex xy2);
uint GetTileDist1D(TileIndex xy1, TileIndex xy2);
@@ -206,7 +206,7 @@
void SetObjectToPlaceWnd(int icon, byte mode, Window *w);
void SetObjectToPlace(int icon, byte mode, WindowClass window_class, WindowNumber window_num);
-void ResetObjectToPlace();
+void ResetObjectToPlace(void);
bool ScrollWindowToTile(TileIndex tile, Window * w);
bool ScrollWindowTo(int x, int y, Window * w);
@@ -230,8 +230,8 @@
int GetTownRadiusGroup(Town *t, uint tile);
void ShowNetworkChatQueryWindow(byte desttype, byte dest);
void ShowNetworkGiveMoneyWindow(byte player);
-void ShowNetworkNeedGamePassword();
-void ShowNetworkNeedCompanyPassword();
+void ShowNetworkNeedGamePassword(void);
+void ShowNetworkNeedCompanyPassword(void);
void ShowRenameWaypointWindow(Waypoint *cp);
int FindFirstBit(uint32 x);
void ShowHighscoreTable(int difficulty, int8 rank);
@@ -252,11 +252,11 @@
int SaveOrLoad(const char *filename, int mode);
-void AfterLoadTown();
-void AskExitGame();
-void AskExitToGameMenu();
+void AfterLoadTown(void);
+void AskExitGame(void);
+void AskExitToGameMenu(void);
-void RedrawAutosave();
+void RedrawAutosave(void);
StringID RemapOldStringID(StringID s);
@@ -274,21 +274,21 @@
void ttd_strlcpy(char *dst, const char *src, size_t len);
// callback from drivers that is called if the game size changes dynamically
-void GameSizeChanged();
+void GameSizeChanged(void);
bool FileExists(const char *filename);
bool ReadLanguagePack(int index);
-void InitializeLanguagePacks();
+void InitializeLanguagePacks(void);
byte *ReadFileToMem(const char *filename, size_t *lenp, size_t maxsize);
int GetLanguageList(char **languages, int max);
-void CheckSwitchToEuro();
+void CheckSwitchToEuro(void);
-void LoadFromConfig();
-void SaveToConfig();
+void LoadFromConfig(void);
+void SaveToConfig(void);
int ttd_main(int argc, char* argv[]);
-byte GetOSVersion();
+byte GetOSVersion(void);
-void DeterminePaths();
+void DeterminePaths(void);
char * CDECL str_fmt(const char *str, ...);
#endif /* FUNCTIONS_H */
--- a/gfx.c Sat Jan 22 19:41:30 2005 +0000
+++ b/gfx.c Sat Jan 22 20:23:18 2005 +0000
@@ -1483,9 +1483,9 @@
}
#endif
-void DoPaletteAnimations();
+void DoPaletteAnimations(void);
-void GfxInitPalettes()
+void GfxInitPalettes(void)
{
int pal = _use_dos_palette?1:0;
memcpy(_cur_palette, _palettes[pal], 256*3);
@@ -1499,7 +1499,7 @@
#define EXTR2(p,q) (((uint16)(~_timer_counter * (p)) * (q)) >> 16)
#define COPY_TRIPLET do {d[0]=s[0+j]; d[1]=s[1+j]; d[2]=s[2+j];d+=3;}while(0)
-void DoPaletteAnimations()
+void DoPaletteAnimations(void)
{
const byte *s;
byte *d;
@@ -1612,7 +1612,7 @@
}
-void LoadStringWidthTable()
+void LoadStringWidthTable(void)
{
int i;
byte *b;
@@ -1633,7 +1633,7 @@
}
}
-void ScreenSizeChanged()
+void ScreenSizeChanged(void)
{
// check the dirty rect
if (_invalid_rect.right >= _screen.width) _invalid_rect.right = _screen.width;
@@ -1643,7 +1643,7 @@
_cursor.visible = false;
}
-void UndrawMouseCursor()
+void UndrawMouseCursor(void)
{
if (_cursor.visible) {
_cursor.visible = false;
@@ -1656,7 +1656,7 @@
}
}
-void DrawMouseCursor()
+void DrawMouseCursor(void)
{
int x,y,w,h;
@@ -1739,7 +1739,7 @@
_video_driver->make_dirty(left, top, right-left, bottom-top);
}
-void DrawDirtyBlocks()
+void DrawDirtyBlocks(void)
{
byte *b = _dirty_blocks;
int x=0,y=0;
@@ -1845,7 +1845,7 @@
} while (--height);
}
-void MarkWholeScreenDirty()
+void MarkWholeScreenDirty(void)
{
SetDirtyBlocks(0, 0, _screen.width, _screen.height);
}
@@ -1914,7 +1914,7 @@
cv->dirty = true;
}
-static void SwitchAnimatedCursor()
+static void SwitchAnimatedCursor(void)
{
CursorVars *cv = &_cursor;
const uint16 *cur;
@@ -1930,7 +1930,8 @@
SetCursorSprite(sprite);
}
-void CursorTick() {
+void CursorTick(void)
+{
CursorVars *cv = &_cursor;
if (cv->animate_timeout && !--cv->animate_timeout)
SwitchAnimatedCursor();
--- a/gfx.h Sat Jan 22 19:41:30 2005 +0000
+++ b/gfx.h Sat Jan 22 20:23:18 2005 +0000
@@ -53,14 +53,14 @@
uint16 GetDrawStringPlayerColor(byte player);
int GetStringWidth(const byte *str);
-void LoadStringWidthTable();
+void LoadStringWidthTable(void);
void DrawStringMultiCenter(int x, int y, uint16 str, int maxw);
void DrawStringMultiLine(int x, int y, uint16 str, int maxw);
-void DrawDirtyBlocks();
+void DrawDirtyBlocks(void);
void SetDirtyBlocks(int left, int top, int right, int bottom);
-void MarkWholeScreenDirty();
+void MarkWholeScreenDirty(void);
-void GfxInitPalettes();
+void GfxInitPalettes(void);
bool FillDrawPixelInfo(DrawPixelInfo *n, DrawPixelInfo *o, int left, int top, int width, int height);
@@ -70,14 +70,14 @@
/* spritecache.c */
byte *GetSpritePtr(uint sprite);
void GfxInitSpriteMem(byte *ptr, uint32 size);
-void GfxLoadSprites();
+void GfxLoadSprites(void);
void SetMouseCursor(uint cursor);
void SetAnimatedMouseCursor(const uint16 *table);
-void CursorTick();
-void DrawMouseCursor();
-void ScreenSizeChanged();
-void UndrawMouseCursor();
+void CursorTick(void);
+void DrawMouseCursor(void);
+void ScreenSizeChanged(void);
+void UndrawMouseCursor(void);
bool ChangeResInGame(int w, int h);
void ToggleFullScreen(const bool full_screen);
--- a/graph_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/graph_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -272,7 +272,7 @@
GraphLegendWndProc
};
-static void ShowGraphLegend()
+static void ShowGraphLegend(void)
{
AllocateWindowDescFront(&_graph_legend_desc, 0);
}
@@ -374,7 +374,7 @@
};
-void ShowOperatingProfitGraph()
+void ShowOperatingProfitGraph(void)
{
if (AllocateWindowDescFront(&_operating_profit_desc, 0)) {
InvalidateWindow(WC_GRAPH_LEGEND, 0);
@@ -448,7 +448,7 @@
IncomeGraphWndProc
};
-void ShowIncomeGraph()
+void ShowIncomeGraph(void)
{
if (AllocateWindowDescFront(&_income_graph_desc, 0)) {
InvalidateWindow(WC_GRAPH_LEGEND, 0);
@@ -521,7 +521,7 @@
DeliveredCargoGraphWndProc
};
-void ShowDeliveredCargoGraph()
+void ShowDeliveredCargoGraph(void)
{
if (AllocateWindowDescFront(&_delivered_cargo_graph_desc, 0)) {
InvalidateWindow(WC_GRAPH_LEGEND, 0);
@@ -597,7 +597,7 @@
PerformanceHistoryWndProc
};
-void ShowPerformanceHistoryGraph()
+void ShowPerformanceHistoryGraph(void)
{
if (AllocateWindowDescFront(&_performance_history_desc, 0)) {
InvalidateWindow(WC_GRAPH_LEGEND, 0);
@@ -670,7 +670,7 @@
CompanyValueGraphWndProc
};
-void ShowCompanyValueGraph()
+void ShowCompanyValueGraph(void)
{
if (AllocateWindowDescFront(&_company_value_graph_desc, 0)) {
InvalidateWindow(WC_GRAPH_LEGEND, 0);
@@ -774,7 +774,7 @@
};
-void ShowCargoPaymentRates()
+void ShowCargoPaymentRates(void)
{
AllocateWindowDescFront(&_cargo_payment_rates_desc, 0);
}
@@ -874,7 +874,7 @@
CompanyLeagueWndProc
};
-void ShowCompanyLeagueTable()
+void ShowCompanyLeagueTable(void)
{
AllocateWindowDescFront(&_company_league_desc,0);
}
@@ -1094,7 +1094,7 @@
PerformanceRatingDetailWndProc
};
-void ShowPerformanceRatingDetail()
+void ShowPerformanceRatingDetail(void)
{
AllocateWindowDescFront(&_performance_rating_detail_desc, 0);
}
--- a/gui.h Sat Jan 22 19:41:30 2005 +0000
+++ b/gui.h Sat Jan 22 20:23:18 2005 +0000
@@ -4,30 +4,30 @@
#include "window.h"
/* main_gui.c */
-void SetupColorsAndInitialWindow();
+void SetupColorsAndInitialWindow(void);
void CcPlaySound10(bool success, uint tile, uint32 p1, uint32 p2);
/* settings_gui.c */
-void ShowGameOptions();
-void ShowGameDifficulty();
-void ShowPatchesSelection();
-void ShowNewgrf();
-void ShowCustCurrency();
+void ShowGameOptions(void);
+void ShowGameDifficulty(void);
+void ShowPatchesSelection(void);
+void ShowNewgrf(void);
+void ShowCustCurrency(void);
/* graph_gui.c */
-void ShowOperatingProfitGraph();
-void ShowIncomeGraph();
-void ShowDeliveredCargoGraph();
-void ShowPerformanceHistoryGraph();
-void ShowCompanyValueGraph();
-void ShowCargoPaymentRates();
-void ShowCompanyLeagueTable();
-void ShowPerformanceRatingDetail();
+void ShowOperatingProfitGraph(void);
+void ShowIncomeGraph(void);
+void ShowDeliveredCargoGraph(void);
+void ShowPerformanceHistoryGraph(void);
+void ShowCompanyValueGraph(void);
+void ShowCargoPaymentRates(void);
+void ShowCompanyLeagueTable(void);
+void ShowPerformanceRatingDetail(void);
/* news_gui.c */
-void ShowLastNewsMessage();
-void ShowMessageOptions();
-void ShowMessageHistory();
+void ShowLastNewsMessage(void);
+void ShowMessageOptions(void);
+void ShowMessageHistory(void);
/* traintoolb_gui.c */
void ShowBuildRailToolbar(int index, int button);
@@ -42,18 +42,18 @@
void ShowRoadVehViewWindow(Vehicle *v);
/* road_gui.c */
-void ShowBuildRoadToolbar();
-void ShowBuildRoadScenToolbar();
+void ShowBuildRoadToolbar(void);
+void ShowBuildRoadScenToolbar(void);
void ShowPlayerRoadVehicles(int player, int station);
/* dock_gui.c */
-void ShowBuildDocksToolbar();
+void ShowBuildDocksToolbar(void);
void ShowPlayerShips(int player, int station);
void ShowShipViewWindow(Vehicle *v);
/* aircraft_gui.c */
-void ShowBuildAirToolbar();
+void ShowBuildAirToolbar(void);
void ShowPlayerAircraft(int player, int station);
/* terraform_gui.c */
@@ -61,16 +61,16 @@
void PlaceProc_LowerLand(uint tile);
void PlaceProc_RaiseLand(uint tile);
void PlaceProc_LevelLand(uint tile);
-void ShowTerraformToolbar();
+void ShowTerraformToolbar(void);
/* misc_gui.c */
-void PlaceLandBlockInfo();
-void ShowAboutWindow();
-void ShowBuildTreesToolbar();
-void ShowBuildTreesScenToolbar();
-void ShowTownDirectory();
-void ShowIndustryDirectory();
-void ShowSubsidiesList();
+void PlaceLandBlockInfo(void);
+void ShowAboutWindow(void);
+void ShowBuildTreesToolbar(void);
+void ShowBuildTreesScenToolbar(void);
+void ShowTownDirectory(void);
+void ShowIndustryDirectory(void);
+void ShowSubsidiesList(void);
void ShowPlayerStations(int player);
void ShowPlayerFinances(int player);
void ShowPlayerCompany(int player);
@@ -81,20 +81,20 @@
void DrawStationCoverageAreaText(int sx, int sy, uint mask,int rad);
void CheckRedrawStationCoverage(Window *w);
-void ShowSmallMap();
-void ShowExtraViewPortWindow();
+void ShowSmallMap(void);
+void ShowExtraViewPortWindow(void);
void SetVScrollCount(Window *w, int num);
void SetVScroll2Count(Window *w, int num);
void SetHScrollCount(Window *w, int num);
int HandleEditBoxKey(Window *w, int wid, WindowEvent *we);
-void ShowCheatWindow();
-void AskForNewGameToStart();
+void ShowCheatWindow(void);
+void AskForNewGameToStart(void);
void DrawEditBox(Window *w, int wid);
void HandleEditBox(Window *w, int wid);
-void BuildFileList();
+void BuildFileList(void);
void SetFiosType(const byte fiostype);
/* FIOS_TYPE_FILE, FIOS_TYPE_OLDFILE etc. different colours */
@@ -102,7 +102,7 @@
/* network gui */
-void ShowNetworkGameWindow();
+void ShowNetworkGameWindow(void);
void ShowChatWindow(StringID str, StringID caption, int maxlen, int maxwidth, byte window_class, uint16 window_number);
/* bridge_gui.c */
@@ -115,9 +115,9 @@
};
bool DoZoomInOutWindow(int how, Window * w);
-void ShowBuildIndustryWindow();
+void ShowBuildIndustryWindow(void);
void ShowQueryString(StringID str, StringID caption, int maxlen, int maxwidth, byte window_class, uint16 window_number);
-void ShowMusicWindow();
+void ShowMusicWindow(void);
/* main_gui.c */
VARDEF byte _newspaper_flag;
--- a/hal.h Sat Jan 22 19:41:30 2005 +0000
+++ b/hal.h Sat Jan 22 20:23:18 2005 +0000
@@ -3,14 +3,14 @@
typedef struct {
char *(*start)(char **parm);
- void (*stop)();
+ void (*stop)(void);
} HalCommonDriver;
typedef struct {
const char *(*start)(char **parm);
- void (*stop)();
+ void (*stop)(void);
void (*make_dirty)(int left, int top, int width, int height);
- int (*main_loop)();
+ int (*main_loop)(void);
bool (*change_resolution)(int w, int h);
} HalVideoDriver;
@@ -21,16 +21,16 @@
typedef struct {
char *(*start)(char **parm);
- void (*stop)();
+ void (*stop)(void);
} HalSoundDriver;
typedef struct {
char *(*start)(char **parm);
- void (*stop)();
+ void (*stop)(void);
void (*play_song)(const char *filename);
- void (*stop_song)();
- bool (*is_song_playing)();
+ void (*stop_song)(void);
+ bool (*is_song_playing)(void);
void (*set_volume)(byte vol);
} HalMusicDriver;
@@ -83,7 +83,7 @@
MUSIC_DRIVER = 2,
};
-extern void GameLoop();
+extern void GameLoop(void);
extern bool _dbg_screen_rect;
void LoadDriver(int driver, const char *name);
@@ -141,7 +141,7 @@
// Get a list of scenarios
FiosItem *FiosGetScenarioList(int *num, int mode);
// Free the list of savegames
-void FiosFreeSavegameList();
+void FiosFreeSavegameList(void);
// Browse to. Returns a filename w/path if we reached a file.
char *FiosBrowseTo(const FiosItem *item);
// Get descriptive texts.
@@ -153,6 +153,6 @@
// Make a filename from a name
void FiosMakeSavegameName(char *buf, const char *name);
-void CreateConsole();
+void CreateConsole(void);
#endif /* HAL_H */
--- a/industry_cmd.c Sat Jan 22 19:41:30 2005 +0000
+++ b/industry_cmd.c Sat Jan 22 20:23:18 2005 +0000
@@ -1096,7 +1096,7 @@
}
}
-void OnTick_Industry()
+void OnTick_Industry(void)
{
Industry *i;
@@ -1399,7 +1399,7 @@
return true;
}
-static Industry *AllocateIndustry()
+static Industry *AllocateIndustry(void)
{
Industry *i;
@@ -1614,7 +1614,7 @@
}
}
-void GenerateIndustries()
+void GenerateIndustries(void)
{
const byte *b;
@@ -1814,7 +1814,7 @@
}
}
-void IndustryMonthlyLoop()
+void IndustryMonthlyLoop(void)
{
Industry *i;
byte old_player = _current_player;
@@ -1843,7 +1843,7 @@
}
-void InitializeIndustries()
+void InitializeIndustries(void)
{
Industry *i;
int j;
@@ -1905,7 +1905,7 @@
SLE_END()
};
-static void Save_INDY()
+static void Save_INDY(void)
{
Industry *ind;
@@ -1918,7 +1918,7 @@
}
}
-static void Load_INDY()
+static void Load_INDY(void)
{
int index;
_total_industries = 0;
--- a/industry_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/industry_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -264,7 +264,7 @@
},
};
-void ShowBuildIndustryWindow()
+void ShowBuildIndustryWindow(void)
{
AllocateWindowDescFront(_industry_window_desc[_patches.build_rawmaterial_ind][_opt.landscape],0);
}
@@ -555,7 +555,7 @@
return r;
}
-static void MakeSortedIndustryList()
+static void MakeSortedIndustryList(void)
{
Industry *i;
int n = 0;
@@ -691,7 +691,7 @@
-void ShowIndustryDirectory()
+void ShowIndustryDirectory(void)
{
/* Industry List */
Window *w;
--- a/intro_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/intro_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -40,7 +40,7 @@
};
extern void HandleOnEditText(WindowEvent *e);
-extern void HandleOnEditTextCancel();
+extern void HandleOnEditTextCancel(void);
static void SelectGameWndProc(Window *w, WindowEvent *e) {
switch(e->event) {
@@ -94,7 +94,7 @@
SelectGameWndProc
};
-void ShowSelectGameWindow()
+void ShowSelectGameWindow(void)
{
AllocateWindowDesc(&_select_game_desc);
}
@@ -232,7 +232,7 @@
AskAbandonGameWndProc
};
-void AskExitGame()
+void AskExitGame(void)
{
AllocateWindowDescFront(&_ask_abandon_game_desc, 0);
}
@@ -285,7 +285,7 @@
};
-void AskExitToGameMenu()
+void AskExitToGameMenu(void)
{
AllocateWindowDescFront(&_ask_quit_game_desc, 0);
}
--- a/landscape.c Sat Jan 22 19:41:30 2005 +0000
+++ b/landscape.c Sat Jan 22 20:23:18 2005 +0000
@@ -457,7 +457,7 @@
#define TILELOOP_ASSERTMASK ((TILELOOP_SIZE-1) + ((TILELOOP_SIZE-1) << MapLogX()))
#define TILELOOP_CHKMASK (((1 << (MapLogX() - TILELOOP_BITS))-1) << TILELOOP_BITS)
-void RunTileLoop()
+void RunTileLoop(void)
{
uint tile;
uint count;
@@ -483,7 +483,7 @@
_cur_tileloop_tile = tile;
}
-void InitializeLandscape()
+void InitializeLandscape(void)
{
uint map_size = MapSize();
uint i;
@@ -503,7 +503,7 @@
memset(_map5, 3, map_size);
}
-void ConvertGroundTilesIntoWaterTiles()
+void ConvertGroundTilesIntoWaterTiles(void)
{
uint tile = 0;
int h;
@@ -630,7 +630,7 @@
#include "table/genland.h"
-static void CreateDesertOrRainForest()
+static void CreateDesertOrRainForest(void)
{
uint tile;
const TileIndexDiffC *data;
@@ -660,7 +660,7 @@
}
}
-void GenerateLandscape()
+void GenerateLandscape(void)
{
int i,flag;
uint32 r;
@@ -709,15 +709,15 @@
CreateDesertOrRainForest();
}
-void OnTick_Town();
-void OnTick_Trees();
-void OnTick_Station();
-void OnTick_Industry();
+void OnTick_Town(void);
+void OnTick_Trees(void);
+void OnTick_Station(void);
+void OnTick_Industry(void);
-void OnTick_Players();
-void OnTick_Train();
+void OnTick_Players(void);
+void OnTick_Train(void);
-void CallLandscapeTick()
+void CallLandscapeTick(void)
{
OnTick_Town();
OnTick_Trees();
--- a/main_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/main_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -29,8 +29,8 @@
static const uint MinDate = 0; // 1920-01-01 (MAX_YEAR_BEGIN_REAL)
static const uint MaxDate = 29220; // 2000-01-01
-extern void DoTestSave();
-extern void DoTestLoad();
+extern void DoTestSave(void);
+extern void DoTestLoad(void);
extern bool disable_computer;
@@ -41,14 +41,15 @@
static byte _last_built_railtype;
extern void GenerateWorld(int mode);
-extern void GenerateIndustries();
-extern void GenerateTowns();
+extern void GenerateIndustries(void);
+extern void GenerateTowns(void);
-extern uint GetCurrentCurrencyRate();
+extern uint GetCurrentCurrencyRate(void);
extern void CcTerraform(bool success, uint tile, uint32 p1, uint32 p2);
-void HandleOnEditTextCancel() {
+void HandleOnEditTextCancel(void)
+{
switch(_rename_what) {
#ifdef ENABLE_NETWORK
case 4:
@@ -364,14 +365,14 @@
ShowQueryString(STR_EMPTY, STR_NETWORK_GIVE_MONEY_CAPTION, 30, 180, 1, 0);
}
-void ShowNetworkNeedGamePassword()
+void ShowNetworkNeedGamePassword(void)
{
_rename_id = NETWORK_GAME_PASSWORD;
_rename_what = 4;
ShowQueryString(STR_EMPTY, STR_NETWORK_NEED_GAME_PASSWORD_CAPTION, 20, 180, WC_SELECT_GAME, 0);
}
-void ShowNetworkNeedCompanyPassword()
+void ShowNetworkNeedCompanyPassword(void)
{
_rename_id = NETWORK_COMPANY_PASSWORD;
_rename_what = 4;
@@ -404,7 +405,7 @@
ShowQueryString(STR_WAYPOINT_RAW, STR_EDIT_WAYPOINT_NAME, 30, 180, 1, 0);
}
-static void SelectSignTool()
+static void SelectSignTool(void)
{
if (_cursor.sprite == 0x2D2)
ResetObjectToPlace();
@@ -918,7 +919,7 @@
return true;
}
-static void MaxZoomIn()
+static void MaxZoomIn(void)
{
while (DoZoomInOutWindow(ZOOM_IN, FindWindowById(WC_MAIN_WINDOW, 0) ) ) {}
}
@@ -1074,7 +1075,7 @@
}
}
-static void ResetLandscape()
+static void ResetLandscape(void)
{
_random_seeds[0][0] = InteractiveRandom();
_random_seeds[0][1] = InteractiveRandom();
@@ -1585,7 +1586,8 @@
int _industry_type_to_place;
-static bool AnyTownExists() {
+static bool AnyTownExists(void)
+{
Town *t;
FOR_ALL_TOWNS(t) {
if (t->xy)
@@ -2372,10 +2374,10 @@
}
-void ShowSelectGameWindow();
+void ShowSelectGameWindow(void);
extern void ShowJoinStatusWindowAfterJoin(void);
-void SetupColorsAndInitialWindow()
+void SetupColorsAndInitialWindow(void)
{
int i;
byte *b;
@@ -2449,7 +2451,7 @@
WP(w,def_d).data_1 = -1280;
}
-void GameSizeChanged()
+void GameSizeChanged(void)
{
RelocateAllWindows(_screen.width, _screen.height);
ScreenSizeChanged();
--- a/misc.c Sat Jan 22 19:41:30 2005 +0000
+++ b/misc.c Sat Jan 22 20:23:18 2005 +0000
@@ -11,8 +11,8 @@
#include "network_server.h"
#include "engine.h"
-extern void StartupEconomy();
-extern void InitNewsItemStructs();
+extern void StartupEconomy(void);
+extern void InitNewsItemStructs(void);
byte _name_array[512][32];
@@ -31,7 +31,7 @@
uint32 DoRandom(uint line, char *file)
#else
-uint32 Random()
+uint32 Random(void)
#endif
{
#ifdef RANDOM_DEBUG
@@ -72,7 +72,7 @@
}
#endif
-uint32 InteractiveRandom()
+uint32 InteractiveRandom(void)
{
uint32 t = _random_seeds[1][1];
uint32 s = _random_seeds[1][0];
@@ -85,7 +85,7 @@
return (uint16)InteractiveRandom() * max >> 16;
}
-void InitPlayerRandoms()
+void InitPlayerRandoms(void)
{
int i;
for (i=0; i<MAX_PLAYERS; i++) {
@@ -150,40 +150,40 @@
#endif
}
-void InitializeVehicles();
-void InitializeOrders();
-void InitializeClearLand();
-void InitializeRail();
-void InitializeRailGui();
-void InitializeRoad();
-void InitializeRoadGui();
-void InitializeAirportGui();
-void InitializeDock();
-void InitializeDockGui();
-void InitializeIndustries();
-void InitializeLandscape();
-void InitializeTowns();
-void InitializeTrees();
-void InitializeSigns();
-void InitializeStations();
-static void InitializeNameMgr();
-void InitializePlayers();
-static void InitializeCheats();
+void InitializeVehicles(void);
+void InitializeOrders(void);
+void InitializeClearLand(void);
+void InitializeRail(void);
+void InitializeRailGui(void);
+void InitializeRoad(void);
+void InitializeRoadGui(void);
+void InitializeAirportGui(void);
+void InitializeDock(void);
+void InitializeDockGui(void);
+void InitializeIndustries(void);
+void InitializeLandscape(void);
+void InitializeTowns(void);
+void InitializeTrees(void);
+void InitializeSigns(void);
+void InitializeStations(void);
+static void InitializeNameMgr(void);
+void InitializePlayers(void);
+static void InitializeCheats(void);
-void GenerateLandscape();
-void GenerateClearTile();
-
-void GenerateIndustries();
-void GenerateUnmovables();
-void GenerateTowns();
+void GenerateLandscape(void);
+void GenerateClearTile(void);
-void StartupPlayers();
-void StartupDisasters();
-void GenerateTrees();
+void GenerateIndustries(void);
+void GenerateUnmovables(void);
+void GenerateTowns(void);
-void ConvertGroundTilesIntoWaterTiles();
+void StartupPlayers(void);
+void StartupDisasters(void);
+void GenerateTrees(void);
-void InitializeGame()
+void ConvertGroundTilesIntoWaterTiles(void);
+
+void InitializeGame(void)
{
// Initialize the autoreplace array. Needs to be cleared between each game
uint i;
@@ -319,13 +319,13 @@
}
-static void InitializeCheats()
+static void InitializeCheats(void)
{
memset(&_cheats, 0, sizeof(Cheats));
}
-static void InitializeNameMgr()
+static void InitializeNameMgr(void)
{
memset(_name_array, 0, sizeof(_name_array));
}
@@ -583,21 +583,21 @@
OnNewDay_DisasterVehicle,
};
-void EnginesDailyLoop();
-void DisasterDailyLoop();
-void PlayersMonthlyLoop();
-void EnginesMonthlyLoop();
-void TownsMonthlyLoop();
-void IndustryMonthlyLoop();
-void StationMonthlyLoop();
+void EnginesDailyLoop(void);
+void DisasterDailyLoop(void);
+void PlayersMonthlyLoop(void);
+void EnginesMonthlyLoop(void);
+void TownsMonthlyLoop(void);
+void IndustryMonthlyLoop(void);
+void StationMonthlyLoop(void);
-void PlayersYearlyLoop();
-void TrainsYearlyLoop();
-void RoadVehiclesYearlyLoop();
-void AircraftYearlyLoop();
-void ShipsYearlyLoop();
+void PlayersYearlyLoop(void);
+void TrainsYearlyLoop(void);
+void RoadVehiclesYearlyLoop(void);
+void AircraftYearlyLoop(void);
+void ShipsYearlyLoop(void);
-void WaypointsDailyLoop();
+void WaypointsDailyLoop(void);
static const uint16 _autosave_months[] = {
@@ -608,7 +608,7 @@
0x001, // every 12 months
};
-void IncreaseDate()
+void IncreaseDate(void)
{
const int vehicles_per_day = (1 << (sizeof(_date_fract) * 8)) / 885;
uint i;
@@ -738,7 +738,7 @@
}
-static void Save_NAME()
+static void Save_NAME(void)
{
int i;
byte *b = _name_array[0];
@@ -751,7 +751,7 @@
}
}
-static void Load_NAME()
+static void Load_NAME(void)
{
int index;
@@ -776,7 +776,7 @@
};
// Save load game options
-static void SaveLoad_OPTS()
+static void SaveLoad_OPTS(void)
{
SlObject(&_opt, _game_opt_desc);
}
@@ -804,7 +804,7 @@
// Save load date related variables as well as persistent tick counters
// XXX: currently some unrelated stuff is just put here
-static void SaveLoad_DATE()
+static void SaveLoad_DATE(void)
{
SlGlobList(_date_desc);
}
@@ -817,16 +817,18 @@
{NULL, 0, 0, 0}
};
-static void SaveLoad_VIEW()
+static void SaveLoad_VIEW(void)
{
SlGlobList(_view_desc);
}
-static void SaveLoad_MAPT() {
+static void SaveLoad_MAPT(void)
+{
SlArray(_map_type_and_height, MapSize(), SLE_UINT8);
}
-static void SaveLoad_MAP2() {
+static void SaveLoad_MAP2(void)
+{
if (_sl.version < 5) {
/* In those versions the _map2 was 8 bits */
SlArray(_map2, MapSize(), SLE_FILE_U8 | SLE_VAR_U16);
@@ -835,28 +837,33 @@
}
}
-static void SaveLoad_M3LO() {
+static void SaveLoad_M3LO(void)
+{
SlArray(_map3_lo, MapSize(), SLE_UINT8);
}
-static void SaveLoad_M3HI() {
+static void SaveLoad_M3HI(void)
+{
SlArray(_map3_hi, MapSize(), SLE_UINT8);
}
-static void SaveLoad_MAPO() {
+static void SaveLoad_MAPO(void)
+{
SlArray(_map_owner, MapSize(), SLE_UINT8);
}
-static void SaveLoad_MAP5() {
+static void SaveLoad_MAP5(void)
+{
SlArray(_map5, MapSize(), SLE_UINT8);
}
-static void SaveLoad_MAPE() {
+static void SaveLoad_MAPE(void)
+{
SlArray(_map_extra_bits, MapSize() / 4, SLE_UINT8);
}
-static void Save_CHTS()
+static void Save_CHTS(void)
{
byte count = sizeof(_cheats)/sizeof(Cheat);
Cheat* cht = (Cheat*) &_cheats;
@@ -869,7 +876,7 @@
}
}
-static void Load_CHTS()
+static void Load_CHTS(void)
{
Cheat* cht = (Cheat*) &_cheats;
--- a/misc_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/misc_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -153,7 +153,7 @@
#endif
}
-void PlaceLandBlockInfo()
+void PlaceLandBlockInfo(void)
{
if (_cursor.sprite == 0x2CF) {
ResetObjectToPlace();
@@ -268,7 +268,7 @@
};
-void ShowAboutWindow()
+void ShowAboutWindow(void)
{
DeleteWindowById(WC_GAME_OPTIONS, 0);
AllocateWindowDesc(&_about_desc);
@@ -426,12 +426,12 @@
};
-void ShowBuildTreesToolbar()
+void ShowBuildTreesToolbar(void)
{
AllocateWindowDesc(&_build_trees_desc);
}
-void ShowBuildTreesScenToolbar()
+void ShowBuildTreesScenToolbar(void)
{
AllocateWindowDescFront(&_build_trees_scen_desc, 0);
}
@@ -1075,7 +1075,7 @@
};
-void BuildFileList()
+void BuildFileList(void)
{
FiosFreeSavegameList();
if(_saveload_mode==SLD_NEW_GAME || _saveload_mode==SLD_LOAD_SCENARIO || _saveload_mode==SLD_SAVE_SCENARIO)
@@ -1084,7 +1084,7 @@
_fios_list = FiosGetSavegameList(&_fios_num, _saveload_mode);
}
-static void DrawFiosTexts()
+static void DrawFiosTexts(void)
{
const char *path;
StringID str;
@@ -1102,7 +1102,7 @@
#endif
-static void MakeSortedSaveGameList()
+static void MakeSortedSaveGameList(void)
{
/* Directories are always above the files (FIOS_TYPE_DIR)
* Drives (A:\ (windows only) are always under the files (FIOS_TYPE_DRIVE)
@@ -1352,7 +1352,7 @@
ResetObjectToPlace();
}
-void RedrawAutosave()
+void RedrawAutosave(void)
{
SetWindowDirty(FindWindowById(WC_STATUS_BAR, 0));
}
@@ -1475,7 +1475,7 @@
SelectScenarioWndProc
};
-void AskForNewGameToStart()
+void AskForNewGameToStart(void)
{
Window *w;
@@ -1524,7 +1524,7 @@
return _opt.landscape;
}
-extern void EnginesMonthlyLoop();
+extern void EnginesMonthlyLoop(void);
// p2 1 (increase) or -1 (decrease)
int32 ClickChangeDateCheat(int32 p1, int32 p2)
@@ -1759,7 +1759,7 @@
};
-void ShowCheatWindow()
+void ShowCheatWindow(void)
{
Window *w;
--- a/music_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/music_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -62,7 +62,7 @@
};
-static void SkipToPrevSong()
+static void SkipToPrevSong(void)
{
byte *b = _cur_playlist;
byte *p = b;
@@ -86,7 +86,7 @@
_song_is_active = false;
}
-static void SkipToNextSong()
+static void SkipToNextSong(void)
{
byte *b = _cur_playlist, t;
@@ -106,7 +106,7 @@
_music_driver->set_volume(new_vol);
}
-static void DoPlaySong()
+static void DoPlaySong(void)
{
char filename[256];
snprintf(filename, sizeof(filename), "%sgm_tt%.2d.gm",
@@ -114,12 +114,12 @@
_music_driver->play_song(filename);
}
-static void DoStopMusic()
+static void DoStopMusic(void)
{
_music_driver->stop_song();
}
-static void SelectSongToPlay()
+static void SelectSongToPlay(void)
{
int i;
@@ -142,7 +142,7 @@
}
}
-static void StopMusic()
+static void StopMusic(void)
{
_music_wnd_cursong = 0;
DoStopMusic();
@@ -150,7 +150,7 @@
InvalidateWindowWidget(WC_MUSIC_WINDOW, 0, 9);
}
-static void PlayPlaylistSong()
+static void PlayPlaylistSong(void)
{
if (_cur_playlist[0] == 0) {
SelectSongToPlay();
@@ -164,13 +164,13 @@
InvalidateWindowWidget(WC_MUSIC_WINDOW, 0, 9);
}
-void ResetMusic()
+void ResetMusic(void)
{
_music_wnd_cursong = 1;
DoPlaySong();
}
-void MusicLoop()
+void MusicLoop(void)
{
if (!msf.btn_down && _song_is_active) {
StopMusic();
@@ -299,7 +299,7 @@
MusicTrackSelectionWndProc
};
-static void ShowMusicTrackSelection()
+static void ShowMusicTrackSelection(void)
{
AllocateWindowDescFront(&_music_track_selection_desc, 0);
}
@@ -475,7 +475,7 @@
MusicWindowWndProc
};
-void ShowMusicWindow()
+void ShowMusicWindow(void)
{
AllocateWindowDescFront(&_music_window_desc, 0);
}
--- a/network.c Sat Jan 22 19:41:30 2005 +0000
+++ b/network.c Sat Jan 22 20:23:18 2005 +0000
@@ -41,9 +41,9 @@
static uint16 _network_client_index = NETWORK_SERVER_INDEX + 1;
/* Some externs / forwards */
-extern void ShowJoinStatusWindow();
-extern void StateGameLoop();
-extern uint GetCurrentCurrencyRate();
+extern void ShowJoinStatusWindow(void);
+extern void StateGameLoop(void);
+extern uint GetCurrentCurrencyRate(void);
// Function that looks up the CI for a given client-index
NetworkClientInfo *NetworkFindClientInfoFromIndex(uint16 client_index)
@@ -878,7 +878,7 @@
/* Generates the list of manually added hosts from NetworkGameList and
* dumps them into the array _network_host_list. This array is needed
* by the function that generates the config file. */
-void NetworkRebuildHostList()
+void NetworkRebuildHostList(void)
{
uint i = 0;
NetworkGameList *item = _network_game_list;
--- a/network.h Sat Jan 22 19:41:30 2005 +0000
+++ b/network.h Sat Jan 22 20:23:18 2005 +0000
@@ -214,7 +214,7 @@
void ParseConnectionString(const byte **player, const byte **port, byte *connection_string);
void NetworkUpdateClientInfo(uint16 client_index);
void NetworkAddServer(const byte *b);
-void NetworkRebuildHostList();
+void NetworkRebuildHostList(void);
void NetworkChangeCompanyPassword(const char *str);
#endif /* NETWORK_H */
--- a/network_data.h Sat Jan 22 19:41:30 2005 +0000
+++ b/network_data.h Sat Jan 22 20:23:18 2005 +0000
@@ -221,7 +221,7 @@
void CDECL NetworkTextMessage(NetworkAction action, uint16 color, bool self_send, const char *name, const char *str, ...);
void NetworkGetClientName(char *clientname, size_t size, const NetworkClientState *cs);
uint NetworkCalculateLag(const NetworkClientState *cs);
-byte NetworkGetCurrentLanguageIndex();
+byte NetworkGetCurrentLanguageIndex(void);
NetworkClientInfo *NetworkFindClientInfoFromIndex(uint16 client_index);
NetworkClientState *NetworkFindClientStateFromIndex(uint16 client_index);
unsigned long NetworkResolveHost(const char *hostname);
--- a/network_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/network_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -425,7 +425,7 @@
NetworkGameWindowWndProc,
};
-void ShowNetworkGameWindow()
+void ShowNetworkGameWindow(void)
{
uint i;
Window *w;
@@ -1330,7 +1330,7 @@
NetworkJoinStatusWindowWndProc,
};
-void ShowJoinStatusWindow()
+void ShowJoinStatusWindow(void)
{
DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
_network_join_status = NETWORK_JOIN_STATUS_CONNECTING;
--- a/network_server.c Sat Jan 22 19:41:30 2005 +0000
+++ b/network_server.c Sat Jan 22 20:23:18 2005 +0000
@@ -1323,7 +1323,7 @@
extern void SwitchMode(int new_mode);
/* Check if we want to restart the map */
-static void NetworkCheckRestartMap()
+static void NetworkCheckRestartMap(void)
{
if (_network_restart_game_date != 0 && _cur_year + MAX_YEAR_BEGIN_REAL >= _network_restart_game_date) {
_docommand_recursive = 0;
@@ -1342,7 +1342,7 @@
1) If a company is not protected, it is closed after 1 year (for example)
2) If a company is protected, protection is disabled after 3 years (for example)
(and item 1. happens a year later) */
-static void NetworkAutoCleanCompanies()
+static void NetworkAutoCleanCompanies(void)
{
NetworkClientState *cs;
NetworkClientInfo *ci;
--- a/oldloader.c Sat Jan 22 19:41:30 2005 +0000
+++ b/oldloader.c Sat Jan 22 20:23:18 2005 +0000
@@ -525,7 +525,7 @@
static LoadSavegameState *_cur_state;
-static byte GetSavegameByteFromBuffer()
+static byte GetSavegameByteFromBuffer(void)
{
LoadSavegameState *lss = _cur_state;
@@ -544,7 +544,7 @@
return *lss->buffer_cur++;
}
-static byte DecodeSavegameByte()
+static byte DecodeSavegameByte(void)
{
LoadSavegameState *lss = _cur_state;
int8 x;
--- a/order.h Sat Jan 22 19:41:30 2005 +0000
+++ b/order.h Sat Jan 22 20:23:18 2005 +0000
@@ -90,7 +90,7 @@
return false;
}
-static inline bool IsOrderPoolFull()
+static inline bool IsOrderPoolFull(void)
{
return !HasOrderPoolFree(1);
}
--- a/order_cmd.c Sat Jan 22 19:41:30 2005 +0000
+++ b/order_cmd.c Sat Jan 22 20:23:18 2005 +0000
@@ -80,7 +80,7 @@
* @return Order* if a free space is found, else NULL.
*
*/
-static Order *AllocateOrder()
+static Order *AllocateOrder(void)
{
Order *order;
@@ -914,7 +914,7 @@
SLE_END()
};
-static void Save_ORDR()
+static void Save_ORDR(void)
{
Order *order;
@@ -926,7 +926,7 @@
}
}
-static void Load_ORDR()
+static void Load_ORDR(void)
{
if (_sl.full_version <= 0x501) {
/* Version older than 0x502 did not have a ->next pointer. Convert them
--- a/players.c Sat Jan 22 19:41:30 2005 +0000
+++ b/players.c Sat Jan 22 20:23:18 2005 +0000
@@ -14,7 +14,7 @@
#include "sound.h"
#include "network.h"
-extern void StartupEconomy();
+extern void StartupEconomy(void);
static const SpriteID cheeks_table[4] = {
0x325, 0x326,
@@ -352,7 +352,7 @@
static const byte _color_similar_1[16] = {8, 6, 255, 12, 255, 0, 1, 1, 0, 13, 11, 10, 3, 9, 15, 14};
static const byte _color_similar_2[16] = {5, 7, 255, 255, 255, 8, 7, 6, 5, 12, 255, 255, 9, 255, 255, 255};
-static byte GeneratePlayerColor()
+static byte GeneratePlayerColor(void)
{
byte colors[16], pcolor, t2;
int i,j,n;
@@ -446,7 +446,7 @@
extern int GetPlayerMaxRailtype(int p);
-static Player *AllocatePlayer()
+static Player *AllocatePlayer(void)
{
Player *p;
// Find a free slot
@@ -496,13 +496,13 @@
return p;
}
-void StartupPlayers()
+void StartupPlayers(void)
{
// The AI starts like in the setting with +2 month max
_next_competitor_start = _opt.diff.competitor_start_time * 90 * DAY_TICKS + RandomRange(60 * DAY_TICKS) + 1;
}
-static void MaybeStartNewPlayer()
+static void MaybeStartNewPlayer(void)
{
uint n;
Player *p;
@@ -521,7 +521,7 @@
_next_competitor_start = _opt.diff.competitor_start_time * 90 * DAY_TICKS + RandomRange(60 * DAY_TICKS) + 1;
}
-void InitializePlayers()
+void InitializePlayers(void)
{
int i;
memset(_players, 0, sizeof(_players));
@@ -530,7 +530,7 @@
_cur_player_tick_index = 0;
}
-void OnTick_Players()
+void OnTick_Players(void)
{
Player *p;
@@ -546,7 +546,7 @@
}
}
-void RunOtherPlayersLoop()
+void RunOtherPlayersLoop(void)
{
Player *p;
@@ -578,7 +578,7 @@
extern void ShowPlayerFinances(int player);
-void PlayersYearlyLoop()
+void PlayersYearlyLoop(void)
{
Player *p;
@@ -1040,7 +1040,7 @@
}
}
-static void Save_PLYR()
+static void Save_PLYR(void)
{
Player *p;
FOR_ALL_PLAYERS(p) {
@@ -1051,7 +1051,7 @@
}
}
-static void Load_PLYR()
+static void Load_PLYR(void)
{
int index;
while ((index = SlIterateArray()) != -1) {
--- a/queue.c Sat Jan 22 19:41:30 2005 +0000
+++ b/queue.c Sat Jan 22 20:23:18 2005 +0000
@@ -212,7 +212,8 @@
q->freeq = false;
}
-Queue* new_InsSort() {
+Queue* new_InsSort(void)
+{
Queue* q = malloc(sizeof(Queue));
init_InsSort(q);
q->freeq = true;
--- a/queue.h Sat Jan 22 19:41:30 2005 +0000
+++ b/queue.h Sat Jan 22 20:23:18 2005 +0000
@@ -113,7 +113,7 @@
void init_InsSort(Queue* q);
/* Allocate a new fifo and initializes it. There is no maximum size */
-Queue* new_InsSort();
+Queue* new_InsSort(void);
/*
* Binary Heap
--- a/rail_cmd.c Sat Jan 22 19:41:30 2005 +0000
+++ b/rail_cmd.c Sat Jan 22 20:23:18 2005 +0000
@@ -777,7 +777,7 @@
}
// delete waypoints after a while
-void WaypointsDailyLoop()
+void WaypointsDailyLoop(void)
{
Waypoint *cp;
for(cp = _waypoints; cp != endof(_waypoints); cp++) {
@@ -2276,7 +2276,7 @@
return 0;
}
-void InitializeRail()
+void InitializeRail(void)
{
_last_built_train_depot_tile = 0;
}
--- a/rail_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/rail_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -26,9 +26,9 @@
static void HandleStationPlacement(uint start, uint end);
-static void ShowBuildTrainDepotPicker();
-static void ShowBuildWaypointPicker();
-static void ShowStationBuilder();
+static void ShowBuildTrainDepotPicker(void);
+static void ShowBuildWaypointPicker(void);
+static void ShowStationBuilder(void);
typedef void OnButtonClick(Window *w);
@@ -322,7 +322,7 @@
// This function is more or less a hack because DoRailroadTrack() would otherwise screw up
-static void SwapSelection()
+static void SwapSelection(void)
{
TileHighlightData *thd = &_thd;
Point pt = thd->selstart;
@@ -332,7 +332,7 @@
}
-static void HandleAutodirPlacement()
+static void HandleAutodirPlacement(void)
{
TileHighlightData *thd = &_thd;
int bit;
@@ -865,7 +865,7 @@
StationBuildWndProc
};
-static void ShowStationBuilder()
+static void ShowStationBuilder(void)
{
AllocateWindowDesc(&_station_builder_desc);
}
@@ -932,7 +932,7 @@
BuildTrainDepotWndProc
};
-static void ShowBuildTrainDepotPicker()
+static void ShowBuildTrainDepotPicker(void)
{
AllocateWindowDesc(&_build_depot_desc);
}
@@ -1007,7 +1007,7 @@
BuildWaypointWndProc
};
-static void ShowBuildWaypointPicker()
+static void ShowBuildWaypointPicker(void)
{
Window *w = AllocateWindowDesc(&_build_waypoint_desc);
w->hscroll.cap = 5;
@@ -1015,7 +1015,7 @@
}
-void InitializeRailGui()
+void InitializeRailGui(void)
{
_build_depot_direction = 3;
_railstation.numtracks = 1;
--- a/road_cmd.c Sat Jan 22 19:41:30 2005 +0000
+++ b/road_cmd.c Sat Jan 22 20:23:18 2005 +0000
@@ -1142,7 +1142,7 @@
}
}
-void InitializeRoad()
+void InitializeRoad(void)
{
_last_built_road_depot_tile = 0;
}
--- a/road_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/road_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -12,9 +12,9 @@
#include "station.h"
-static void ShowBusStationPicker();
-static void ShowTruckStationPicker();
-static void ShowRoadDepotPicker();
+static void ShowBusStationPicker(void);
+static void ShowTruckStationPicker(void);
+static void ShowRoadDepotPicker(void);
static bool _remove_button_clicked;
static bool _build_road_flag;
@@ -302,7 +302,7 @@
BuildRoadToolbWndProc
};
-void ShowBuildRoadToolbar()
+void ShowBuildRoadToolbar(void)
{
if (_current_player == OWNER_SPECTATOR) return;
DeleteWindowById(WC_BUILD_TOOLBAR, 0);
@@ -335,7 +335,7 @@
BuildRoadToolbWndProc
};
-void ShowBuildRoadScenToolbar()
+void ShowBuildRoadScenToolbar(void)
{
AllocateWindowDescFront(&_build_road_scen_desc, 0);
}
@@ -398,7 +398,7 @@
BuildRoadDepotWndProc
};
-static void ShowRoadDepotPicker()
+static void ShowRoadDepotPicker(void)
{
AllocateWindowDesc(&_build_road_depot_desc);
}
@@ -493,7 +493,7 @@
RoadStationPickerWndProc
};
-static void ShowBusStationPicker()
+static void ShowBusStationPicker(void)
{
AllocateWindowDesc(&_bus_station_picker_desc);
}
@@ -519,12 +519,12 @@
RoadStationPickerWndProc
};
-static void ShowTruckStationPicker()
+static void ShowTruckStationPicker(void)
{
AllocateWindowDesc(&_truck_station_picker_desc);
}
-void InitializeRoadGui()
+void InitializeRoadGui(void)
{
_road_depot_orientation = 3;
_road_station_picker_orientation = 3;
--- a/roadveh_cmd.c Sat Jan 22 19:41:30 2005 +0000
+++ b/roadveh_cmd.c Sat Jan 22 20:23:18 2005 +0000
@@ -1509,7 +1509,7 @@
ShowRoadVehViewWindow(v);
}
-void RoadVehiclesYearlyLoop()
+void RoadVehiclesYearlyLoop(void)
{
Vehicle *v;
--- a/saveload.c Sat Jan 22 19:41:30 2005 +0000
+++ b/saveload.c Sat Jan 22 20:23:18 2005 +0000
@@ -22,7 +22,7 @@
SaverLoader _sl;
// fill the input buffer
-static void SlReadFill()
+static void SlReadFill(void)
{
uint len = _sl.read_bytes();
assert(len != 0);
@@ -32,13 +32,13 @@
_sl.offs_base += len;
}
-static uint32 SlGetOffs()
+static uint32 SlGetOffs(void)
{
return _sl.offs_base - (_sl.bufe - _sl.bufp);
}
// flush the output buffer
-static void SlWriteFill()
+static void SlWriteFill(void)
{
// flush current buffer?
if (_sl.bufp != NULL) {
@@ -59,7 +59,7 @@
longjmp(_sl.excpt, 0);
}
-int SlReadByte()
+int SlReadByte(void)
{
if (_sl.bufp == _sl.bufe) SlReadFill();
return *_sl.bufp++;
@@ -71,19 +71,19 @@
*_sl.bufp++ = v;
}
-static int SlReadUint16()
+static int SlReadUint16(void)
{
int x = SlReadByte() << 8;
return x | SlReadByte();
}
-static uint32 SlReadUint32()
+static uint32 SlReadUint32(void)
{
uint32 x = SlReadUint16() << 16;
return x | SlReadUint16();
}
-static uint64 SlReadUint64()
+static uint64 SlReadUint64(void)
{
uint32 x = SlReadUint32();
uint32 y = SlReadUint32();
@@ -108,7 +108,7 @@
SlWriteUint32((uint32)x);
}
-static int SlReadSimpleGamma()
+static int SlReadSimpleGamma(void)
{
int x = SlReadByte();
if (x & 0x80)
@@ -131,7 +131,7 @@
return (i>=0x80) ? 2 : 1;
}
-inline int SlReadSparseIndex()
+inline int SlReadSparseIndex(void)
{
return SlReadSimpleGamma();
}
@@ -141,7 +141,7 @@
SlWriteSimpleGamma(index);
}
-inline int SlReadArrayLength()
+inline int SlReadArrayLength(void)
{
return SlReadSimpleGamma();
}
@@ -157,7 +157,7 @@
_sl.array_index = index;
}
-int SlIterateArray()
+int SlIterateArray(void)
{
int ind;
static uint32 next_offs;
@@ -249,7 +249,7 @@
}
}
-uint SlGetFieldLength()
+uint SlGetFieldLength(void)
{
return _sl.obj_len;
}
@@ -583,7 +583,7 @@
_tmp_proc_1();
}
-static void SlStubSaveProc()
+static void SlStubSaveProc(void)
{
SlAutolength(SlStubSaveProc2, NULL);
}
@@ -623,7 +623,7 @@
}
}
-static void SlSaveChunks()
+static void SlSaveChunks(void)
{
const ChunkHandler *ch;
const ChunkHandler * const * chsc;
@@ -661,7 +661,7 @@
return NULL;
}
-static void SlLoadChunks()
+static void SlLoadChunks(void)
{
uint32 id;
const ChunkHandler *ch;
@@ -686,7 +686,7 @@
#include "minilzo.h"
-static uint ReadLZO()
+static uint ReadLZO(void)
{
byte out[LZO_SIZE + LZO_SIZE / 64 + 16 + 3 + 8];
uint32 tmp[2];
@@ -731,20 +731,22 @@
if (fwrite(out, outlen + sizeof(uint32)*2, 1, _sl.fh) != 1) SlError("file write failed");
}
-static bool InitLZO() {
+static bool InitLZO(void)
+{
_sl.bufsize = LZO_SIZE;
_sl.buf = (byte*)malloc(LZO_SIZE);
return true;
}
-static void UninitLZO() {
+static void UninitLZO(void)
+{
free(_sl.buf);
}
//*******************************************
//******** START OF NOCOMP CODE *************
//*******************************************
-static uint ReadNoComp()
+static uint ReadNoComp(void)
{
return fread(_sl.buf, 1, LZO_SIZE, _sl.fh);
}
@@ -754,14 +756,14 @@
fwrite(_sl.buf, 1, size, _sl.fh);
}
-static bool InitNoComp()
+static bool InitNoComp(void)
{
_sl.bufsize = LZO_SIZE;
_sl.buf = (byte*)malloc(LZO_SIZE);
return true;
}
-static void UninitNoComp()
+static void UninitNoComp(void)
{
free(_sl.buf);
}
@@ -774,7 +776,7 @@
#include <zlib.h>
static z_stream _z;
-static bool InitReadZlib()
+static bool InitReadZlib(void)
{
memset(&_z, 0, sizeof(_z));
if (inflateInit(&_z) != Z_OK) return false;
@@ -784,7 +786,7 @@
return true;
}
-static uint ReadZlib()
+static uint ReadZlib(void)
{
int r;
@@ -809,13 +811,13 @@
return 4096 - _z.avail_out;
}
-static void UninitReadZlib()
+static void UninitReadZlib(void)
{
inflateEnd(&_z);
free(_sl.buf);
}
-static bool InitWriteZlib()
+static bool InitWriteZlib(void)
{
memset(&_z, 0, sizeof(_z));
if (deflateInit(&_z, 6) != Z_OK) return false;
@@ -851,7 +853,7 @@
WriteZlibLoop(&_z, _sl.buf, len, 0);
}
-static void UninitWriteZlib()
+static void UninitWriteZlib(void)
{
// flush any pending output.
if (_sl.fh) WriteZlibLoop(&_z, NULL, 0, Z_FINISH);
@@ -958,13 +960,13 @@
const char *name;
uint32 tag;
- bool (*init_read)();
+ bool (*init_read)(void);
ReaderProc *reader;
- void (*uninit_read)();
+ void (*uninit_read)(void);
- bool (*init_write)();
+ bool (*init_write)(void);
WriterProc *writer;
- void (*uninit_write)();
+ void (*uninit_write)(void);
} SaveLoadFormat;
@@ -998,9 +1000,9 @@
}
// actual loader/saver function
-extern void InitializeGame();
+extern void InitializeGame(void);
extern bool AfterLoadGame(uint version);
-extern void BeforeSaveGame();
+extern void BeforeSaveGame(void);
extern bool LoadOldSaveGame(const char *file);
// Save or Load files SL_LOAD, SL_SAVE, SL_OLD_LOAD
@@ -1132,13 +1134,13 @@
return SL_OK;
}
-bool EmergencySave()
+bool EmergencySave(void)
{
SaveOrLoad("crash.sav", SL_SAVE);
return true;
}
-void DoExitSave()
+void DoExitSave(void)
{
char buf[200];
sprintf(buf, "%s%sexit.sav", _path.autosave_dir, PATHSEP);
--- a/saveload.h Sat Jan 22 19:41:30 2005 +0000
+++ b/saveload.h Sat Jan 22 20:23:18 2005 +0000
@@ -3,7 +3,7 @@
#include <setjmp.h>
-typedef void ChunkSaveLoadProc();
+typedef void ChunkSaveLoadProc(void);
typedef void AutolengthProc(void *arg);
typedef struct SaveLoadGlobVarList {
@@ -26,7 +26,7 @@
} NullStruct;
typedef void WriterProc(uint len);
-typedef uint ReaderProc();
+typedef uint ReaderProc(void);
typedef uint ReferenceToIntProc(void *v, uint t);
typedef void *IntToReferenceProc(uint r, uint t);
@@ -62,7 +62,7 @@
uint bufsize;
FILE *fh;
- void (*excpt_uninit)();
+ void (*excpt_uninit)(void);
const char *excpt_msg;
jmp_buf excpt; // used to jump to "exception handler"
} SaverLoader;
@@ -159,12 +159,12 @@
void SlSetArrayIndex(uint index);
-int SlIterateArray();
+int SlIterateArray(void);
void SlArray(void *array, uint length, uint conv);
void SlObject(void *object, const void *desc);
void SlAutolength(AutolengthProc *proc, void *arg);
-uint SlGetFieldLength();
-int SlReadByte();
+uint SlGetFieldLength(void);
+int SlReadByte(void);
void SlSetLength(uint length);
void SlWriteByte(byte v);
void SlGlobList(const SaveLoadGlobVarList *desc);
--- a/sdl.c Sat Jan 22 19:41:30 2005 +0000
+++ b/sdl.c Sat Jan 22 20:23:18 2005 +0000
@@ -441,7 +441,7 @@
return (key << 16) + sym->unicode;
}
-void DoExitSave();
+void DoExitSave(void);
static int PollEvent(void)
{
--- a/settings.c Sat Jan 22 19:41:30 2005 +0000
+++ b/settings.c Sat Jan 22 20:23:18 2005 +0000
@@ -104,7 +104,7 @@
};
// allocate an inifile object
-static IniFile *ini_alloc()
+static IniFile *ini_alloc(void)
{
IniFile *ini;
MemoryPool *pool;
@@ -981,7 +981,7 @@
}
}
-void LoadFromConfig()
+void LoadFromConfig(void)
{
IniFile *ini = ini_load(_config_file);
HandleSettingDescs(ini, load_setting_desc);
@@ -991,7 +991,7 @@
ini_free(ini);
}
-void SaveToConfig()
+void SaveToConfig(void)
{
IniFile *ini = ini_load(_config_file);
HandleSettingDescs(ini, save_setting_desc);
--- a/settings_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/settings_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -17,7 +17,7 @@
static byte _difficulty_timeout;
extern const StringID _currency_string_list[];
-extern uint GetMaskOfAllowedCurrencies();
+extern uint GetMaskOfAllowedCurrencies(void);
static const StringID _distances_dropdown[] = {
STR_0139_IMPERIAL_MILES,
@@ -55,7 +55,7 @@
return buf;
}
-static int GetCurRes()
+static int GetCurRes(void)
{
int i;
for(i = 0; i != _num_resolutions; i++)
@@ -269,7 +269,7 @@
};
-void ShowGameOptions()
+void ShowGameOptions(void)
{
DeleteWindowById(WC_GAME_OPTIONS, 0);
AllocateWindowDesc(&_game_options_desc);
@@ -328,7 +328,7 @@
}
}
-extern void StartupEconomy();
+extern void StartupEconomy(void);
enum {
GAMEDIFF_WND_TOP_OFFSET = 45,
@@ -506,7 +506,7 @@
GameDifficultyWndProc
};
-void ShowGameDifficulty()
+void ShowGameDifficulty(void)
{
DeleteWindowById(WC_GAME_OPTIONS, 0);
/* copy current settings to temporary holding place
@@ -715,7 +715,7 @@
{_patches_ai, lengthof(_patches_ai) },
};
-extern uint GetCurrentCurrencyRate();
+extern uint GetCurrentCurrencyRate(void);
static int32 ReadPE(const PatchEntry*pe)
{
@@ -1154,7 +1154,7 @@
PatchesSelectionWndProc,
};
-void ShowPatchesSelection()
+void ShowPatchesSelection(void)
{
DeleteWindowById(WC_GAME_OPTIONS, 0);
AllocateWindowDesc(&_patches_selection_desc);
@@ -1281,7 +1281,7 @@
NewgrfWndProc,
};
-void ShowNewgrf()
+void ShowNewgrf(void)
{
Window *w;
DeleteWindowById(WC_GAME_OPTIONS, 0);
@@ -1509,7 +1509,7 @@
CustCurrencyWndProc,
};
-void ShowCustCurrency()
+void ShowCustCurrency(void)
{
Window *w;
--- a/ship_cmd.c Sat Jan 22 19:41:30 2005 +0000
+++ b/ship_cmd.c Sat Jan 22 20:23:18 2005 +0000
@@ -789,7 +789,7 @@
ShowShipViewWindow(v);
}
-void ShipsYearlyLoop()
+void ShipsYearlyLoop(void)
{
Vehicle *v;
--- a/signs.c Sat Jan 22 19:41:30 2005 +0000
+++ b/signs.c Sat Jan 22 20:23:18 2005 +0000
@@ -22,7 +22,7 @@
* Update the coordinates of all signs
*
*/
-void UpdateAllSignVirtCoords()
+void UpdateAllSignVirtCoords(void)
{
SignStruct *ss;
@@ -53,7 +53,7 @@
*
* @return The pointer to the new sign, or NULL if there is no more free space
*/
-static SignStruct *AllocateSign()
+static SignStruct *AllocateSign(void)
{
SignStruct *s;
FOR_ALL_SIGNS(s)
@@ -173,7 +173,7 @@
* Initialize the signs
*
*/
-void InitializeSigns()
+void InitializeSigns(void)
{
SignStruct *s;
int i;
@@ -200,7 +200,7 @@
* Save all signs
*
*/
-static void Save_SIGN()
+static void Save_SIGN(void)
{
SignStruct *s;
@@ -218,7 +218,7 @@
* Load all signs
*
*/
-static void Load_SIGN()
+static void Load_SIGN(void)
{
int index;
while ((index = SlIterateArray()) != -1) {
--- a/signs.h Sat Jan 22 19:41:30 2005 +0000
+++ b/signs.h Sat Jan 22 20:23:18 2005 +0000
@@ -24,7 +24,7 @@
VARDEF SignStruct *_new_sign_struct;
-void UpdateAllSignVirtCoords();
+void UpdateAllSignVirtCoords(void);
void PlaceProc_Sign(uint tile);
/* misc.c */
--- a/smallmap_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/smallmap_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -899,7 +899,7 @@
SmallMapWindowProc
};
-void ShowSmallMap()
+void ShowSmallMap(void)
{
Window *w;
ViewPort *vp;
@@ -997,7 +997,7 @@
ExtraViewPortWndProc
};
-void ShowExtraViewPortWindow()
+void ShowExtraViewPortWindow(void)
{
Window *w, *v;
int i = 0;
--- a/spritecache.c Sat Jan 22 19:41:30 2005 +0000
+++ b/spritecache.c Sat Jan 22 20:23:18 2005 +0000
@@ -82,7 +82,7 @@
_slopes_spriteindexes_3,
};
-static void CompactSpriteCache();
+static void CompactSpriteCache(void);
static void ReadSpriteHeaderSkipData(int num, int load_index)
{
@@ -409,7 +409,7 @@
#define S_FREE_MASK 1
#define S_HDRSIZE sizeof(uint32)
-static uint32 GetSpriteCacheUsage()
+static uint32 GetSpriteCacheUsage(void)
{
byte *s = _spritecache_ptr;
size_t cur_size, tot_size = 0;
@@ -425,7 +425,7 @@
}
-void IncreaseSpriteLRU()
+void IncreaseSpriteLRU(void)
{
int i;
@@ -461,7 +461,7 @@
// Called when holes in the sprite cache should be removed.
// That is accomplished by moving the cached data.
-static void CompactSpriteCache()
+static void CompactSpriteCache(void)
{
byte *s, *t;
size_t size, sizeb, cur_size;
@@ -519,7 +519,7 @@
}
}
-static void DeleteEntryFromSpriteCache()
+static void DeleteEntryFromSpriteCache(void)
{
int i;
int best = -1;
@@ -814,7 +814,7 @@
* If neither are found, Windows palette is assumed.
*
* (Note: Also checks sample.cat for corruption) */
-void CheckExternalFiles()
+void CheckExternalFiles(void)
{
int i;
int dos=0, win=0; // count of files from this version
@@ -845,7 +845,7 @@
}
}
-static void LoadSpriteTables()
+static void LoadSpriteTables(void)
{
int i,j;
FileList *files; // list of grf files to be loaded. Either Windows files or DOS files
@@ -957,7 +957,8 @@
}
-void GfxLoadSprites() {
+void GfxLoadSprites(void)
+{
static byte *_sprite_mem;
// Need to reload the sprites only if the landscape changed
--- a/station.h Sat Jan 22 19:41:30 2005 +0000
+++ b/station.h Sat Jan 22 20:23:18 2005 +0000
@@ -91,7 +91,7 @@
TileIndex GetStationTileForVehicle(const Vehicle *v, const Station *st);
void ShowStationViewWindow(int station);
-void UpdateAllStationVirtCoord();
+void UpdateAllStationVirtCoord(void);
VARDEF Station _stations[250];
VARDEF uint _stations_size;
--- a/station_cmd.c Sat Jan 22 19:41:30 2005 +0000
+++ b/station_cmd.c Sat Jan 22 20:23:18 2005 +0000
@@ -137,7 +137,7 @@
return true;
}
-static Station *AllocateStation()
+static Station *AllocateStation(void)
{
Station *st, *a_free = NULL;
int num_free = 0;
@@ -360,7 +360,7 @@
}
// Update the virtual coords needed to draw the station sign for all stations.
-void UpdateAllStationVirtCoord()
+void UpdateAllStationVirtCoord(void)
{
Station *st;
FOR_ALL_STATIONS(st) {
@@ -2293,7 +2293,7 @@
DeleteSubsidyWithStation(index);
}
-void DeleteAllPlayerStations()
+void DeleteAllPlayerStations(void)
{
Station *st;
@@ -2433,7 +2433,7 @@
UpdateStationRating(st);
}
-void OnTick_Station()
+void OnTick_Station(void)
{
int i;
Station *st;
@@ -2456,7 +2456,7 @@
}
-void StationMonthlyLoop()
+void StationMonthlyLoop(void)
{
}
@@ -2772,7 +2772,7 @@
}
-void InitializeStations()
+void InitializeStations(void)
{
int i;
Station *s;
@@ -2874,7 +2874,7 @@
SlObject(&st->goods[i], _goods_desc);
}
-static void Save_STNS()
+static void Save_STNS(void)
{
Station *st;
// Write the stations
@@ -2886,7 +2886,7 @@
}
}
-static void Load_STNS()
+static void Load_STNS(void)
{
int index;
while ((index = SlIterateArray()) != -1) {
--- a/station_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/station_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -73,7 +73,7 @@
return strcmp(buf1, _bufcache); // sort by name
}
-static void GlobalSortStationList()
+static void GlobalSortStationList(void)
{
const Station *st;
uint32 n = 0;
--- a/strings.c Sat Jan 22 19:41:30 2005 +0000
+++ b/strings.c Sat Jan 22 20:23:18 2005 +0000
@@ -114,14 +114,14 @@
}
-int32 GetParamInt32()
+int32 GetParamInt32(void)
{
int32 result = GetDParam(0);
memmove(&_decode_parameters[0], &_decode_parameters[1], sizeof(uint32) * (lengthof(_decode_parameters)-1));
return result;
}
-static int64 GetParamInt64()
+static int64 GetParamInt64(void)
{
int64 result = GetDParam(0) + ((uint64)GetDParam(1) << 32);
memmove(&_decode_parameters[0], &_decode_parameters[2], sizeof(uint32) * (lengthof(_decode_parameters)-2));
@@ -129,21 +129,21 @@
}
-int GetParamInt16()
+int GetParamInt16(void)
{
int result = (int16)GetDParam(0);
memmove(&_decode_parameters[0], &_decode_parameters[1], sizeof(uint32) * (lengthof(_decode_parameters)-1));
return result;
}
-int GetParamInt8()
+int GetParamInt8(void)
{
int result = (int8)GetDParam(0);
memmove(&_decode_parameters[0], &_decode_parameters[1], sizeof(uint32) * (lengthof(_decode_parameters)-1));
return result;
}
-int GetParamUint16()
+int GetParamUint16(void)
{
int result = GetDParam(0);
memmove(&_decode_parameters[0], &_decode_parameters[1], sizeof(uint32) * (lengthof(_decode_parameters)-1));
@@ -259,7 +259,8 @@
return FormatNoCommaNumber(buff, ymd.year + MAX_YEAR_BEGIN_REAL);
}
-uint GetCurrentCurrencyRate() {
+uint GetCurrentCurrencyRate(void)
+{
return (&_currency_specs[_opt.currency])->rate;
}
@@ -777,7 +778,7 @@
}
// make a list of the available language packs. put the data in _dynlang struct.
-void InitializeLanguagePacks()
+void InitializeLanguagePacks(void)
{
DynamicLanguages *dl = &_dynlang;
int i, j, n, m,def;
--- a/subsidy_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/subsidy_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -159,7 +159,7 @@
};
-void ShowSubsidiesList()
+void ShowSubsidiesList(void)
{
AllocateWindowDescFront(&_subsidies_list_desc, 0);
}
--- a/terraform_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/terraform_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -209,7 +209,7 @@
-void ShowTerraformToolbar()
+void ShowTerraformToolbar(void)
{
if (_current_player == OWNER_SPECTATOR) return;
AllocateWindowDescFront(&_terraform_desc, 0);
--- a/texteff.c Sat Jan 22 19:41:30 2005 +0000
+++ b/texteff.c Sat Jan 22 20:23:18 2005 +0000
@@ -87,7 +87,7 @@
_textmessage_dirty = true;
}
-void InitTextMessage()
+void InitTextMessage(void)
{
int i;
for (i = 0; i < MAX_CHAT_MESSAGES; i++) {
@@ -98,7 +98,7 @@
}
// Hide the textbox
-void UndrawTextMessage()
+void UndrawTextMessage(void)
{
if (_textmessage_visible) {
// Sometimes we also need to hide the cursor
@@ -135,7 +135,7 @@
}
// Check if a message is expired every day
-void TextMessageDailyLoop()
+void TextMessageDailyLoop(void)
{
int i = 0;
while (i < MAX_CHAT_MESSAGES) {
@@ -151,7 +151,7 @@
}
// Draw the textmessage-box
-void DrawTextMessage()
+void DrawTextMessage(void)
{
int i, j;
bool has_message;
@@ -250,7 +250,7 @@
MarkTextEffectAreaDirty(te);
}
-void MoveAllTextEffects()
+void MoveAllTextEffects(void)
{
TextEffect *te;
@@ -260,7 +260,7 @@
}
}
-void InitTextEffects()
+void InitTextEffects(void)
{
TextEffect *te;
@@ -334,7 +334,7 @@
return false;
}
-void AnimateAnimatedTiles()
+void AnimateAnimatedTiles(void)
{
TileIndex *ti;
uint tile;
@@ -344,12 +344,12 @@
}
}
-void InitializeAnimatedTiles()
+void InitializeAnimatedTiles(void)
{
memset(_animated_tile_list, 0, sizeof(_animated_tile_list));
}
-static void SaveLoad_ANIT()
+static void SaveLoad_ANIT(void)
{
SlArray(_animated_tile_list, lengthof(_animated_tile_list), SLE_UINT16);
}
--- a/town.h Sat Jan 22 19:41:30 2005 +0000
+++ b/town.h Sat Jan 22 20:23:18 2005 +0000
@@ -73,15 +73,15 @@
uint16 radius[5];
};
-uint32 GetWorldPopulation();
+uint32 GetWorldPopulation(void);
void UpdateTownVirtCoord(Town *t);
-void InitializeTown();
+void InitializeTown(void);
void ShowTownViewWindow(uint town);
void DeleteTown(Town *t);
void ExpandTown(Town *t);
bool GrowTown(Town *t);
-Town *CreateRandomTown();
+Town *CreateRandomTown(void);
enum {
ROAD_REMOVE = 0,
--- a/town_cmd.c Sat Jan 22 19:41:30 2005 +0000
+++ b/town_cmd.c Sat Jan 22 20:23:18 2005 +0000
@@ -203,7 +203,7 @@
if (_town_sort_order & 2) _town_sort_dirty = true;
}
-uint32 GetWorldPopulation()
+uint32 GetWorldPopulation(void)
{
uint32 pop;
Town *t;
@@ -403,7 +403,7 @@
UpdateTownRadius(t);
}
-void OnTick_Town()
+void OnTick_Town(void)
{
uint i;
Town *t;
@@ -730,7 +730,7 @@
// Generate a random road block
// The probability of a straight road
// is somewhat higher than a curved.
-static int GenRandomRoadBits()
+static int GenRandomRoadBits(void)
{
uint32 r = Random();
int a = r&3, b = (r >> 8) & 3;
@@ -948,7 +948,7 @@
UpdateTownMaxPass(t);
}
-static Town *AllocateTown()
+static Town *AllocateTown(void)
{
Town *t;
FOR_ALL_TOWNS(t) {
@@ -995,7 +995,7 @@
return 0;
}
-Town *CreateRandomTown()
+Town *CreateRandomTown(void)
{
uint tile;
TileInfo ti;
@@ -1034,7 +1034,7 @@
11, 23, 46
};
-void GenerateTowns()
+void GenerateTowns(void)
{
uint n;
n = _num_initial_towns[_opt.diff.number_towns] + (Random()&7);
@@ -1806,7 +1806,7 @@
return true;
}
-void TownsMonthlyLoop()
+void TownsMonthlyLoop(void)
{
Town *t;
@@ -1824,7 +1824,7 @@
}
}
-void InitializeTowns()
+void InitializeTowns(void)
{
Subsidy *s;
Town *t;
@@ -1917,7 +1917,7 @@
SLE_END()
};
-static void Save_TOWN()
+static void Save_TOWN(void)
{
Town *t;
@@ -1929,7 +1929,7 @@
}
}
-static void Load_TOWN()
+static void Load_TOWN(void)
{
int index;
while ((index = SlIterateArray()) != -1) {
@@ -1940,7 +1940,7 @@
}
}
-void AfterLoadTown()
+void AfterLoadTown(void)
{
Town *t;
FOR_ALL_TOWNS(t) {
--- a/town_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/town_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -395,7 +395,7 @@
return r;
}
-static void MakeSortedTownList()
+static void MakeSortedTownList(void)
{
Town *t;
int n = 0;
@@ -509,7 +509,7 @@
};
-void ShowTownDirectory()
+void ShowTownDirectory(void)
{
Window *w;
--- a/train_cmd.c Sat Jan 22 19:41:30 2005 +0000
+++ b/train_cmd.c Sat Jan 22 20:23:18 2005 +0000
@@ -1234,7 +1234,7 @@
return 0;
}
-void OnTick_Train()
+void OnTick_Train(void)
{
_age_cargo_skip_counter = (_age_cargo_skip_counter == 0) ? 184 : (_age_cargo_skip_counter - 1);
}
@@ -2782,7 +2782,7 @@
}
}
-void TrainsYearlyLoop()
+void TrainsYearlyLoop(void)
{
Vehicle *v;
@@ -2815,7 +2815,7 @@
ShowTrainViewWindow(v);
}
-void InitializeTrains()
+void InitializeTrains(void)
{
_age_cargo_skip_counter = 1;
}
--- a/tree_cmd.c Sat Jan 22 19:41:30 2005 +0000
+++ b/tree_cmd.c Sat Jan 22 20:23:18 2005 +0000
@@ -88,7 +88,7 @@
} while (--i);
}
-static void PlaceMoreTrees()
+static void PlaceMoreTrees(void)
{
int i = (Random() & 0x1F) + 25;
do {
@@ -96,7 +96,7 @@
} while (--i);
}
-void PlaceTreesRandomly()
+void PlaceTreesRandomly(void)
{
int i;
uint32 r;
@@ -126,7 +126,7 @@
}
}
-void GenerateTrees()
+void GenerateTrees(void)
{
int i;
@@ -568,7 +568,7 @@
MarkTileDirtyByTile(tile);
}
-void OnTick_Trees()
+void OnTick_Trees(void)
{
uint32 r;
uint tile;
@@ -638,7 +638,7 @@
/* not used */
}
-void InitializeTrees()
+void InitializeTrees(void)
{
_trees_tick_ctr = 0;
}
--- a/ttd.c Sat Jan 22 19:41:30 2005 +0000
+++ b/ttd.c Sat Jan 22 20:23:18 2005 +0000
@@ -30,16 +30,16 @@
#include <stdarg.h>
-void IncreaseSpriteLRU();
+void IncreaseSpriteLRU(void);
void GenerateWorld(int mode);
-void CallLandscapeTick();
-void IncreaseDate();
-void RunOtherPlayersLoop();
-void DoPaletteAnimations();
-void MusicLoop();
-void ResetMusic();
-void InitializeStations();
-void DeleteAllPlayerStations();
+void CallLandscapeTick(void);
+void IncreaseDate(void);
+void RunOtherPlayersLoop(void);
+void DoPaletteAnimations(void);
+void MusicLoop(void);
+void ResetMusic(void);
+void InitializeStations(void);
+void DeleteAllPlayerStations(void);
extern void SetDifficultyLevel(int mode, GameOptions *gm_opt);
extern void DoStartupNewPlayer(bool is_ai);
@@ -48,7 +48,7 @@
void redsq_debug(int tile);
bool LoadSavegame(const char *filename);
-extern void HalGameLoop();
+extern void HalGameLoop(void);
uint32 _pixels_redrawn;
bool _dbg_screen_rect;
@@ -110,10 +110,10 @@
// NULL midi driver
static char *NullMidiStart(char **parm) { return NULL; }
-static void NullMidiStop() {}
+static void NullMidiStop(void) {}
static void NullMidiPlaySong(const char *filename) {}
-static void NullMidiStopSong() {}
-static bool NullMidiIsSongPlaying() { return true; }
+static void NullMidiStopSong(void) {}
+static bool NullMidiIsSongPlaying(void) { return true; }
static void NullMidiSetVolume(byte vol) {}
const HalMusicDriver _null_music_driver = {
@@ -133,9 +133,10 @@
_null_video_mem = malloc(_cur_resolution[0]*_cur_resolution[1]);
return NULL;
}
-static void NullVideoStop() { free(_null_video_mem); }
+static void NullVideoStop(void) { free(_null_video_mem); }
static void NullVideoMakeDirty(int left, int top, int width, int height) {}
-static int NullVideoMainLoop() {
+static int NullVideoMainLoop(void)
+{
int i = 1000;
do {
GameLoop();
@@ -158,7 +159,7 @@
// NULL sound driver
static char *NullSoundStart(char **parm) { return NULL; }
-static void NullSoundStop() {}
+static void NullSoundStop(void) {}
const HalSoundDriver _null_sound_driver = {
NullSoundStart,
NullSoundStop,
@@ -289,7 +290,7 @@
*var = drv;
}
-static void showhelp()
+static void showhelp(void)
{
char buf[4096], *p;
const DriverClass *dc = _driver_classes;
@@ -512,7 +513,7 @@
}
-void LoadIntroGame()
+void LoadIntroGame(void)
{
char filename[256];
_game_mode = GM_MENU;
@@ -546,7 +547,7 @@
}
extern void DedicatedFork(void);
-extern void CheckExternalFiles();
+extern void CheckExternalFiles(void);
int ttd_main(int argc, char* argv[])
{
@@ -775,7 +776,7 @@
}
-void MakeNewGame()
+void MakeNewGame(void)
{
_game_mode = GM_NORMAL;
@@ -807,7 +808,7 @@
MarkWholeScreenDirty();
}
-static void MakeNewEditorWorld()
+static void MakeNewEditorWorld(void)
{
_game_mode = GM_EDITOR;
@@ -830,10 +831,10 @@
MarkWholeScreenDirty();
}
-void StartupPlayers();
-void StartupDisasters();
+void StartupPlayers(void);
+void StartupDisasters(void);
-void StartScenario()
+void StartScenario(void)
{
_game_mode = GM_NORMAL;
@@ -1028,7 +1029,7 @@
// The state must not be changed from anywhere
// but here.
// That check is enforced in DoCommand.
-void StateGameLoop()
+void StateGameLoop(void)
{
// dont execute the state loop during pause
if (_pause) return;
@@ -1078,7 +1079,7 @@
_in_state_game_loop = false;
}
-static void DoAutosave()
+static void DoAutosave(void)
{
char buf[200];
@@ -1103,7 +1104,7 @@
ShowErrorMessage(INVALID_STRING_ID, STR_AUTOSAVE_FAILED, 0, 0);
}
-void GameLoop()
+void GameLoop(void)
{
int m;
@@ -1178,7 +1179,7 @@
MusicLoop();
}
-void BeforeSaveGame()
+void BeforeSaveGame(void)
{
Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
@@ -1189,7 +1190,7 @@
}
}
-void ConvertTownOwner()
+void ConvertTownOwner(void)
{
uint tile;
@@ -1208,7 +1209,7 @@
}
// before savegame version 4, the name of the company determined if it existed
-void CheckIsPlayerActive()
+void CheckIsPlayerActive(void)
{
Player *p;
FOR_ALL_PLAYERS(p) {
@@ -1219,7 +1220,7 @@
}
// since savegame version 4.1, exclusive transport rights are stored at towns
-void UpdateExclusiveRights()
+void UpdateExclusiveRights(void)
{
Town *t;
FOR_ALL_TOWNS(t) if (t->xy != 0) {
@@ -1244,14 +1245,14 @@
18, 2, 20, };
// since savegame version 4.2 the currencies are arranged differently
-void UpdateCurrencies()
+void UpdateCurrencies(void)
{
_opt.currency = convert_currency[_opt.currency];
}
// up to revision 1413, the invisible tiles at the southern border have not been MP_VOID
// even though they should have. This is fixed by this function
-void UpdateVoidTiles()
+void UpdateVoidTiles(void)
{
uint i;
// create void tiles on the border
--- a/unix.c Sat Jan 22 19:41:30 2005 +0000
+++ b/unix.c Sat Jan 22 20:23:18 2005 +0000
@@ -34,7 +34,7 @@
static FiosItem *_fios_items;
static int _fios_count, _fios_alloc;
-static FiosItem *FiosAlloc()
+static FiosItem *FiosAlloc(void)
{
if (_fios_count == _fios_alloc) {
_fios_alloc += 256;
@@ -243,7 +243,7 @@
// Free the list of savegames
-void FiosFreeSavegameList()
+void FiosFreeSavegameList(void)
{
free(_fios_items);
_fios_items = NULL;
@@ -370,7 +370,7 @@
/* GetOSVersion returns the minimal required version of OS to be able to use that driver.
Not needed for *nix. */
-byte GetOSVersion()
+byte GetOSVersion(void)
{
return 2; // any arbitrary number bigger than 0
// numbers lower than 2 breaks default music selection on mac
@@ -451,7 +451,7 @@
return ttd_main(argc, argv);
}
-void DeterminePaths()
+void DeterminePaths(void)
{
char *s;
--- a/unmovable_cmd.c Sat Jan 22 19:41:30 2005 +0000
+++ b/unmovable_cmd.c Sat Jan 22 20:23:18 2005 +0000
@@ -246,7 +246,7 @@
return true;
}
-void GenerateUnmovables()
+void GenerateUnmovables(void)
{
int i,j;
uint tile;
--- a/vehicle.c Sat Jan 22 19:41:30 2005 +0000
+++ b/vehicle.c Sat Jan 22 20:23:18 2005 +0000
@@ -158,7 +158,7 @@
}
// Called after load to update coordinates
-void AfterLoadVehicles()
+void AfterLoadVehicles(void)
{
Vehicle *v;
Waypoint *cp;
@@ -202,7 +202,7 @@
return v;
}
-Vehicle *ForceAllocateSpecialVehicle()
+Vehicle *ForceAllocateSpecialVehicle(void)
{
Vehicle *v;
FOR_ALL_VEHICLES_FROM(v, NUM_NORMAL_VEHICLES) {
@@ -213,7 +213,7 @@
}
-Vehicle *ForceAllocateVehicle()
+Vehicle *ForceAllocateVehicle(void)
{
Vehicle *v;
FOR_ALL_VEHICLES(v) {
@@ -226,7 +226,7 @@
return NULL;
}
-Vehicle *AllocateVehicle()
+Vehicle *AllocateVehicle(void)
{
Vehicle *v;
int num;
@@ -327,7 +327,7 @@
}
}
-void InitializeVehicles()
+void InitializeVehicles(void)
{
Vehicle *v;
int i;
@@ -385,7 +385,7 @@
}
-Depot *AllocateDepot()
+Depot *AllocateDepot(void)
{
Depot *dep, *free_dep = NULL;
int num_free = 0;
@@ -407,7 +407,7 @@
return free_dep;
}
-Waypoint *AllocateWaypoint()
+Waypoint *AllocateWaypoint(void)
{
Waypoint *cp;
@@ -485,7 +485,7 @@
DisasterVehicle_Tick,
};
-void CallVehicleTicks()
+void CallVehicleTicks(void)
{
Vehicle *v;
@@ -1981,7 +1981,7 @@
};
// Will be called when the vehicles need to be saved.
-static void Save_VEHS()
+static void Save_VEHS(void)
{
Vehicle *v;
// Write the vehicles
@@ -1994,7 +1994,7 @@
}
// Will be called when vehicles need to be loaded.
-static void Load_VEHS()
+static void Load_VEHS(void)
{
int index;
Vehicle *v;
@@ -2064,7 +2064,7 @@
SLE_END()
};
-static void Save_DEPT()
+static void Save_DEPT(void)
{
Depot *d;
int i;
@@ -2076,7 +2076,7 @@
}
}
-static void Load_DEPT()
+static void Load_DEPT(void)
{
int index;
while ((index = SlIterateArray()) != -1) {
@@ -2095,7 +2095,7 @@
SLE_END()
};
-static void Save_CHKP()
+static void Save_CHKP(void)
{
Waypoint *cp;
int i;
@@ -2107,7 +2107,7 @@
}
}
-static void Load_CHKP()
+static void Load_CHKP(void)
{
int index;
while ((index = SlIterateArray()) != -1) {
--- a/vehicle.h Sat Jan 22 19:41:30 2005 +0000
+++ b/vehicle.h Sat Jan 22 20:23:18 2005 +0000
@@ -259,12 +259,12 @@
typedef void *VehicleFromPosProc(Vehicle *v, void *data);
void VehicleServiceInDepot(Vehicle *v);
-Vehicle *AllocateVehicle();
-Vehicle *ForceAllocateVehicle();
-Vehicle *ForceAllocateSpecialVehicle();
+Vehicle *AllocateVehicle(void);
+Vehicle *ForceAllocateVehicle(void);
+Vehicle *ForceAllocateSpecialVehicle(void);
void UpdateVehiclePosHash(Vehicle *v, int x, int y);
void VehiclePositionChanged(Vehicle *v);
-void AfterLoadVehicles();
+void AfterLoadVehicles(void);
Vehicle *GetLastVehicleInChain(Vehicle *v);
Vehicle *GetPrevVehicleInChain(Vehicle *v);
Vehicle *GetFirstVehicleInChain(Vehicle *v);
@@ -272,14 +272,14 @@
void DeleteVehicle(Vehicle *v);
void DeleteVehicleChain(Vehicle *v);
void *VehicleFromPos(TileIndex tile, void *data, VehicleFromPosProc *proc);
-void CallVehicleTicks();
+void CallVehicleTicks(void);
-Depot *AllocateDepot();
-Waypoint *AllocateWaypoint();
+Depot *AllocateDepot(void);
+Waypoint *AllocateWaypoint(void);
void UpdateWaypointSign(Waypoint *cp);
void RedrawWaypointSign(Waypoint *cp);
-void InitializeTrains();
+void InitializeTrains(void);
bool IsTrainDepotTile(TileIndex tile);
bool IsRoadDepotTile(TileIndex tile);
--- a/vehicle_gui.c Sat Jan 22 19:41:30 2005 +0000
+++ b/vehicle_gui.c Sat Jan 22 20:23:18 2005 +0000
@@ -141,7 +141,7 @@
/* General Vehicle GUI based procedures that are independent of vehicle types */
-void InitializeVehiclesGuiList()
+void InitializeVehiclesGuiList(void)
{
}
--- a/vehicle_gui.h Sat Jan 22 19:41:30 2005 +0000
+++ b/vehicle_gui.h Sat Jan 22 20:23:18 2005 +0000
@@ -4,7 +4,7 @@
struct vehiclelist_d;
void DrawVehicleProfitButton(Vehicle *v, int x, int y);
-void InitializeVehiclesGuiList();
+void InitializeVehiclesGuiList(void);
/* sorter stuff */
void RebuildVehicleLists(void);
--- a/viewport.c Sat Jan 22 19:41:30 2005 +0000
+++ b/viewport.c Sat Jan 22 20:23:18 2005 +0000
@@ -320,7 +320,7 @@
return pt;
}
-Point GetTileBelowCursor()
+Point GetTileBelowCursor(void)
{
return GetTileFromScreenXY(_cursor.pos.x, _cursor.pos.y, _cursor.pos.x, _cursor.pos.y);
}
@@ -473,12 +473,12 @@
}
}
-void StartSpriteCombine()
+void StartSpriteCombine(void)
{
_cur_vd->combine_sprites = 1;
}
-void EndSpriteCombine()
+void EndSpriteCombine(void)
{
_cur_vd->combine_sprites = 0;
}
@@ -550,7 +550,7 @@
static int _stored_track[200];
static int _num_stored;
-void dbg_store_path()
+void dbg_store_path(void)
{
memcpy(_stored_tile, _pushed_tile, sizeof(_stored_tile));
memcpy(_stored_track, _pushed_track, sizeof(_stored_tile));
@@ -565,7 +565,7 @@
dbg_store_path();
}
-void dbg_pop_tile()
+void dbg_pop_tile(void)
{
_num_push--;
}
@@ -711,7 +711,7 @@
}
}
-static void ViewportAddLandscape()
+static void ViewportAddLandscape(void)
{
ViewportDrawer *vd = _cur_vd;
int x, y, width, height;
@@ -1427,7 +1427,7 @@
);
}
-static void SetSelectionTilesDirty()
+static void SetSelectionTilesDirty(void)
{
int y_size, x_size;
TileHighlightData *thd = _thd_ptr;
@@ -1716,7 +1716,7 @@
}
}
-Vehicle *CheckMouseOverVehicle()
+Vehicle *CheckMouseOverVehicle(void)
{
Window *w;
ViewPort *vp;
@@ -1738,7 +1738,7 @@
-void PlaceObject()
+void PlaceObject(void)
{
Point pt;
Window *w;
@@ -1852,7 +1852,7 @@
}
// called regular to update tile highlighting in all cases
-void UpdateTileSelection()
+void UpdateTileSelection(void)
{
TileHighlightData *thd = _thd_ptr;
Point pt;
@@ -1956,7 +1956,7 @@
thd->next_drawstyle = HT_RECT;
}
-void VpStartPreSizing()
+void VpStartPreSizing(void)
{
_thd.selend.x = -1;
_special_mouse_mode = WSM_PRESIZE;
@@ -2131,7 +2131,7 @@
}
// while dragging
-bool VpHandlePlaceSizingDrag()
+bool VpHandlePlaceSizingDrag(void)
{
Window *w;
WindowEvent e;
@@ -2225,6 +2225,7 @@
SetMouseCursor(icon);
}
-void ResetObjectToPlace(){
+void ResetObjectToPlace(void)
+{
SetObjectToPlace(0,0,0,0);
}
--- a/viewport.h Sat Jan 22 19:41:30 2005 +0000
+++ b/viewport.h Sat Jan 22 20:23:18 2005 +0000
@@ -17,7 +17,7 @@
int width, int height, uint32 follow_flags, byte zoom);
void SetViewportPosition(Window *w, int x, int y);
ViewPort *IsPtInWindowViewport(Window *w, int x, int y);
-Point GetTileBelowCursor();
+Point GetTileBelowCursor(void);
void ZoomInOrOutToCursorWindow(bool in, Window * w);
Point GetTileZoomCenterWindow(bool in, Window * w);
void UpdateViewportPosition(Window *w);
@@ -31,21 +31,21 @@
void AddChildSpriteScreen(uint32 image, int x, int y);
-void StartSpriteCombine();
-void EndSpriteCombine();
+void StartSpriteCombine(void);
+void EndSpriteCombine(void);
void HandleViewportClicked(ViewPort *vp, int x, int y);
-void PlaceObject();
+void PlaceObject(void);
void SetRedErrorSquare(TileIndex tile);
void SetTileSelectSize(int w, int h);
void SetTileSelectBigSize(int ox, int oy, int sx, int sy);
void VpStartPlaceSizing(uint tile, int user);
-void VpStartPreSizing();
+void VpStartPreSizing(void);
void VpSetPresizeRange(uint from, uint to);
void VpSetPlaceSizingLimit(int limit);
-Vehicle *CheckMouseOverVehicle();
+Vehicle *CheckMouseOverVehicle(void);
enum {
VPM_X_OR_Y = 0,
--- a/water_cmd.c Sat Jan 22 19:41:30 2005 +0000
+++ b/water_cmd.c Sat Jan 22 20:23:18 2005 +0000
@@ -714,7 +714,7 @@
return 0;
}
-void InitializeDock()
+void InitializeDock(void)
{
_last_built_ship_depot_tile = 0;
}
--- a/window.c Sat Jan 22 19:41:30 2005 +0000
+++ b/window.c Sat Jan 22 20:23:18 2005 +0000
@@ -663,7 +663,7 @@
}
-void InitWindowSystem()
+void InitWindowSystem(void)
{
IConsoleClose();
memset(&_windows, 0, sizeof(_windows));
@@ -672,7 +672,7 @@
_active_viewports = 0;
}
-static void DecreaseWindowCounters()
+static void DecreaseWindowCounters(void)
{
Window *w;
@@ -698,12 +698,12 @@
}
}
-Window *GetCallbackWnd()
+Window *GetCallbackWnd(void)
{
return FindWindowById(_thd.window_class, _thd.window_number);
}
-static void HandlePlacePresize()
+static void HandlePlacePresize(void)
{
Window *w;
WindowEvent e;
@@ -724,7 +724,7 @@
w->wndproc(w, &e);
}
-static bool HandleDragDrop()
+static bool HandleDragDrop(void)
{
Window *w;
WindowEvent e;
@@ -750,7 +750,7 @@
return false;
}
-static bool HandlePopupMenu()
+static bool HandlePopupMenu(void)
{
Window *w;
WindowEvent e;
@@ -778,7 +778,7 @@
return false;
}
-bool HandleMouseOver()
+bool HandleMouseOver(void)
{
Window *w;
WindowEvent e;
@@ -811,7 +811,7 @@
return true;
}
-bool HandleWindowDragging()
+bool HandleWindowDragging(void)
{
Window *w;
// Get out immediately if no window is being dragged at all.
@@ -1069,7 +1069,7 @@
}
-static bool HandleScrollbarScrolling()
+static bool HandleScrollbarScrolling(void)
{
Window *w;
int i;
@@ -1115,7 +1115,7 @@
return false;
}
-static bool HandleViewportScroll()
+static bool HandleViewportScroll(void)
{
Window *w;
ViewPort *vp;
@@ -1257,10 +1257,10 @@
}
}
-extern void UpdateTileSelection();
-extern bool VpHandlePlaceSizingDrag();
+extern void UpdateTileSelection(void);
+extern bool VpHandlePlaceSizingDrag(void);
-void MouseLoop()
+void MouseLoop(void)
{
int x,y;
Window *w;
@@ -1390,7 +1390,7 @@
extern uint32 _pixels_redrawn;
-void UpdateWindows()
+void UpdateWindows(void)
{
Window *w;
int t;
@@ -1481,7 +1481,7 @@
}
-void CallWindowTickEvent()
+void CallWindowTickEvent(void)
{
Window *w;
for(w=_last_window; w != _windows;) {
@@ -1490,7 +1490,7 @@
}
}
-void DeleteNonVitalWindows()
+void DeleteNonVitalWindows(void)
{
Window *w;
for(w=_windows; w!=_last_window;) {
--- a/window.h Sat Jan 22 19:41:30 2005 +0000
+++ b/window.h Sat Jan 22 20:23:18 2005 +0000
@@ -510,7 +510,7 @@
/* window.c */
void DrawOverlappedWindow(Window *w, int left, int top, int right, int bottom);
void CallWindowEventNP(Window *w, int event);
-void CallWindowTickEvent();
+void CallWindowTickEvent(void);
void SetWindowDirty(Window *w);
Window *FindWindowById(WindowClass cls, WindowNumber number);
@@ -555,10 +555,10 @@
void DrawWindowViewport(Window *w);
-void InitWindowSystem();
+void InitWindowSystem(void);
int GetMenuItemIndex(Window *w, int x, int y);
-void MouseLoop();
-void UpdateWindows();
+void MouseLoop(void);
+void UpdateWindows(void);
void InvalidateWidget(Window *w, byte widget_index);
void GuiShowTooltips(uint16 string_id);
@@ -575,8 +575,8 @@
void HandleButtonClick(Window *w, byte widget);
-Window *GetCallbackWnd();
-void DeleteNonVitalWindows();
+Window *GetCallbackWnd(void);
+void DeleteNonVitalWindows(void);
void DeleteAllNonVitalWindows(void);
void HideVitalWindows(void);
void ShowVitalWindows(void);