diff --git a/3rdparty/sqlite3/sqlite3.h b/3rdparty/sqlite3/sqlite3.h index c31f126dbbe..352f4909fbc 100644 --- a/3rdparty/sqlite3/sqlite3.h +++ b/3rdparty/sqlite3/sqlite3.h @@ -256,6 +256,13 @@ typedef struct sqlite3 sqlite3; typedef sqlite_int64 sqlite3_int64; typedef sqlite_uint64 sqlite3_uint64; +/* pointer-sized values */ +#ifdef PTR64 +typedef sqlite3_uint64 FPTR; +#else +typedef unsigned int FPTR; +#endif + /* ** If compiling for a processor that lacks floating point support, ** substitute integer for floating-point. @@ -4382,7 +4389,7 @@ SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(voi */ typedef void (*sqlite3_destructor_type)(void*); #define SQLITE_STATIC ((sqlite3_destructor_type)0) -#define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) +#define SQLITE_TRANSIENT ((sqlite3_destructor_type)(FPTR)-1) /* ** CAPI3REF: Setting The Result Of An SQL Function diff --git a/src/emu/cpu/drcbex64.h b/src/emu/cpu/drcbex64.h index 6b6cf729b64..dcd5505fe5b 100644 --- a/src/emu/cpu/drcbex64.h +++ b/src/emu/cpu/drcbex64.h @@ -73,8 +73,8 @@ private: static inline be_parameter make_ireg(int regnum) { assert(regnum >= 0 && regnum < x64emit::REG_MAX); return be_parameter(PTYPE_INT_REGISTER, regnum); } static inline be_parameter make_freg(int regnum) { assert(regnum >= 0 && regnum < x64emit::REG_MAX); return be_parameter(PTYPE_FLOAT_REGISTER, regnum); } static inline be_parameter make_vreg(int regnum) { assert(regnum >= 0 && regnum < x64emit::REG_MAX); return be_parameter(PTYPE_VECTOR_REGISTER, regnum); } - static inline be_parameter make_memory(void *base) { return be_parameter(PTYPE_MEMORY, reinterpret_cast(base)); } - static inline be_parameter make_memory(const void *base) { return be_parameter(PTYPE_MEMORY, reinterpret_cast(const_cast(base))); } + static inline be_parameter make_memory(void *base) { return be_parameter(PTYPE_MEMORY, static_cast(reinterpret_cast(base))); } + static inline be_parameter make_memory(const void *base) { return be_parameter(PTYPE_MEMORY, static_cast(reinterpret_cast(const_cast(base)))); } // operators bool operator==(const be_parameter &rhs) const { return (m_type == rhs.m_type && m_value == rhs.m_value); } diff --git a/src/emu/cpu/drcbex86.h b/src/emu/cpu/drcbex86.h index 3c3af63d0d0..1e3910f4084 100644 --- a/src/emu/cpu/drcbex86.h +++ b/src/emu/cpu/drcbex86.h @@ -73,8 +73,8 @@ private: static inline be_parameter make_ireg(int regnum) { assert(regnum >= 0 && regnum < x86emit::REG_MAX); return be_parameter(PTYPE_INT_REGISTER, regnum); } static inline be_parameter make_freg(int regnum) { assert(regnum >= 0 && regnum < x86emit::REG_MAX); return be_parameter(PTYPE_FLOAT_REGISTER, regnum); } static inline be_parameter make_vreg(int regnum) { assert(regnum >= 0 && regnum < x86emit::REG_MAX); return be_parameter(PTYPE_VECTOR_REGISTER, regnum); } - static inline be_parameter make_memory(void *base) { return be_parameter(PTYPE_MEMORY, reinterpret_cast(base)); } - static inline be_parameter make_memory(const void *base) { return be_parameter(PTYPE_MEMORY, reinterpret_cast(const_cast(base))); } + static inline be_parameter make_memory(void *base) { return be_parameter(PTYPE_MEMORY, static_cast(reinterpret_cast(base))); } + static inline be_parameter make_memory(const void *base) { return be_parameter(PTYPE_MEMORY, static_cast(reinterpret_cast(const_cast(base)))); } // operators bool operator==(const be_parameter &rhs) const { return (m_type == rhs.m_type && m_value == rhs.m_value); } diff --git a/src/emu/cpu/uml.h b/src/emu/cpu/uml.h index 53eacfa49d9..db1ed62f83a 100644 --- a/src/emu/cpu/uml.h +++ b/src/emu/cpu/uml.h @@ -305,7 +305,7 @@ namespace uml parameter(UINT64 val) : m_type(PTYPE_IMMEDIATE), m_value(val) { } parameter(operand_size size, memory_scale scale) : m_type(PTYPE_SIZE_SCALE), m_value((scale << 4) | size) { assert(size >= SIZE_BYTE && size <= SIZE_DQWORD); assert(scale >= SCALE_x1 && scale <= SCALE_x8); } parameter(operand_size size, memory_space space) : m_type(PTYPE_SIZE_SPACE), m_value((space << 4) | size) { assert(size >= SIZE_BYTE && size <= SIZE_DQWORD); assert(space >= SPACE_PROGRAM && space <= SPACE_IO); } - parameter(code_handle &handle) : m_type(PTYPE_CODE_HANDLE), m_value(reinterpret_cast(&handle)) { } + parameter(code_handle &handle) : m_type(PTYPE_CODE_HANDLE), m_value(static_cast(reinterpret_cast(&handle))) { } parameter(code_label &label) : m_type(PTYPE_CODE_LABEL), m_value(label) { } // creators for types that don't safely default @@ -313,11 +313,11 @@ namespace uml static inline parameter make_freg(int regnum) { assert(regnum >= REG_F0 && regnum < REG_F_END); return parameter(PTYPE_FLOAT_REGISTER, regnum); } static inline parameter make_vreg(int regnum) { assert(regnum >= REG_V0 && regnum < REG_V_END); return parameter(PTYPE_VECTOR_REGISTER, regnum); } static inline parameter make_mapvar(int mvnum) { assert(mvnum >= MAPVAR_M0 && mvnum < MAPVAR_END); return parameter(PTYPE_MAPVAR, mvnum); } - static inline parameter make_memory(void *base) { return parameter(PTYPE_MEMORY, reinterpret_cast(base)); } - static inline parameter make_memory(const void *base) { return parameter(PTYPE_MEMORY, reinterpret_cast(const_cast(base))); } + static inline parameter make_memory(void *base) { return parameter(PTYPE_MEMORY, static_cast(reinterpret_cast(base))); } + static inline parameter make_memory(const void *base) { return parameter(PTYPE_MEMORY, static_cast(reinterpret_cast(const_cast(base)))); } static inline parameter make_size(operand_size size) { assert(size >= SIZE_BYTE && size <= SIZE_DQWORD); return parameter(PTYPE_SIZE, size); } - static inline parameter make_string(const char *string) { return parameter(PTYPE_STRING, reinterpret_cast(const_cast(string))); } - static inline parameter make_cfunc(c_function func) { return parameter(PTYPE_C_FUNCTION, reinterpret_cast(func)); } + static inline parameter make_string(const char *string) { return parameter(PTYPE_STRING, static_cast(reinterpret_cast(const_cast(string)))); } + static inline parameter make_cfunc(c_function func) { return parameter(PTYPE_C_FUNCTION, static_cast(reinterpret_cast(func))); } static inline parameter make_rounding(float_rounding_mode mode) { assert(mode >= ROUND_TRUNC && mode <= ROUND_DEFAULT); return parameter(PTYPE_ROUNDING, mode); } // operators diff --git a/src/emu/ui/inputmap.c b/src/emu/ui/inputmap.c index 4150bfc9649..472bd7cb15b 100644 --- a/src/emu/ui/inputmap.c +++ b/src/emu/ui/inputmap.c @@ -73,7 +73,7 @@ void ui_menu_input_groups::handle() /* process the menu */ const ui_menu_event *menu_event = process(0); if (menu_event != NULL && menu_event->iptkey == IPT_UI_SELECT) - ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_input_general(machine(), container, int((long long)(menu_event->itemref)-1)))); + ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_input_general(machine(), container, int((long long)((FPTR)menu_event->itemref)-1)))); } diff --git a/src/emu/ui/mainmenu.c b/src/emu/ui/mainmenu.c index 9809833a506..0110c3754f9 100644 --- a/src/emu/ui/mainmenu.c +++ b/src/emu/ui/mainmenu.c @@ -151,7 +151,7 @@ void ui_menu_main::handle() /* process the menu */ const ui_menu_event *menu_event = process(0); if (menu_event != NULL && menu_event->iptkey == IPT_UI_SELECT) { - switch((long long)(menu_event->itemref)) { + switch((long long)((FPTR) menu_event->itemref)) { case INPUT_GROUPS: ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_input_groups(machine(), container))); break; diff --git a/src/lib/util/bitmap.c b/src/lib/util/bitmap.c index 4d1f8502f50..170e2dd98b7 100644 --- a/src/lib/util/bitmap.c +++ b/src/lib/util/bitmap.c @@ -49,7 +49,7 @@ inline INT32 bitmap_t::compute_rowpixels(int width, int xslop) inline void bitmap_t::compute_base(int xslop, int yslop) { m_base = m_alloc + (m_rowpixels * yslop + xslop) * (m_bpp / 8); - UINT64 aligned_base = ((reinterpret_cast(m_base) + (BITMAP_OVERALL_ALIGN - 1)) / BITMAP_OVERALL_ALIGN) * BITMAP_OVERALL_ALIGN; + UINT64 aligned_base = ((static_cast(reinterpret_cast(m_base)) + (BITMAP_OVERALL_ALIGN - 1)) / BITMAP_OVERALL_ALIGN) * BITMAP_OVERALL_ALIGN; m_base = reinterpret_cast(aligned_base); } diff --git a/src/osd/windows/winprefix.h b/src/osd/windows/winprefix.h index 2635685eff1..1f26a2104a2 100644 --- a/src/osd/windows/winprefix.h +++ b/src/osd/windows/winprefix.h @@ -31,6 +31,7 @@ #pragma warning (disable: 5025 5026 5027) #define _CRT_STDIO_LEGACY_WIDE_SPECIFIERS #endif +#define strtoll _strtoi64 #endif #ifdef __GNUC__