summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-09-25 09:04:59 +0000
committertron <tron@openttd.org>2005-09-25 09:04:59 +0000
commitc2c865e4b9705a009b71d9cd69ce6821bc1bca72 (patch)
treed32081413d37e02ae74f2636f2ff0fa5e08da4dc
parent03ad234d47b72a833f88ff227acc0b698f7a2c0f (diff)
downloadopenttd-c2c865e4b9705a009b71d9cd69ce6821bc1bca72.tar.xz
(svn r2984) Use adequate types, this should aid portability a bit
-rw-r--r--driver.c2
-rw-r--r--graph_gui.c3
-rw-r--r--music/extmidi.c2
-rw-r--r--music/win32_m.c9
-rw-r--r--newgrf.c2
-rw-r--r--texteff.c3
-rw-r--r--win32.c4
7 files changed, 14 insertions, 11 deletions
diff --git a/driver.c b/driver.c
index 1657c193b..8484c743d 100644
--- a/driver.c
+++ b/driver.c
@@ -166,7 +166,7 @@ void LoadDriver(int driver, const char *name)
static const char* GetDriverParam(const char* const* parm, const char* name)
{
- uint len;
+ size_t len;
if (parm == NULL) return NULL;
diff --git a/graph_gui.c b/graph_gui.c
index 64e4bfdd7..76d008259 100644
--- a/graph_gui.c
+++ b/graph_gui.c
@@ -828,7 +828,8 @@ static void CompanyLeagueWndProc(Window *w, WindowEvent *e)
case WE_PAINT: {
Player *p;
Player *plist[MAX_PLAYERS];
- size_t pl_num, i;
+ uint pl_num;
+ uint i;
DrawWindowWidgets(w);
diff --git a/music/extmidi.c b/music/extmidi.c
index d474b3acb..3f893cb46 100644
--- a/music/extmidi.c
+++ b/music/extmidi.c
@@ -17,7 +17,7 @@
static struct {
char song[MAX_PATH];
- int pid;
+ pid_t pid;
} _midi;
static void DoPlay(void);
diff --git a/music/win32_m.c b/music/win32_m.c
index 866157ee6..5e9dfbca9 100644
--- a/music/win32_m.c
+++ b/music/win32_m.c
@@ -12,7 +12,7 @@ static struct {
bool playing;
int new_vol;
HANDLE wait_obj;
- uint devid;
+ UINT_PTR devid;
char start_song[260];
} _midi;
@@ -44,7 +44,7 @@ static void Win32MidiSetVolume(byte vol)
SetEvent(_midi.wait_obj);
}
-static long CDECL MidiSendCommand(const char *cmd, ...) {
+static MCIERROR CDECL MidiSendCommand(const char *cmd, ...) {
va_list va;
char buf[512];
@@ -72,7 +72,7 @@ static void MidiIntStopSong(void)
static void MidiIntSetVolume(int vol)
{
- uint v = (vol * 65535 / 127);
+ DWORD v = (vol * 65535 / 127);
midiOutSetVolume((HMIDIOUT)_midi.devid, v + (v << 16));
}
@@ -128,7 +128,8 @@ static const char *Win32MidiStart(const char * const *parm)
{
MIDIOUTCAPS midicaps;
DWORD threadId;
- uint dev, nbdev;
+ UINT nbdev;
+ UINT_PTR dev;
char buf[16];
mciSendStringA("capability sequencer has audio", buf, lengthof(buf), 0);
diff --git a/newgrf.c b/newgrf.c
index 99d9fdc89..70b90ebeb 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -1668,7 +1668,7 @@ static void VehicleNewName(byte *buf, int len)
name = (const char*)buf;
len -= (lang & 0x80) ? 6 : 5;
for (; id < endid && len > 0; id++) {
- int ofs = strlen(name) + 1;
+ size_t ofs = strlen(name) + 1;
if (ofs < 128) {
DEBUG(grf, 8) ("VehicleNewName: %d <- %s", id, name);
diff --git a/texteff.c b/texteff.c
index 18325cd05..09fa87228 100644
--- a/texteff.c
+++ b/texteff.c
@@ -57,7 +57,8 @@ void CDECL AddTextMessage(uint16 color, uint8 duration, const char *message, ...
{
char buf[MAX_TEXTMESSAGE_LENGTH];
va_list va;
- int i, length;
+ size_t length;
+ uint i;
va_start(va, message);
vsnprintf(buf, lengthof(buf), message, va);
diff --git a/win32.c b/win32.c
index e2f2d95bc..125b01264 100644
--- a/win32.c
+++ b/win32.c
@@ -161,7 +161,7 @@ static char *PrintModuleInfo(char *output, HMODULE mod)
GetModuleFileName(mod, buffer, MAX_PATH);
GetFileInfo(&dfi, buffer);
- output += sprintf(output, " %-20s handle: %.8X size: %d crc: %.8X date: %d-%.2d-%.2d %.2d:%.2d:%.2d\r\n",
+ output += sprintf(output, " %-20s handle: %p size: %d crc: %.8X date: %d-%.2d-%.2d %.2d:%.2d:%.2d\r\n",
buffer,
mod,
dfi.size,
@@ -351,7 +351,7 @@ static bool DoEmergencySave(HWND wnd)
return b;
}
-static BOOL CALLBACK CrashDialogFunc(HWND wnd,UINT msg,WPARAM wParam,LPARAM lParam)
+static INT_PTR CALLBACK CrashDialogFunc(HWND wnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
switch(msg) {
case WM_INITDIALOG: