(svn r2984) Use adequate types, this should aid portability a bit
authortron
Sun, 25 Sep 2005 09:04:59 +0000
changeset 2458 dbaf5dffbb28
parent 2457 d39a35fc2381
child 2459 a2f63b331830
(svn r2984) Use adequate types, this should aid portability a bit
driver.c
graph_gui.c
music/extmidi.c
music/win32_m.c
newgrf.c
texteff.c
win32.c
--- a/driver.c	Sat Sep 24 20:24:35 2005 +0000
+++ b/driver.c	Sun Sep 25 09:04:59 2005 +0000
@@ -166,7 +166,7 @@
 
 static const char* GetDriverParam(const char* const* parm, const char* name)
 {
-	uint len;
+	size_t len;
 
 	if (parm == NULL) return NULL;
 
--- a/graph_gui.c	Sat Sep 24 20:24:35 2005 +0000
+++ b/graph_gui.c	Sun Sep 25 09:04:59 2005 +0000
@@ -828,7 +828,8 @@
 	case WE_PAINT: {
 		Player *p;
 		Player *plist[MAX_PLAYERS];
-		size_t pl_num, i;
+		uint pl_num;
+		uint i;
 
 		DrawWindowWidgets(w);
 
--- a/music/extmidi.c	Sat Sep 24 20:24:35 2005 +0000
+++ b/music/extmidi.c	Sun Sep 25 09:04:59 2005 +0000
@@ -17,7 +17,7 @@
 
 static struct {
 	char song[MAX_PATH];
-	int pid;
+	pid_t pid;
 } _midi;
 
 static void DoPlay(void);
--- a/music/win32_m.c	Sat Sep 24 20:24:35 2005 +0000
+++ b/music/win32_m.c	Sun Sep 25 09:04:59 2005 +0000
@@ -12,7 +12,7 @@
 	bool playing;
 	int new_vol;
 	HANDLE wait_obj;
-	uint devid;
+	UINT_PTR devid;
 	char start_song[260];
 } _midi;
 
@@ -44,7 +44,7 @@
 	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 MidiIntSetVolume(int vol)
 {
-	uint v = (vol * 65535 / 127);
+	DWORD v = (vol * 65535 / 127);
 	midiOutSetVolume((HMIDIOUT)_midi.devid, v + (v << 16));
 }
 
@@ -128,7 +128,8 @@
 {
 	MIDIOUTCAPS midicaps;
 	DWORD threadId;
-	uint dev, nbdev;
+	UINT nbdev;
+	UINT_PTR dev;
 	char buf[16];
 
 	mciSendStringA("capability sequencer has audio", buf, lengthof(buf), 0);
--- a/newgrf.c	Sat Sep 24 20:24:35 2005 +0000
+++ b/newgrf.c	Sun Sep 25 09:04:59 2005 +0000
@@ -1668,7 +1668,7 @@
 	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);
--- a/texteff.c	Sat Sep 24 20:24:35 2005 +0000
+++ b/texteff.c	Sun Sep 25 09:04:59 2005 +0000
@@ -57,7 +57,8 @@
 {
 	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);
--- a/win32.c	Sat Sep 24 20:24:35 2005 +0000
+++ b/win32.c	Sun Sep 25 09:04:59 2005 +0000
@@ -161,7 +161,7 @@
 
 	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 @@
 	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: