Index: code/bmpman/bmpman.cpp
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/bmpman/bmpman.cpp,v
retrieving revision 2.85
diff -U3 -r2.85 bmpman.cpp
--- code/bmpman/bmpman.cpp	13 May 2006 07:29:51 -0000	2.85
+++ code/bmpman/bmpman.cpp	26 May 2006 23:53:40 -0000
@@ -2023,7 +2023,7 @@
 	be->mem_taken = (bmp->w * bmp->h * (bpp >> 3));
 	data = (ubyte *)bm_malloc(bitmapnum, be->mem_taken);
 	bmp->bpp = bpp;
-	bmp->data = (ptr_u)data;
+	bmp->data = data;
 	bmp->palette = (bpp == 8) ? gr_palette : NULL;
 	memset( data, 0, be->mem_taken );
 
@@ -2101,7 +2101,7 @@
 		// briefing editor in Fred2 uses aabitmaps (ani's) - force to 8 bit
 		bm->bpp = Is_standalone ? (ubyte)8 : bpp;
 
-		bm->data = (ptr_u)bm_malloc(first_frame + i, size);
+		bm->data = bm_malloc(first_frame + i, size);
 
 		frame_data = anim_get_next_raw_buffer(the_anim_instance, 0 ,flags & BMP_AABITMAP ? 1 : 0, bm->bpp);
 
@@ -2199,19 +2199,19 @@
 		case 32:	// user 32-bit bitmap
 			bmp->bpp = bpp;
 			bmp->flags = be->info.user.flags;
-			bmp->data = (ptr_u)be->info.user.data;
+			bmp->data = be->info.user.data;
 			break;
 
 		case 24:	// user 24-bit bitmap
 			bmp->bpp = bpp;
 			bmp->flags = be->info.user.flags;
-			bmp->data = (ptr_u)be->info.user.data;
+			bmp->data = be->info.user.data;
 			break;
 
 		case 16:			// user 16 bit bitmap
 			bmp->bpp = bpp;
 			bmp->flags = be->info.user.flags;		
-			bmp->data = (ptr_u)be->info.user.data;								
+			bmp->data = be->info.user.data;
 			break;	
 	
 		case 8:			// Going from 8 bpp to something (probably only for aabitmaps)
@@ -2234,7 +2234,7 @@
 			Assert(flags & BMP_AABITMAP);
 			bmp->bpp = bpp;
 			bmp->flags = be->info.user.flags;		
-			bmp->data = (ptr_u)be->info.user.data;								
+			bmp->data = be->info.user.data;
 			break;
 		
 		 default:
@@ -2282,7 +2282,7 @@
  	}
 
 	bmp->bpp = bpp;
-	bmp->data = (ptr_u)data;
+	bmp->data = data;
 	bmp->palette = NULL;
 
 	Assert( &be->bm == bmp );
@@ -2348,7 +2348,7 @@
 #endif
 
 	bmp->bpp = dds_bpp;
-	bmp->data = (ptr_u)data;
+	bmp->data = data;
 	bmp->flags = 0;
 
 	if (error != DDS_ERROR_NONE) {
@@ -2387,7 +2387,7 @@
 	memset( data, 0, be->mem_taken);
  
 	bmp->bpp = bpp;
-	bmp->data = (ptr_u)data;
+	bmp->data = data;
 	bmp->palette = NULL;
 
 	Assert( &be->bm == bmp );
@@ -3735,7 +3735,7 @@
 	bm_bitmaps[n].last_used = -1;
 
 	if (bm_bitmaps[n].mem_taken) {
-		bm_bitmaps[n].bm.data = (ptr_u) bm_malloc(n, bm_bitmaps[n].mem_taken);
+		bm_bitmaps[n].bm.data = bm_malloc(n, bm_bitmaps[n].mem_taken);
 	}
 	//	bm_update_memory_used( n, bm_bitmaps[n].mem_taken );
 
Index: code/bmpman/bmpman.h
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/bmpman/bmpman.h,v
retrieving revision 2.36
diff -U3 -r2.36 bmpman.h
--- code/bmpman/bmpman.h	13 May 2006 07:29:51 -0000	2.36
+++ code/bmpman/bmpman.h	26 May 2006 23:53:42 -0000
@@ -471,7 +471,7 @@
 	ubyte	bpp;		// How many bits per pixel it is. (7,8,15,16,24,32) (what is requested)
 	ubyte	true_bpp;	// How many bits per pixel the image actually is.
 	ubyte	flags;		// See the BMP_???? defines for values (this isn't for the BMP_FLAG_* stuff)
-	ptr_u	data;		// Pointer to data, or maybe offset into VRAM.
+	void*	data;		// Pointer to data, or maybe offset into VRAM.
 	ubyte *palette;		// If bpp==8, this is pointer to palette.   If the BMP_NO_PALETTE_MAP flag
 						// is not set, this palette just points to the screen palette. (gr_palette)
 } bitmap;
Index: code/globalincs/pstypes.h
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/globalincs/pstypes.h,v
retrieving revision 2.42
diff -U3 -r2.42 pstypes.h
--- code/globalincs/pstypes.h	19 Jan 2006 20:18:11 -0000	2.42
+++ code/globalincs/pstypes.h	26 May 2006 23:53:48 -0000
@@ -458,12 +458,10 @@
 typedef __int32 _fs_time_t;  // time_t here is 64-bit and we need 32-bit
 typedef __int32 fix;
 // PTR compatible sizes
-typedef __int64 ptr_s;
 typedef unsigned __int64 ptr_u;
 #else
 typedef long fix;
 typedef	long _fs_time_t;
-typedef int ptr_s;
 typedef unsigned int ptr_u;
 #endif // 64-bit
 
Index: code/graphics/grinternal.h
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/graphics/grinternal.h,v
retrieving revision 2.12
diff -U3 -r2.12 grinternal.h
--- code/graphics/grinternal.h	13 May 2006 07:29:52 -0000	2.12
+++ code/graphics/grinternal.h	26 May 2006 23:53:50 -0000
@@ -222,8 +222,12 @@
 
 extern int Gr_cursor;
 
-#define GR_SCREEN_PTR(type,x,y) ((type *)(ptr_u(gr_screen.offscreen_buffer) + ptr_u(((x)+gr_screen.offset_x)*sizeof(type)) + ptr_u(((y)+gr_screen.offset_y)*gr_screen.rowsize)))
-#define GR_SCREEN_PTR_SIZE(bpp,x,y) ((ptr_u)(ptr_u(gr_screen.offscreen_buffer) + ptr_u(((x)+gr_screen.offset_x)*(bpp)) + ptr_u(((y)+gr_screen.offset_y)*gr_screen.rowsize)))
+// replaced ptr_u with size_t - Spike
+#define GR_SCREEN_PTR(type,x,y) ((type *)(size_t(gr_screen.offscreen_buffer) + size_t(((x)+gr_screen.offset_x)*sizeof(type)) + size_t(((y)+gr_screen.offset_y)*gr_screen.rowsize)))
+
+// original macros - note - GR_SCREEN_PTR_SIZE does not appear to be used anymore
+//#define GR_SCREEN_PTR(type,x,y) ((type *)(ptr_u(gr_screen.offscreen_buffer) + ptr_u(((x)+gr_screen.offset_x)*sizeof(type)) + ptr_u(((y)+gr_screen.offset_y)*gr_screen.rowsize)))
+//#define GR_SCREEN_PTR_SIZE(bpp,x,y) ((ptr_u)(ptr_u(gr_screen.offscreen_buffer) + ptr_u(((x)+gr_screen.offset_x)*(bpp)) + ptr_u(((y)+gr_screen.offset_y)*gr_screen.rowsize)))
 
 extern ubyte Gr_original_palette[768];		// The palette 
 extern ubyte Gr_current_palette[768];
Index: code/graphics/gropenglbmpman.cpp
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/graphics/gropenglbmpman.cpp,v
retrieving revision 1.17
diff -U3 -r1.17 gropenglbmpman.cpp
--- code/graphics/gropenglbmpman.cpp	13 May 2006 07:29:52 -0000	1.17
+++ code/graphics/gropenglbmpman.cpp	26 May 2006 23:53:53 -0000
@@ -345,7 +345,7 @@
 
 		Assert( compressed_data != NULL );
 
-		bmp->data = (ptr_u)compressed_data;
+		bmp->data = compressed_data;
 		bmp->bpp = (alpha) ? 32 : 24;
 		bmp->palette = NULL;
 		be->comp_type = (alpha) ? BM_TYPE_DXT5 : BM_TYPE_DXT1;
@@ -469,7 +469,7 @@
 		nprintf(("BMPMAN", "new size is %.3fM.\n", ((float)out_size/1024.0f)/1024.0f));
 	}
 
-	bmp->data = (ptr_u)compressed_data;
+	bmp->data = compressed_data;
 	bmp->bpp = (alpha) ? (ubyte)32 : (ubyte)24;
 	bmp->palette = NULL;
 	be->comp_type = (alpha) ? BM_TYPE_DXT5 : BM_TYPE_DXT1;
Index: code/graphics/gropenglextension.cpp
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/graphics/gropenglextension.cpp,v
retrieving revision 1.15
diff -U3 -r1.15 gropenglextension.cpp
--- code/graphics/gropenglextension.cpp	13 May 2006 07:29:52 -0000	1.15
+++ code/graphics/gropenglextension.cpp	26 May 2006 23:53:56 -0000
@@ -287,9 +287,9 @@
 		Assert( func->function_name != NULL );
 
 #ifdef _WIN32
-		func->function_ptr = (ptr_u)wglGetProcAddress(func->function_name);
+		func->function_ptr = (void*)wglGetProcAddress(func->function_name);
 #else
-		func->function_ptr = (ptr_u)SDL_GL_GetProcAddress(func->function_name);
+		func->function_ptr = SDL_GL_GetProcAddress(func->function_name);
 #endif
 
 		if (func->function_ptr) {
@@ -348,9 +348,9 @@
 
 					if (!func->function_ptr) {
 #ifdef _WIN32
-						func->function_ptr = (ptr_u)wglGetProcAddress(func->function_name);
+						func->function_ptr = (void*)wglGetProcAddress(func->function_name);
 #else
-						func->function_ptr = (ptr_u)SDL_GL_GetProcAddress(func->function_name);
+						func->function_ptr = SDL_GL_GetProcAddress(func->function_name);
 #endif
 					}
 
Index: code/graphics/gropenglextension.h
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/graphics/gropenglextension.h,v
retrieving revision 1.13
diff -U3 -r1.13 gropenglextension.h
--- code/graphics/gropenglextension.h	13 May 2006 07:29:52 -0000	1.13
+++ code/graphics/gropenglextension.h	26 May 2006 23:53:57 -0000
@@ -129,7 +129,7 @@
 
 typedef struct ogl_function {
 	const char *function_name;
-	ptr_u function_ptr;
+	void* function_ptr;
 } ogl_function;
 
 extern ogl_function GL_Functions[];
Index: code/mission/missiontraining.cpp
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/mission/missiontraining.cpp,v
retrieving revision 2.25
diff -U3 -r2.25 missiontraining.cpp
--- code/mission/missiontraining.cpp	19 Mar 2006 05:05:59 -0000	2.25
+++ code/mission/missiontraining.cpp	26 May 2006 23:54:06 -0000
@@ -944,7 +944,7 @@
 				break;
 
 			// make sure we aren't going to have any type of out-of-bounds issues
-			if ( ((toke2 - text) < 0) || ((toke2 - text) >= (ptr_s)sizeof(temp)) ) {
+			if ( ((toke2 - text) < 0) || ((toke2 - text) >= sizeof(temp)) ) {
 				Int3();
 			} else {
 				strncpy(temp, text, toke2 - text);  // isolate token into seperate buffer
@@ -982,7 +982,7 @@
 				break;
 
 			// make sure we aren't going to have any type of out-of-bounds issues
-			if ( ((toke1 - text) < 0) || ((toke1 - text) >= (ptr_s)sizeof(temp)) ) {
+			if ( ((toke1 - text) < 0) || ((toke1 - text) >= sizeof(temp)) ) {
 				Int3();
 			} else {
 				strncpy(temp, text, toke1 - text);  // isolate token into seperate buffer
Index: code/ship/shipcontrails.cpp
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/ship/shipcontrails.cpp,v
retrieving revision 2.25
diff -U3 -r2.25 shipcontrails.cpp
--- code/ship/shipcontrails.cpp	25 Feb 2006 21:47:08 -0000	2.25
+++ code/ship/shipcontrails.cpp	26 May 2006 23:54:10 -0000
@@ -570,4 +570,4 @@
 		display = !display;
 
 	return display;
-}
\ No newline at end of file
+}
Index: code/sound/acm.cpp
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/sound/acm.cpp,v
retrieving revision 2.6
diff -U3 -r2.6 acm.cpp
--- code/sound/acm.cpp	12 May 2005 17:49:17 -0000	2.6
+++ code/sound/acm.cpp	26 May 2006 23:54:12 -0000
@@ -262,7 +262,7 @@
 //
 //
 // NOTES:
-// 1. Storage for the decompressed audio will be allocated in this function if *dest in NULL.
+// 1. Storage for the decompressed audio will be allocated in this function if *dest is NULL.
 //    The caller is responsible for freeing this memory later.
 //
 int ACM_convert_ADPCM_to_PCM(WAVEFORMATEX *pwfxSrc, ubyte *src, int src_len, ubyte **dest, int max_dest_bytes, int *dest_len, unsigned int *src_bytes_used, unsigned short dest_bps)
Index: code/sound/audiostr-openal.cpp
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/sound/audiostr-openal.cpp,v
retrieving revision 1.25
diff -U3 -r1.25 audiostr-openal.cpp
--- code/sound/audiostr-openal.cpp	13 May 2006 07:11:46 -0000	1.25
+++ code/sound/audiostr-openal.cpp	26 May 2006 23:54:18 -0000
@@ -162,7 +162,7 @@
 
 CRITICAL_SECTION Global_service_lock;
 
-typedef BOOL (*TIMERCALLBACK)(ptr_u);
+typedef BOOL (*TIMERCALLBACK)(void*);
 
 #define COMPRESSED_BUFFER_SIZE	88300
 ubyte *Compressed_buffer = NULL;				// Used to load in compressed data during a cueing interval
@@ -295,15 +295,15 @@
 public:
     void constructor(void);
     void destructor(void);
-    BOOL Create (UINT nPeriod, UINT nRes, DWORD dwUser,  TIMERCALLBACK pfnCallback);
+    BOOL Create (UINT nPeriod, UINT nRes, void *vpUser,  TIMERCALLBACK pfnCallback);
 protected:
 #ifndef SCP_UNIX 
-    static void CALLBACK TimeProc(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2);
+    static void CALLBACK TimeProc(UINT uID, UINT uMsg, DWORD User, DWORD dw1, DWORD dw2);
 #else
-    static DWORD CALLBACK TimeProc(DWORD interval, void *param);
+    static Uint32 CALLBACK TimeProc(Uint32 interval, void *User);
 #endif
     TIMERCALLBACK m_pfnCallback;
-    DWORD m_dwUser;
+    void* m_vpUser;
     UINT m_nPeriod;
     UINT m_nRes;
 #ifndef SCP_UNIX 
@@ -384,7 +384,7 @@
 	BOOL WriteSilence (uint cbSize);
 	DWORD GetMaxWriteSize (void);
 	BOOL ServiceBuffer (void);
-	static BOOL TimerCallback (ptr_u dwUser);
+	static BOOL TimerCallback (void* vpUser);
 
 	ALuint m_source_id;   // name of openAL source
 	ALuint m_buffer_ids[MAX_STREAM_BUFFERS]; //names of buffers
@@ -440,7 +440,7 @@
 }
 
 // Create
-BOOL Timer::Create (UINT nPeriod, UINT nRes, DWORD dwUser, TIMERCALLBACK pfnCallback)
+BOOL Timer::Create (UINT nPeriod, UINT nRes, void* vpUser, TIMERCALLBACK pfnCallback)
 {
 	BOOL bRtn = SUCCESS;    // assume success
 
@@ -450,13 +450,13 @@
 
 	m_nPeriod = nPeriod;
 	m_nRes = nRes;
-	m_dwUser = dwUser;
+	m_vpUser = vpUser;
 	m_pfnCallback = pfnCallback;
 
 #ifndef SCP_UNIX
-	if ((m_nIDTimer = timeSetEvent (m_nPeriod, m_nRes, TimeProc, (DWORD)this, TIME_PERIODIC)) == NULL) {
+-	if ((m_nIDTimer = timeSetEvent (m_nPeriod, m_nRes, TimeProc, (DWORD)this, TIME_PERIODIC)) == NULL) {
 #else
-	if ((m_nIDTimer = timeSetEvent (m_nPeriod, m_nRes, (ptr_u)TimeProc, (DWORD *)this, TIME_PERIODIC)) == NULL) {
+	if ((m_nIDTimer = timeSetEvent (m_nPeriod, TimeProc, this)) == NULL) {
 #endif
 	  bRtn = FAILURE;
 	}
@@ -468,25 +468,25 @@
 // Timer proc for multimedia timer callback set with timeSetTime().
 //
 // Calls procedure specified when Timer object was created. The 
-// dwUser parameter contains "this" pointer for associated Timer object.
+// User parameter contains "this" pointer for associated Timer object.
 // 
 #ifndef SCP_UNIX
-void CALLBACK Timer::TimeProc(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
+void CALLBACK Timer::TimeProc(UINT uID, UINT uMsg, DWORD User, DWORD dw1, DWORD dw2)
 #else
-DWORD CALLBACK Timer::TimeProc(DWORD interval, void *dwUser)
+Uint32 CALLBACK Timer::TimeProc(Uint32 interval, void *User)
 #endif
 {
-    // dwUser contains ptr to Timer object
-	Timer * ptimer = (Timer *) dwUser;
+	// User contains ptr to Timer object
+	Timer * ptimer = (Timer *) User;
 
-    // Call user-specified callback and pass back user specified data
-    (ptimer->m_pfnCallback) (ptimer->m_dwUser);
+	// Call user-specified callback and pass back user specified data
+	(ptimer->m_pfnCallback) (ptimer->m_vpUser);
 
 #ifdef SCP_UNIX
-    if (ptimer->m_nPeriod) {
+	if (ptimer->m_nPeriod) {
 		return interval;
-    } else {
-		SDL_RemoveTimer(ptimer->m_nIDTimer);
+	} else {
+//		SDL_RemoveTimer(ptimer->m_nIDTimer); // double free? returning 0 should free the timer
 		ptimer->m_nIDTimer = NULL;
 		return 0;
     }
@@ -925,7 +925,7 @@
 				goto READ_ERROR;
 			} else if ( convert_len == 0 ) {
 				if (num_bytes_read < m_nBlockAlign) {
-					mprintf(("AUDIOSTR => Warning: Short read detected in ACM decode of '%s'!!\n", m_wFilename));
+					mprintf(("AUDIOSTR => Warning: Short read detected in ACM decode of '%s'!!\n  num_bytes_read=%u, m_nBlockAlign=%i, m_hStream=%p, dest_buf=%p, uncompressed_wave_data=%p\n", m_wFilename, num_bytes_read, m_nBlockAlign, m_hStream, dest_buf, uncompressed_wave_data));
 				} else {
 					Int3();
 				}
@@ -1489,7 +1489,7 @@
 		// Kick off timer to service buffer
 		m_timer.constructor();
 
-		m_timer.Create (m_nBufService, m_nBufService, ptr_u (this), TimerCallback);
+		m_timer.Create (m_nBufService, m_nBufService, this, TimerCallback);
 
 		// Playback begun, no longer cued
 		m_fPlaying = TRUE;
@@ -1498,10 +1498,10 @@
 }
 
 // Timer callback for Timer object created by ::Play method.
-BOOL AudioStream::TimerCallback (ptr_u dwUser)
+BOOL AudioStream::TimerCallback (void* vpUser)
 {
     // dwUser contains ptr to AudioStream object
-    AudioStream * pas = (AudioStream *) dwUser;
+    AudioStream * pas = (AudioStream *) vpUser;
 
     return (pas->ServiceBuffer ());
 }
Index: code/windows_stub/config.h
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/windows_stub/config.h,v
retrieving revision 2.16
diff -U3 -r2.16 config.h
--- code/windows_stub/config.h	13 May 2006 07:29:52 -0000	2.16
+++ code/windows_stub/config.h	26 May 2006 23:54:19 -0000
@@ -159,9 +159,8 @@
 typedef long *LPLONG;
 #ifdef IAM_64BIT
 // force 32-bit version of DWORD
-typedef unsigned int DWORD;
 typedef unsigned int FOURCC;
-typedef unsigned long *PDWORD, *LPDWORD;
+typedef unsigned int DWORD, *PDWORD, *LPDWORD;
 #else
 typedef unsigned long FOURCC;
 typedef unsigned long DWORD, *PDWORD, *LPDWORD;
@@ -294,11 +293,8 @@
 bool QueryPerformanceCounter(LARGE_INTEGER *pcount);
 
 // ummph, I need to do a better job with this
-#ifdef IAM_64BIT
-SDL_TimerID timeSetEvent(DWORD uDelay, uint uResolution, unsigned __int64 lpTimeProc,  DWORD *dwUser, uint fuEvent);
-#else
-SDL_TimerID timeSetEvent(DWORD uDelay, uint uResolution, unsigned int lpTimeProc,  DWORD *dwUser, uint fuEvent);
-#endif
+SDL_TimerID timeSetEvent(uint uDelay, SDL_NewTimerCallback lpTimeProc, void *vpUser);
+
 SDL_bool timeKillEvent(SDL_TimerID uTimerID);
 #define TIME_PERIODIC	0
 
Index: code/windows_stub/stubs.cpp
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/windows_stub/stubs.cpp,v
retrieving revision 2.31
diff -U3 -r2.31 stubs.cpp
--- code/windows_stub/stubs.cpp	16 Apr 2006 05:24:16 -0000	2.31
+++ code/windows_stub/stubs.cpp	26 May 2006 23:54:20 -0000
@@ -352,9 +352,9 @@
 }
 
 // slightly different options and return than the Windows version
-SDL_TimerID timeSetEvent(DWORD uDelay, uint uResolution, ptr_u lpTimeProc,  DWORD *dwUser, uint fuEvent)
+SDL_TimerID timeSetEvent(Uint32 uDelay, SDL_NewTimerCallback lpTimeProc, void *vpUser)
 {
-	return SDL_AddTimer( uDelay, (SDL_NewTimerCallback)lpTimeProc, (void *) dwUser );
+	return SDL_AddTimer( uDelay, lpTimeProc, vpUser );
 }
 
 SDL_bool timeKillEvent(SDL_TimerID uTimerID)
@@ -558,7 +558,7 @@
 // RamTable stuff comes out of icculus.org
 #ifndef NDEBUG
 typedef struct RAM {
-	ptr_u addr;
+	void* addr;
 	int size;
 
 	RAM *next;
@@ -601,7 +601,7 @@
 
 	RAM *next = (RAM *)malloc(sizeof(RAM));
 
-	next->addr = (ptr_u)ptr;
+	next->addr = ptr;
 	next->size = (size + sizeof(RAM));
 
 	next->next = RamTable;
@@ -637,7 +637,7 @@
 	RAM *item = RamTable;
 
 	while (item != NULL) {
-		if (item->addr == (ptr_u)ret_ptr) {
+		if (item->addr == ret_ptr) {
 			TotalRam += (size - item->size);
 			item->size = size;
 			break;
@@ -708,7 +708,7 @@
     RAM **mark = &RamTable;
 
 	while (item != NULL) {
-		if (item->addr == (ptr_u)ptr) {
+		if (item->addr == ptr) {
 			RAM *tmp = item;
 
 			*mark = item->next;
