diff --git a/Minecraft.Client/Network/MultiPlayerChunkCache.cpp b/Minecraft.Client/Network/MultiPlayerChunkCache.cpp index 0b03a5fdd..a9ce60f03 100644 --- a/Minecraft.Client/Network/MultiPlayerChunkCache.cpp +++ b/Minecraft.Client/Network/MultiPlayerChunkCache.cpp @@ -204,8 +204,8 @@ LevelChunk* MultiPlayerChunkCache::create(int x, int z) { #if (defined _WIN64 || defined __LP64__) if (InterlockedCompareExchangeRelease64( - (LONG64*)&cache[idx], (LONG64)chunk, (LONG64)lastChunk) == - (LONG64)lastChunk) + (int64_t*)&cache[idx], (int64_t)chunk, (int64_t)lastChunk) == + (int64_t)lastChunk) #else if (InterlockedCompareExchangeRelease((LONG*)&cache[idx], (LONG)chunk, (LONG)lastChunk) == diff --git a/Minecraft.Client/Network/ServerChunkCache.cpp b/Minecraft.Client/Network/ServerChunkCache.cpp index c2b06b1ff..abe553ea6 100644 --- a/Minecraft.Client/Network/ServerChunkCache.cpp +++ b/Minecraft.Client/Network/ServerChunkCache.cpp @@ -163,8 +163,8 @@ LevelChunk* ServerChunkCache::create( #if defined(_WIN64) || defined(__LP64__) if (InterlockedCompareExchangeRelease64( - (LONG64*)&cache[idx], (LONG64)chunk, (LONG64)lastChunk) == - (LONG64)lastChunk) + (int64_t*)&cache[idx], (int64_t)chunk, (int64_t)lastChunk) == + (int64_t)lastChunk) #else if (InterlockedCompareExchangeRelease((LONG*)&cache[idx], (LONG)chunk, (LONG)lastChunk) == diff --git a/Minecraft.Client/Platform/Extrax64Stubs.cpp b/Minecraft.Client/Platform/Extrax64Stubs.cpp index 0511420aa..00386e8d5 100644 --- a/Minecraft.Client/Platform/Extrax64Stubs.cpp +++ b/Minecraft.Client/Platform/Extrax64Stubs.cpp @@ -474,7 +474,7 @@ void C4JStorage::SetSaveDisabled(bool bDisable) {} bool C4JStorage::GetSaveDisabled(void) { return false; } unsigned int C4JStorage::GetSaveSize() { return 0; } void C4JStorage::GetSaveData(void *pvData,unsigned int *pulBytes) {} -PVOID C4JStorage::AllocateSaveData(unsigned int ulBytes) { return new char[ulBytes]; } +void* C4JStorage::AllocateSaveData(unsigned int ulBytes) { return new char[ulBytes]; } void C4JStorage::SaveSaveData(unsigned int ulBytes,PBYTE pbThumbnail,DWORD cbThumbnail,PBYTE pbTextData, DWORD dwTextLen) {} void C4JStorage::CopySaveDataToNewSave(std::uint8_t *pbThumbnail,unsigned int cbThumbnail,WCHAR *wchNewName,int ( *Func)(void* lpParam, bool), void* lpParam) {} void C4JStorage::SetSaveDeviceSelected(unsigned int uiPad,bool bSelected) {} diff --git a/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp b/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp index 45454d461..18057a2a7 100644 --- a/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp +++ b/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp @@ -1100,7 +1100,7 @@ void operator delete(void* p) { XALLOC_MEMPROTECT_READWRITE, FALSE, XALLOC_MEMTYPE_HEAP)); } -void WINAPI XMemFree(PVOID pAddress, DWORD dwAllocAttributes) { +void WINAPI XMemFree(void* pAddress, DWORD dwAllocAttributes) { bool special = false; if (dwAllocAttributes == 0) { dwAllocAttributes = MAKE_XALLOC_ATTRIBUTES( @@ -1132,7 +1132,7 @@ void WINAPI XMemFree(PVOID pAddress, DWORD dwAllocAttributes) { LeaveCriticalSection(&memCS); } -SIZE_T WINAPI XMemSize(PVOID pAddress, DWORD dwAllocAttributes) { +SIZE_T WINAPI XMemSize(void* pAddress, DWORD dwAllocAttributes) { if (trackStarted) { return XMemSizeDefault(pAddress, dwAllocAttributes) - 16; } else { diff --git a/Minecraft.Client/Platform/Linux/Stubs/winapi_stubs.h b/Minecraft.Client/Platform/Linux/Stubs/winapi_stubs.h index 634b7eb32..178f7346f 100644 --- a/Minecraft.Client/Platform/Linux/Stubs/winapi_stubs.h +++ b/Minecraft.Client/Platform/Linux/Stubs/winapi_stubs.h @@ -29,12 +29,9 @@ typedef void* HANDLE; typedef int INT; typedef long* PLONG; typedef unsigned int* LPDWORD; -typedef const void* LPCVOID; typedef char CHAR; -typedef void* PVOID; typedef uintptr_t ULONG_PTR; typedef long LONG; -typedef long LONG64, *PLONG64; typedef void VOID; typedef ULONGLONG PlayerUID; typedef DWORD WORD; @@ -307,15 +304,15 @@ static inline VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) { static inline DWORD GetLastError(VOID) { return errno; } #ifdef __LP64__ -static inline LONG64 InterlockedCompareExchangeRelease64( - LONG64 volatile* Destination, LONG64 Exchange, LONG64 Comperand) { - LONG64 expected = Comperand; +static inline int64_t InterlockedCompareExchangeRelease64( + int64_t volatile* Destination, int64_t Exchange, int64_t Comperand) { + int64_t expected = Comperand; __atomic_compare_exchange_n(Destination, &expected, Exchange, false, __ATOMIC_RELEASE, __ATOMIC_RELAXED); return expected; } #else -static inline LONG64 InterlockedCompareExchangeRelease( +static inline int64_t InterlockedCompareExchangeRelease( LONG volatile* Destination, LONG Exchange, LONG Comperand) { LONG expected = Comperand; __atomic_compare_exchange_n(Destination, &expected, Exchange, false, diff --git a/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h b/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h index ef135ccff..021da8660 100644 --- a/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h +++ b/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h @@ -260,7 +260,7 @@ public: bool GetSaveDisabled(void); unsigned int GetSaveSize(); void GetSaveData(void *pvData,unsigned int *puiBytes); - PVOID AllocateSaveData(unsigned int uiBytes); + void* AllocateSaveData(unsigned int uiBytes); void SetSaveImages( PBYTE pbThumbnail,DWORD dwThumbnailBytes,PBYTE pbImage,DWORD dwImageBytes, PBYTE pbTextData ,DWORD dwTextDataBytes); // Sets the thumbnail & image for the save, optionally setting the metadata in the png C4JStorage::ESaveGameState SaveSaveData(int( *Func)(void* ,const bool),void* lpParam); void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(void* lpParam, bool), void* lpParam); diff --git a/Minecraft.Client/Platform/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Platform/Windows64/Windows64_Minecraft.cpp index ddb8fc2ad..29069ff6d 100644 --- a/Minecraft.Client/Platform/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Platform/Windows64/Windows64_Minecraft.cpp @@ -986,7 +986,7 @@ void operator delete(void* p) { XALLOC_MEMPROTECT_READWRITE, FALSE, XALLOC_MEMTYPE_HEAP)); } -void WINAPI XMemFree(PVOID pAddress, DWORD dwAllocAttributes) { +void WINAPI XMemFree(void* pAddress, DWORD dwAllocAttributes) { bool special = false; if (dwAllocAttributes == 0) { dwAllocAttributes = MAKE_XALLOC_ATTRIBUTES( @@ -1018,7 +1018,7 @@ void WINAPI XMemFree(PVOID pAddress, DWORD dwAllocAttributes) { LeaveCriticalSection(&memCS); } -SIZE_T WINAPI XMemSize(PVOID pAddress, DWORD dwAllocAttributes) { +SIZE_T WINAPI XMemSize(void* pAddress, DWORD dwAllocAttributes) { if (trackStarted) { return XMemSizeDefault(pAddress, dwAllocAttributes) - 16; } else { diff --git a/Minecraft.World/Level/Storage/SparseDataStorage.cpp b/Minecraft.World/Level/Storage/SparseDataStorage.cpp index 2dfdef0ab..518f064f8 100644 --- a/Minecraft.World/Level/Storage/SparseDataStorage.cpp +++ b/Minecraft.World/Level/Storage/SparseDataStorage.cpp @@ -415,7 +415,7 @@ void SparseDataStorage::addNewPlane(int y) { // lastDataAndCount, and will return the value present just before the // write took place int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( - (LONG64*)&dataAndCount, newDataAndCount, lastDataAndCount); + (int64_t*)&dataAndCount, newDataAndCount, lastDataAndCount); if (lastDataAndCount2 == lastDataAndCount) { success = true; @@ -489,7 +489,7 @@ void SparseDataStorage::updateDataAndCount(int64_t newDataAndCount) { // lastDataAndCount, and will return the value present just before the // write took place int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( - (LONG64*)&dataAndCount, newDataAndCount, lastDataAndCount); + (int64_t*)&dataAndCount, newDataAndCount, lastDataAndCount); if (lastDataAndCount2 == lastDataAndCount) { success = true; @@ -564,7 +564,7 @@ int SparseDataStorage::compress() { // lastDataAndCount, and will return the value present just before the // write took place int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( - (LONG64*)&dataAndCount, newDataAndCount, lastDataAndCount); + (int64_t*)&dataAndCount, newDataAndCount, lastDataAndCount); if (lastDataAndCount2 != lastDataAndCount) { // Failed to write. Don't bother trying again... being very diff --git a/Minecraft.World/Level/Storage/SparseLightStorage.cpp b/Minecraft.World/Level/Storage/SparseLightStorage.cpp index aa262052a..372bc63d5 100644 --- a/Minecraft.World/Level/Storage/SparseLightStorage.cpp +++ b/Minecraft.World/Level/Storage/SparseLightStorage.cpp @@ -418,7 +418,7 @@ void SparseLightStorage::addNewPlane(int y) { // lastDataAndCount, and will return the value present just before the // write took place int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( - (LONG64*)&dataAndCount, newDataAndCount, lastDataAndCount); + (int64_t*)&dataAndCount, newDataAndCount, lastDataAndCount); if (lastDataAndCount2 == lastDataAndCount) { success = true; @@ -492,7 +492,7 @@ void SparseLightStorage::updateDataAndCount(int64_t newDataAndCount) { // lastDataAndCount, and will return the value present just before the // write took place int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( - (LONG64*)&dataAndCount, newDataAndCount, lastDataAndCount); + (int64_t*)&dataAndCount, newDataAndCount, lastDataAndCount); if (lastDataAndCount2 == lastDataAndCount) { success = true; @@ -574,7 +574,7 @@ int SparseLightStorage::compress() { // lastDataAndCount, and will return the value present just before the // write took place int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( - (LONG64*)&dataAndCount, newDataAndCount, lastDataAndCount); + (int64_t*)&dataAndCount, newDataAndCount, lastDataAndCount); if (lastDataAndCount2 != lastDataAndCount) { // Failed to write. Don't bother trying again... being very