From a13a040c067999fa52c9e0ac8d08f6edcd6c792f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 5 Nov 2015 14:29:26 +0100 Subject: Change some int casts to intptr_t --- src/getset.h | 14 +++++++------- src/sa1.cpp | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/getset.h b/src/getset.h index 44759e8..00387e1 100644 --- a/src/getset.h +++ b/src/getset.h @@ -81,7 +81,7 @@ INLINE uint8 S9xGetByte (uint32 Address) return (*(GetAddress + (Address & 0xffff))); } - switch ((int) GetAddress) + switch ((intptr_t) GetAddress) { case CMemory::MAP_PPU: #ifdef VAR_CYCLES @@ -177,7 +177,7 @@ INLINE uint16 S9xGetWord (uint32 Address) #endif } - switch ((int) GetAddress) + switch ((intptr_t) GetAddress) { case CMemory::MAP_PPU: #ifdef VAR_CYCLES @@ -290,7 +290,7 @@ INLINE void S9xSetByte (uint8 Byte, uint32 Address) return; } - switch ((int) SetAddress) + switch ((intptr_t) SetAddress) { case CMemory::MAP_PPU: #ifdef VAR_CYCLES @@ -428,7 +428,7 @@ INLINE void S9xSetWord (uint16 Word, uint32 Address) return; } - switch ((int) SetAddress) + switch ((intptr_t) SetAddress) { case CMemory::MAP_PPU: #ifdef VAR_CYCLES @@ -531,7 +531,7 @@ INLINE uint8 *GetBasePointer (uint32 Address) if (GetAddress >= (uint8 *) CMemory::MAP_LAST) return (GetAddress); - switch ((int) GetAddress) + switch ((intptr_t) GetAddress) { case CMemory::MAP_PPU: return (Memory.FillRAM - 0x2000); @@ -570,7 +570,7 @@ INLINE uint8 *S9xGetMemPointer (uint32 Address) if (GetAddress >= (uint8 *) CMemory::MAP_LAST) return (GetAddress + (Address & 0xffff)); - switch ((int) GetAddress) + switch ((intptr_t) GetAddress) { case CMemory::MAP_PPU: return (Memory.FillRAM - 0x2000 + (Address & 0xffff)); @@ -621,7 +621,7 @@ INLINE void S9xSetPCBase (uint32 Address) return; } - switch ((int) GetAddress) + switch ((intptr_t) GetAddress) { case CMemory::MAP_PPU: #ifdef VAR_CYCLES diff --git a/src/sa1.cpp b/src/sa1.cpp index 9bd0f8f..73b1fa4 100644 --- a/src/sa1.cpp +++ b/src/sa1.cpp @@ -203,7 +203,7 @@ uint8 S9xSA1GetByte (uint32 address) { uint8 *GetAddress = SA1_Map [(address >> MEMMAP_SHIFT) & MEMMAP_MASK]; if (GetAddress >= (uint8 *) CMemory::MAP_LAST) return (*(GetAddress + (address & 0xffff))); - return S9xSA1GetByte_JumpTable[(int) GetAddress](address); + return S9xSA1GetByte_JumpTable[(intptr_t) GetAddress](address); // return (SA1_Map [(address >> MEMMAP_SHIFT) & MEMMAP_MASK] >= (uint8 *)CMemory::MAP_LAST) ? // (*((uint8 *)(SA1_Map [(address >> MEMMAP_SHIFT) & MEMMAP_MASK]) + (address & 0xffff))) : // S9xSA1GetByte_JumpTable[(int) SA1_Map [(address >> MEMMAP_SHIFT) & MEMMAP_MASK]](address); @@ -292,7 +292,7 @@ void S9xSA1SetByte (uint8 byte, uint32 address) *(Setaddress + (address & 0xffff)) = byte; return; } - S9xSA1SetByte_JumpTable[(int)Setaddress](byte, address); + S9xSA1SetByte_JumpTable[(intptr_t)Setaddress](byte, address); } void S9xSA1SetPCBase (uint32 address) @@ -305,7 +305,7 @@ void S9xSA1SetPCBase (uint32 address) return; } - switch ((int) GetAddress) + switch ((intptr_t) GetAddress) { case CMemory::MAP_PPU: SA1.PCBase = Memory.FillRAM - 0x2000; -- cgit v1.2.3