From 92b84c84635cba5f7b9d1c01cef1056a611fbb82 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 28 Feb 2016 14:55:49 +1100 Subject: [PATCH] Pick off some low-hanging PTR64 fruit --- src/osd/modules/sync/sync_sdl.cpp | 7 ++----- src/osd/modules/sync/sync_windows.cpp | 9 ++++----- src/osd/osdcomm.h | 6 +----- src/osd/sdl/window.h | 11 ++++------- 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/osd/modules/sync/sync_sdl.cpp b/src/osd/modules/sync/sync_sdl.cpp index 73b735fefb3..c667f17cedb 100644 --- a/src/osd/modules/sync/sync_sdl.cpp +++ b/src/osd/modules/sync/sync_sdl.cpp @@ -11,6 +11,7 @@ #include "sdlinc.h" // standard C headers +#include #include #include #include @@ -175,11 +176,7 @@ static int worker_thread_entry(void *param) void *res; res = thread->callback(thread->param); -#ifdef PTR64 - return (int) (INT64) res; -#else - return (int) res; -#endif + return int(intptr_t(res)); } osd_thread *osd_thread_create(osd_thread_callback callback, void *cbparam) diff --git a/src/osd/modules/sync/sync_windows.cpp b/src/osd/modules/sync/sync_windows.cpp index c744f345e6f..04449f3fead 100644 --- a/src/osd/modules/sync/sync_windows.cpp +++ b/src/osd/modules/sync/sync_windows.cpp @@ -17,6 +17,9 @@ #include "eminline.h" #include "osdsync.h" +// C++ headers +#include + //============================================================ // DEBUGGING @@ -144,11 +147,7 @@ static unsigned __stdcall worker_thread_entry(void *param) osd_thread *thread = (osd_thread *) param; void *res; res = thread->callback(thread->param); -#ifdef PTR64 - return (unsigned) (long long) res; -#else - return (unsigned) res; -#endif + return unsigned(uintptr_t(res)); } osd_thread *osd_thread_create(osd_thread_callback callback, void *cbparam) diff --git a/src/osd/osdcomm.h b/src/osd/osdcomm.h index c4c5501f2e0..0a94ec0c284 100644 --- a/src/osd/osdcomm.h +++ b/src/osd/osdcomm.h @@ -88,11 +88,7 @@ using INT64 = signed long long; #endif /* pointer-sized values */ -#ifdef PTR64 -using FPTR = UINT64; -#else -using FPTR = UINT32; -#endif +using FPTR = uintptr_t; diff --git a/src/osd/sdl/window.h b/src/osd/sdl/window.h index f10bf6fbd92..6cb2a497ebb 100644 --- a/src/osd/sdl/window.h +++ b/src/osd/sdl/window.h @@ -17,18 +17,15 @@ #include "modules/osdwindow.h" -// I don't like this, but we're going to get spurious "cast to integer of different size" warnings on -// at least one architecture without doing it this way. -#ifdef PTR64 -typedef UINT64 HashT; -#else -typedef UINT32 HashT; -#endif +#include + //============================================================ // TYPE DEFINITIONS //============================================================ +typedef uintptr_t HashT; + #define OSDWORK_CALLBACK(name) void *name(void *param, ATTR_UNUSED int threadid) class sdl_window_info : public osd_window