diff --git a/Minecraft.Client/Level/DemoLevel.h b/Minecraft.Client/Level/DemoLevel.h index 4bfa37984..085e5a506 100644 --- a/Minecraft.Client/Level/DemoLevel.h +++ b/Minecraft.Client/Level/DemoLevel.h @@ -3,7 +3,7 @@ class DemoLevel : public Level { private: - static const __int64 DEMO_LEVEL_SEED = + static const int64_t DEMO_LEVEL_SEED = 0; // 4J - TODO - was "Don't Look Back".hashCode(); static const int DEMO_SPAWN_X = 796; static const int DEMO_SPAWN_Y = 72; diff --git a/Minecraft.Client/MinecraftServer.cpp b/Minecraft.Client/MinecraftServer.cpp index 480659c49..45ca78231 100644 --- a/Minecraft.Client/MinecraftServer.cpp +++ b/Minecraft.Client/MinecraftServer.cpp @@ -107,7 +107,7 @@ MinecraftServer::MinecraftServer() { MinecraftServer::~MinecraftServer() {} -bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData* initData, +bool MinecraftServer::initServer(int64_t seed, NetworkGameInitData* initData, std::uint32_t initSettings, bool findSeed) { // 4J - removed settings = new Settings(new File(L"server.properties")); @@ -323,7 +323,7 @@ void MinecraftServer::postProcessTerminate(ProgressRenderer* mcprogress) { } bool MinecraftServer::loadLevel(LevelStorageSource* storageSource, - const std::wstring& name, __int64 levelSeed, + const std::wstring& name, int64_t levelSeed, LevelType* pLevelType, NetworkGameInitData* initData) { // 4J - TODO - do with new save stuff diff --git a/Minecraft.Client/MinecraftServer.h b/Minecraft.Client/MinecraftServer.h index a18275a89..a042e5d37 100644 --- a/Minecraft.Client/MinecraftServer.h +++ b/Minecraft.Client/MinecraftServer.h @@ -25,9 +25,9 @@ class CommandDispatcher; typedef struct _LoadSaveDataThreadParam { void* data; - __int64 fileSize; + int64_t fileSize; const std::wstring saveName; - _LoadSaveDataThreadParam(void* data, __int64 filesize, + _LoadSaveDataThreadParam(void* data, int64_t filesize, const std::wstring& saveName) : data(data), fileSize(filesize), saveName(saveName) {} } LoadSaveDataThreadParam; @@ -135,11 +135,11 @@ public: private: // 4J Added - LoadSaveDataThreadParam - bool initServer(__int64 seed, NetworkGameInitData* initData, + bool initServer(int64_t seed, NetworkGameInitData* initData, std::uint32_t initSettings, bool findSeed); void postProcessTerminate(ProgressRenderer* mcprogress); bool loadLevel(LevelStorageSource* storageSource, const std::wstring& name, - __int64 levelSeed, LevelType* pLevelType, + int64_t levelSeed, LevelType* pLevelType, NetworkGameInitData* initData); void setProgress(const std::wstring& status, int progress); void endProgress(); @@ -184,7 +184,7 @@ public: public: void halt(); - void run(__int64 seed, void* lpParameter); + void run(int64_t seed, void* lpParameter); void broadcastStartSavingPacket(); void broadcastStopSavingPacket(); diff --git a/Minecraft.Client/Platform/Common/Consoles_App.cpp b/Minecraft.Client/Platform/Common/Consoles_App.cpp index 515c88a0a..b9e56c0fc 100644 --- a/Minecraft.Client/Platform/Common/Consoles_App.cpp +++ b/Minecraft.Client/Platform/Common/Consoles_App.cpp @@ -5549,8 +5549,8 @@ HRESULT CMinecraftApp::RegisterDLCData(WCHAR* pType, WCHAR* pBannerName, } #elif defined(__linux__) HRESULT CMinecraftApp::RegisterDLCData(WCHAR* pType, WCHAR* pBannerName, - int iGender, __uint64 ullOfferID_Full, - __uint64 ullOfferID_Trial, + int iGender, uint64_t ullOfferID_Full, + uint64_t ullOfferID_Trial, WCHAR* pFirstSkin, unsigned int uiSortIndex, int iConfig, WCHAR* pDataFile) { diff --git a/Minecraft.Client/Platform/Common/Consoles_App.h b/Minecraft.Client/Platform/Common/Consoles_App.h index 778c5f29b..213346da2 100644 --- a/Minecraft.Client/Platform/Common/Consoles_App.h +++ b/Minecraft.Client/Platform/Common/Consoles_App.h @@ -810,7 +810,7 @@ public: void GetImageTextData(std::uint8_t* imageData, unsigned int imageBytes, unsigned char* seedText, unsigned int& uiHostOptions, bool& bHostOptionsRead, std::uint32_t& uiTexturePack); - unsigned int CreateImageTextData(std::uint8_t* textMetadata, __int64 seed, + unsigned int CreateImageTextData(std::uint8_t* textMetadata, int64_t seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId); diff --git a/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp b/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp index 70ce347a0..45d98a3ac 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp @@ -101,7 +101,7 @@ bool readOwnedDlcFile(const std::string& path, std::uint8_t** ppData, return false; } - const __int64 endPosition = PortableFileIO::Tell(file); + const int64_t endPosition = PortableFileIO::Tell(file); if (endPosition <= 0 || endPosition > std::numeric_limits::max()) { std::fclose(file); diff --git a/Minecraft.Client/Platform/Common/GameRules/ApplySchematicRuleDefinition.h b/Minecraft.Client/Platform/Common/GameRules/ApplySchematicRuleDefinition.h index 1f5a5cbc1..90afa1be1 100644 --- a/Minecraft.Client/Platform/Common/GameRules/ApplySchematicRuleDefinition.h +++ b/Minecraft.Client/Platform/Common/GameRules/ApplySchematicRuleDefinition.h @@ -20,8 +20,8 @@ private: ConsoleSchematicFile::ESchematicRotation m_rotation; int m_dimension; - __int64 m_totalBlocksChanged; - __int64 m_totalBlocksChangedLighting; + int64_t m_totalBlocksChanged; + int64_t m_totalBlocksChangedLighting; bool m_completed; void updateLocationBox(); diff --git a/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp b/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp index e98c1c58c..6e9fc179b 100644 --- a/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp @@ -186,7 +186,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream* dos) { delete tag; } -__int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk* chunk, +int64_t ConsoleSchematicFile::applyBlocksAndData(LevelChunk* chunk, AABB* chunkBox, AABB* destinationBox, ESchematicRotation rot) { @@ -328,7 +328,7 @@ __int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk* chunk, // At the point that this is called, we have all the neighbouring chunks loaded // in (and generally post-processed, apart from this lighting pass), so we can // do the sort of lighting that might propagate out of the chunk. -__int64 ConsoleSchematicFile::applyLighting(LevelChunk* chunk, AABB* chunkBox, +int64_t ConsoleSchematicFile::applyLighting(LevelChunk* chunk, AABB* chunkBox, AABB* destinationBox, ESchematicRotation rot) { int xStart = std::max(destinationBox->x0, (double)chunk->x * 16); diff --git a/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.h b/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.h index adf862a0b..8a54f201d 100644 --- a/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.h +++ b/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.h @@ -70,9 +70,9 @@ public: void save(DataOutputStream* dos); void load(DataInputStream* dis); - __int64 applyBlocksAndData(LevelChunk* chunk, AABB* chunkBox, + int64_t applyBlocksAndData(LevelChunk* chunk, AABB* chunkBox, AABB* destinationBox, ESchematicRotation rot); - __int64 applyLighting(LevelChunk* chunk, AABB* chunkBox, + int64_t applyLighting(LevelChunk* chunk, AABB* chunkBox, AABB* destinationBox, ESchematicRotation rot); void applyTileEntities(LevelChunk* chunk, AABB* chunkBox, AABB* destinationBox, ESchematicRotation rot); diff --git a/Minecraft.Client/Platform/Common/GameRules/GameRule.h b/Minecraft.Client/Platform/Common/GameRules/GameRule.h index 51265967d..94782b293 100644 --- a/Minecraft.Client/Platform/Common/GameRules/GameRule.h +++ b/Minecraft.Client/Platform/Common/GameRules/GameRule.h @@ -12,7 +12,7 @@ class GameRule { public: typedef struct _ValueType { union { - __int64 i64; + int64_t i64; int i; char c; bool b; diff --git a/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.cpp b/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.cpp index c30d696c3..fd676d01d 100644 --- a/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.cpp @@ -392,7 +392,7 @@ bool GameRuleManager::readRuleFile( // Read File. // version_number - __int64 version = dis.readShort(); + int64_t version = dis.readShort(); unsigned char compressionType = 0; if (version == 0) { for (int i = 0; i < 14; i++) dis.readByte(); // Read padding. diff --git a/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp b/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp index 6bed5528d..51f0bf4c8 100644 --- a/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp @@ -170,7 +170,7 @@ GameRuleDefinition* LevelGenerationOptions::addChild( void LevelGenerationOptions::addAttribute(const std::wstring& attributeName, const std::wstring& attributeValue) { if (attributeName.compare(L"seed") == 0) { - m_seed = _fromString<__int64>(attributeValue); + m_seed = _fromString(attributeValue); app.DebugPrintf( "LevelGenerationOptions: Adding parameter m_seed=%I64d\n", m_seed); } else if (attributeName.compare(L"spawnX") == 0) { diff --git a/Minecraft.Client/Platform/Common/Network/GameNetworkManager.h b/Minecraft.Client/Platform/Common/Network/GameNetworkManager.h index 295111c6e..201198680 100644 --- a/Minecraft.Client/Platform/Common/Network/GameNetworkManager.h +++ b/Minecraft.Client/Platform/Common/Network/GameNetworkManager.h @@ -155,9 +155,9 @@ public: // Used for debugging output static const int messageQueue_length = 512; - static __int64 messageQueue[messageQueue_length]; + static int64_t messageQueue[messageQueue_length]; static const int byteQueue_length = 512; - static __int64 byteQueue[byteQueue_length]; + static int64_t byteQueue[byteQueue_length]; static int messageQueuePos; // Methods called from PlatformNetworkManager diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp b/Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp index 9dfcbc053..9fa50ba64 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp @@ -44,7 +44,7 @@ void UIComponent_Panorama::tick() { Minecraft* pMinecraft = Minecraft::GetInstance(); EnterCriticalSection(&pMinecraft->m_setLevelCS); if (pMinecraft->level != NULL) { - __int64 i64TimeOfDay = 0; + int64_t i64TimeOfDay = 0; // are we in the Nether? - Leave the time as 0 if we are, so we show // daylight if (pMinecraft->level->dimension->id == 0) { diff --git a/Minecraft.Client/Platform/Common/UI/UIController.h b/Minecraft.Client/Platform/Common/UI/UIController.h index 218204bc3..83129abfa 100644 --- a/Minecraft.Client/Platform/Common/UI/UIController.h +++ b/Minecraft.Client/Platform/Common/UI/UIController.h @@ -16,7 +16,7 @@ class UIControl; // Base class for all shared functions between UIControllers class UIController : public IUIController { public: - static __int64 iggyAllocCount; + static int64_t iggyAllocCount; // MGH - added to prevent crash loading Iggy movies while the skins were // being reloaded diff --git a/Minecraft.Client/Platform/Common/UI/UIScene.h b/Minecraft.Client/Platform/Common/UI/UIScene.h index f52d73ac4..546ff3b41 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene.h +++ b/Minecraft.Client/Platform/Common/UI/UIScene.h @@ -130,7 +130,7 @@ private: IggyMemoryUseInfo& memoryInfo); public: - void PrintTotalMemoryUsage(__int64& totalStatic, __int64& totalDynamic); + void PrintTotalMemoryUsage(int64_t& totalStatic, int64_t& totalDynamic); public: UIScene(int iPad, UILayer* parentLayer); diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp index dc232054c..84bb38f2b 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp @@ -708,12 +708,12 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, // start the game bool isFlat = pClass->m_MoreOptionsParams.bFlatWorld; - __int64 seedValue = 0; + int64_t seedValue = 0; NetworkGameInitData* param = new NetworkGameInitData(); if (wSeed.length() != 0) { - __int64 value = 0; + int64_t value = 0; unsigned int len = (unsigned int)wSeed.length(); // Check if the input string contains a numerical value @@ -728,7 +728,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, } // If the input string is a numerical value, convert it to a number - if (isNumber) value = _fromString<__int64>(wSeed); + if (isNumber) value = _fromString(wSeed); // If the value is not 0 use it, otherwise use the algorithm from the // java String.hashCode() function to hash it diff --git a/Minecraft.Client/Platform/Common/UI/UITTFFont.cpp b/Minecraft.Client/Platform/Common/UI/UITTFFont.cpp index c9ef6c4ff..9b12f3d8b 100644 --- a/Minecraft.Client/Platform/Common/UI/UITTFFont.cpp +++ b/Minecraft.Client/Platform/Common/UI/UITTFFont.cpp @@ -21,7 +21,7 @@ UITTFFont::UITTFFont(const std::string& name, const std::string& path, app.FatalLoadError(); } - const __int64 endPosition = PortableFileIO::Tell(file); + const int64_t endPosition = PortableFileIO::Tell(file); if (endPosition < 0) { std::fclose(file); app.FatalLoadError(); diff --git a/Minecraft.Client/Platform/Common/XML/ATGXmlParser.cpp b/Minecraft.Client/Platform/Common/XML/ATGXmlParser.cpp index f4ac09d4b..0560884da 100644 --- a/Minecraft.Client/Platform/Common/XML/ATGXmlParser.cpp +++ b/Minecraft.Client/Platform/Common/XML/ATGXmlParser.cpp @@ -71,7 +71,7 @@ VOID XMLParser::FillBuffer() } m_dwCharsConsumed += NChars; - __int64 iProgress = m_dwCharsTotal ? (( (__int64)m_dwCharsConsumed * 1000 ) / (__int64)m_dwCharsTotal) : 0; + int64_t iProgress = m_dwCharsTotal ? (( (int64_t)m_dwCharsConsumed * 1000 ) / (int64_t)m_dwCharsTotal) : 0; m_pISAXCallback->SetParseProgress( (DWORD)iProgress ); m_pReadBuf[ NChars ] = '\0'; diff --git a/Minecraft.Client/Platform/Linux/Linux_App.cpp b/Minecraft.Client/Platform/Linux/Linux_App.cpp index 14b2cc82d..252cb9074 100644 --- a/Minecraft.Client/Platform/Linux/Linux_App.cpp +++ b/Minecraft.Client/Platform/Linux/Linux_App.cpp @@ -73,7 +73,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() { StorageManager.SetSaveTitle(wWorldName.c_str()); bool isFlat = false; - __int64 seedValue = + int64_t seedValue = 0; // BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // // 4J - was (new Random())->nextLong() - now trying to actually // find a seed to suit our requirements diff --git a/Minecraft.Client/Platform/Linux/Stubs/winapi_stubs.h b/Minecraft.Client/Platform/Linux/Stubs/winapi_stubs.h index ca2741f9c..d17686f2d 100644 --- a/Minecraft.Client/Platform/Linux/Stubs/winapi_stubs.h +++ b/Minecraft.Client/Platform/Linux/Stubs/winapi_stubs.h @@ -62,10 +62,7 @@ typedef size_t SIZE_T; typedef WCHAR *LPWSTR, *PWSTR; typedef unsigned char boolean; // java brainrot #define __debugbreak() -#define __int32 int #define CONST const -typedef int64_t __int64; -typedef uint64_t __uint64; typedef unsigned long ULONG; // typedef unsigned char byte; typedef short SHORT; diff --git a/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h b/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h index 22486cbf9..9577ff706 100644 --- a/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h +++ b/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h @@ -291,7 +291,7 @@ public: void ClearDLCOffers(); XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw); int GetOfferCount(); - DWORD InstallOffer(int iOfferIDC, __uint64 *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false); + DWORD InstallOffer(int iOfferIDC, uint64_t *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false); DWORD GetAvailableDLCCount( int iPad); C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam); diff --git a/Minecraft.Client/Platform/Windows64/Iggy/include/rrCore.h b/Minecraft.Client/Platform/Windows64/Iggy/include/rrCore.h index e88b5f8c3..6465f7577 100644 --- a/Minecraft.Client/Platform/Windows64/Iggy/include/rrCore.h +++ b/Minecraft.Client/Platform/Windows64/Iggy/include/rrCore.h @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed int64_t + #define RAD_UINTa __w64 unsigned int64_t #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned int64_t + #define RAD_S64 signed int64_t #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned int64_t __cdecl _byteswap_uint64 (unsigned int64_t val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned int64_t RR_BSWAP64 (unsigned int64_t _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned int64_t __cdecl _rotl64(unsigned int64_t _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned int64_t)(x),(int)(k)) #elif defined(__RADCELL__) diff --git a/Minecraft.Client/Platform/Windows64/Miles/include/mss.h b/Minecraft.Client/Platform/Windows64/Miles/include/mss.h index 9164a5f7b..f92230b9a 100644 --- a/Minecraft.Client/Platform/Windows64/Miles/include/mss.h +++ b/Minecraft.Client/Platform/Windows64/Miles/include/mss.h @@ -326,7 +326,7 @@ RADDEFSTART typedef CHAR *LPSTR, *PSTR; #ifdef IS_WIN64 - typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; + typedef unsigned int64_t ULONG_PTR, *PULONG_PTR; #else #ifdef _Wp64 #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 diff --git a/Minecraft.Client/Platform/Windows64/Miles/include/rrcore.h b/Minecraft.Client/Platform/Windows64/Miles/include/rrcore.h index e88b5f8c3..6465f7577 100644 --- a/Minecraft.Client/Platform/Windows64/Miles/include/rrcore.h +++ b/Minecraft.Client/Platform/Windows64/Miles/include/rrcore.h @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed int64_t + #define RAD_UINTa __w64 unsigned int64_t #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned int64_t + #define RAD_S64 signed int64_t #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned int64_t __cdecl _byteswap_uint64 (unsigned int64_t val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned int64_t RR_BSWAP64 (unsigned int64_t _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned int64_t __cdecl _rotl64(unsigned int64_t _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned int64_t)(x),(int)(k)) #elif defined(__RADCELL__) diff --git a/Minecraft.Client/Platform/Windows64/Windows64_App.cpp b/Minecraft.Client/Platform/Windows64/Windows64_App.cpp index 41382f270..33056ccdd 100644 --- a/Minecraft.Client/Platform/Windows64/Windows64_App.cpp +++ b/Minecraft.Client/Platform/Windows64/Windows64_App.cpp @@ -77,7 +77,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() StorageManager.SetSaveTitle(wWorldName.c_str()); bool isFlat = false; - __int64 seedValue = 0; // BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements + int64_t seedValue = 0; // BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements NetworkGameInitData *param = new NetworkGameInitData(); param->seed = seedValue; diff --git a/Minecraft.Client/Platform/stdafx.h b/Minecraft.Client/Platform/stdafx.h index 27283318e..9d840b274 100644 --- a/Minecraft.Client/Platform/stdafx.h +++ b/Minecraft.Client/Platform/stdafx.h @@ -22,8 +22,6 @@ #ifdef __linux__ #include "../Platform/Linux/Stubs/LinuxStubs.h" -#else -typedef unsigned __int64 __uint64; #endif #ifdef _WINDOWS64 diff --git a/Minecraft.Client/Rendering/GameRenderer.h b/Minecraft.Client/Rendering/GameRenderer.h index c359e45e2..0659f53af 100644 --- a/Minecraft.Client/Rendering/GameRenderer.h +++ b/Minecraft.Client/Rendering/GameRenderer.h @@ -135,7 +135,7 @@ private: public: void render(float a, bool bFirst); // 4J added bFirst void renderLevel(float a); - void renderLevel(float a, __int64 until); + void renderLevel(float a, int64_t until); private: Random* random; diff --git a/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp b/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp index b3286e0da..66f8e4ac3 100644 --- a/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp +++ b/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp @@ -23,10 +23,10 @@ namespace { bool ReadPortableBinaryFile(File& file, std::uint8_t*& data, unsigned int& size) { - const __int64 fileLength = file.length(); + const int64_t fileLength = file.length(); if (fileLength < 0 || fileLength > - static_cast<__int64>(std::numeric_limits::max())) { + static_cast(std::numeric_limits::max())) { data = NULL; size = 0; return false; diff --git a/Minecraft.Client/UI/Gui.cpp b/Minecraft.Client/UI/Gui.cpp index 11b530e62..d45dc9725 100644 --- a/Minecraft.Client/UI/Gui.cpp +++ b/Minecraft.Client/UI/Gui.cpp @@ -933,7 +933,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { iSafezoneXHalf + 2, 20, 0xffffff); font->drawShadow( L"Seed: " + - _toString<__int64>(minecraft->level->getLevelData()->getSeed()), + _toString(minecraft->level->getLevelData()->getSeed()), iSafezoneXHalf + 2, 32 + 00, 0xffffff); font->drawShadow(minecraft->gatherStats1(), iSafezoneXHalf + 2, 32 + 10, 0xffffff); @@ -1506,8 +1506,8 @@ void Gui::displayClientMessage(int messageId, int iPad) { } // 4J Added -void Gui::renderGraph(int dataLength, int dataPos, __int64* dataA, - float dataAScale, int dataAWarning, __int64* dataB, +void Gui::renderGraph(int dataLength, int dataPos, int64_t* dataA, + float dataAScale, int dataAWarning, int64_t* dataB, float dataBScale, int dataBWarning) { int height = minecraft->height; // This causes us to cover xScale*dataLength pixels in the horizontal @@ -1541,7 +1541,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64* dataA, t->color(0xff000000 + cc * 256); } - __int64 aVal = dataA[i] / dataAScale; + int64_t aVal = dataA[i] / dataAScale; t->vertex((float)(xScale * i + 0.5f), (float)(height - aVal + 0.5f), (float)(0)); @@ -1556,7 +1556,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64* dataA, t->color(0xff808080 + cc / 2 * 256); } - __int64 bVal = dataB[i] / dataBScale; + int64_t bVal = dataB[i] / dataBScale; t->vertex((float)(xScale * i + (xScale - 1) + 0.5f), (float)(height - bVal + 0.5f), (float)(0)); @@ -1570,7 +1570,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64* dataA, } void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources, - __int64 (*func)(unsigned int dataPos, + int64_t (*func)(unsigned int dataPos, unsigned int dataSource)) { int height = minecraft->height; @@ -1587,8 +1587,8 @@ void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources, Tesselator* t = Tesselator::getInstance(); t->begin(GL_LINES); - __int64 thisVal = 0; - __int64 topVal = 0; + int64_t thisVal = 0; + int64_t topVal = 0; for (int i = 0; i < dataLength; i++) { thisVal = 0; topVal = 0; diff --git a/Minecraft.Client/UI/Gui.h b/Minecraft.Client/UI/Gui.h index 4077c9c40..1fb274e00 100644 --- a/Minecraft.Client/UI/Gui.h +++ b/Minecraft.Client/UI/Gui.h @@ -78,10 +78,10 @@ public: float getJukeboxOpacity(int iPad); // 4J Added - void renderGraph(int dataLength, int dataPos, __int64* dataA, - float dataAScale, int dataAWarning, __int64* dataB, + void renderGraph(int dataLength, int dataPos, int64_t* dataA, + float dataAScale, int dataAWarning, int64_t* dataB, float dataBScale, int dataBWarning); void renderStackedGraph(int dataPos, int dataLength, int dataSources, - __int64 (*func)(unsigned int dataPos, + int64_t (*func)(unsigned int dataPos, unsigned int dataSource)); }; diff --git a/Minecraft.Client/UI/Screens/AchievementPopup.h b/Minecraft.Client/UI/Screens/AchievementPopup.h index 087903232..f47c47d73 100644 --- a/Minecraft.Client/UI/Screens/AchievementPopup.h +++ b/Minecraft.Client/UI/Screens/AchievementPopup.h @@ -11,7 +11,7 @@ private: std::wstring title; std::wstring desc; Achievement* ach; - __int64 startTime; + int64_t startTime; ItemRenderer* ir; bool isHelper; diff --git a/Minecraft.Client/UI/Screens/CreateWorldScreen.cpp b/Minecraft.Client/UI/Screens/CreateWorldScreen.cpp index 9de1625fb..f5ed27e5b 100644 --- a/Minecraft.Client/UI/Screens/CreateWorldScreen.cpp +++ b/Minecraft.Client/UI/Screens/CreateWorldScreen.cpp @@ -195,13 +195,13 @@ void CreateWorldScreen::buttonClicked(Button* button) { std::wstring seedString = seedEdit->getValue(); - __int64 seedValue = 0; + int64_t seedValue = 0; NetworkGameInitData* param = new NetworkGameInitData(); if (seedString.length() != 0) { // try to convert it to a long first // try { // 4J - removed try/catch - __int64 value = _fromString<__int64>(seedString); + int64_t value = _fromString(seedString); bool isNumber = true; for (unsigned int i = 0; i < seedString.length(); ++i) { @@ -213,7 +213,7 @@ void CreateWorldScreen::buttonClicked(Button* button) { } } - if (isNumber) value = _fromString<__int64>(seedString); + if (isNumber) value = _fromString(seedString); if (value != 0) { seedValue = value; diff --git a/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp b/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp index 0557435a5..8533c027c 100644 --- a/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp +++ b/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp @@ -273,7 +273,7 @@ void SelectWorldScreen::WorldSelectionList::renderItem(int i, int x, int y, time.wYear, time.wHour, time.wMinute); // 4J - TODO Localise this id = id + L" (" + buffer; - __int64 size = levelSummary->getSizeOnDisk(); + int64_t size = levelSummary->getSizeOnDisk(); id = id + L", " + _toString(size / 1024 * 100 / 1024 / 100.0f) + L" MB)"; std::wstring info; diff --git a/Minecraft.Client/UI/ScrolledSelectionList.h b/Minecraft.Client/UI/ScrolledSelectionList.h index de1395695..a803b35f4 100644 --- a/Minecraft.Client/UI/ScrolledSelectionList.h +++ b/Minecraft.Client/UI/ScrolledSelectionList.h @@ -31,7 +31,7 @@ private: float yo; int lastSelection; - __int64 lastSelectionTime; + int64_t lastSelectionTime; bool renderSelection; bool _renderHeader; diff --git a/Minecraft.Client/Utils/Timer.cpp b/Minecraft.Client/Utils/Timer.cpp index 7a3851069..ef654c8ed 100644 --- a/Minecraft.Client/Utils/Timer.cpp +++ b/Minecraft.Client/Utils/Timer.cpp @@ -18,9 +18,9 @@ Timer::Timer(float ticksPerSecond) { } void Timer::advanceTime() { - __int64 nowMs = System::currentTimeMillis(); - __int64 passedMs = nowMs - lastMs; - __int64 msSysTime = System::nanoTime() / 1000000; + int64_t nowMs = System::currentTimeMillis(); + int64_t passedMs = nowMs - lastMs; + int64_t msSysTime = System::nanoTime() / 1000000; double now = msSysTime / 1000.0; if (passedMs > 1000) { @@ -30,7 +30,7 @@ void Timer::advanceTime() { } else { accumMs += passedMs; if (accumMs > 1000) { - __int64 passedMsSysTime = msSysTime - lastMsSysTime; + int64_t passedMsSysTime = msSysTime - lastMsSysTime; double adjustTimeT = accumMs / (double)passedMsSysTime; adjustTime += (adjustTimeT - adjustTime) * 0.2f; @@ -76,9 +76,9 @@ void Timer::advanceTimeQuickly() { } void Timer::skipTime() { - __int64 nowMs = System::currentTimeMillis(); - __int64 passedMs = nowMs - lastMs; - __int64 msSysTime = System::nanoTime() / 1000000; + int64_t nowMs = System::currentTimeMillis(); + int64_t passedMs = nowMs - lastMs; + int64_t msSysTime = System::nanoTime() / 1000000; double now = msSysTime / 1000.0; if (passedMs > 1000) { @@ -88,7 +88,7 @@ void Timer::skipTime() { } else { accumMs += passedMs; if (accumMs > 1000) { - __int64 passedMsSysTime = msSysTime - lastMsSysTime; + int64_t passedMsSysTime = msSysTime - lastMsSysTime; double adjustTimeT = accumMs / (double)passedMsSysTime; adjustTime += (adjustTimeT - adjustTime) * 0.2f; diff --git a/Minecraft.Client/Utils/Timer.h b/Minecraft.Client/Utils/Timer.h index c60ad51d3..0b958356e 100644 --- a/Minecraft.Client/Utils/Timer.h +++ b/Minecraft.Client/Utils/Timer.h @@ -17,9 +17,9 @@ public: float passedTime; private: - __int64 lastMs; - __int64 lastMsSysTime; - __int64 accumMs; + int64_t lastMs; + int64_t lastMsSysTime; + int64_t accumMs; double adjustTime; diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp index 01bde5335..ccf6f4581 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp @@ -640,7 +640,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail) { std::uint8_t bTextMetadata[88] = {}; - __int64 seed = 0; + int64_t seed = 0; bool hasSeed = false; if (MinecraftServer::getInstance() != NULL && MinecraftServer::getInstance()->levels[0] != NULL) { diff --git a/Minecraft.World/IO/Files/File.cpp b/Minecraft.World/IO/Files/File.cpp index 1755ca92d..000bdb87a 100644 --- a/Minecraft.World/IO/Files/File.cpp +++ b/Minecraft.World/IO/Files/File.cpp @@ -25,12 +25,12 @@ std::wstring ToFilename(const fs::path& path) { return filenametowstring(filename.c_str()); } -__int64 ToEpochMilliseconds(const fs::file_time_type& fileTime) { +int64_t ToEpochMilliseconds(const fs::file_time_type& fileTime) { using namespace std::chrono; const auto systemTime = time_point_cast( fileTime - fs::file_time_type::clock::now() + system_clock::now()); - return static_cast<__int64>(systemTime.time_since_epoch().count()); + return static_cast(systemTime.time_since_epoch().count()); } } // namespace @@ -326,14 +326,14 @@ bool File::isDirectory() const { // value is unspecified if this pathname denotes a directory. Returns: The // length, in bytes, of the file denoted by this abstract pathname, or 0L if the // file does not exist -__int64 File::length() { +int64_t File::length() { std::error_code error; const fs::path path = ToFilesystemPath(getPath()); if (fs::is_regular_file(path, error)) { const auto size = fs::file_size(path, error); if (!error) { - return static_cast<__int64>(size); + return static_cast(size); } } @@ -344,7 +344,7 @@ __int64 File::length() { // modified. Returns: A long value representing the time the file was last // modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, // 1970), or 0L if the file does not exist or if an I/O error occurs -__int64 File::lastModified() { +int64_t File::lastModified() { std::error_code error; const fs::path path = ToFilesystemPath(getPath()); diff --git a/Minecraft.World/IO/Streams/DataInputStream.h b/Minecraft.World/IO/Streams/DataInputStream.h index c4cdd8901..ff4c8ba42 100644 --- a/Minecraft.World/IO/Streams/DataInputStream.h +++ b/Minecraft.World/IO/Streams/DataInputStream.h @@ -24,13 +24,13 @@ public: virtual double readDouble(); virtual float readFloat(); virtual int readInt(); - virtual __int64 readLong(); + virtual int64_t readLong(); virtual short readShort(); virtual unsigned short readUnsignedShort(); virtual std::wstring readUTF(); void deleteChildStream(); virtual int readUTFChar(); virtual PlayerUID readPlayerUID(); // 4J Added - virtual __int64 skip(__int64 n); + virtual int64_t skip(int64_t n); virtual int skipBytes(int n); }; \ No newline at end of file diff --git a/Minecraft.World/Level/LevelConflictException.h b/Minecraft.World/Level/LevelConflictException.h index 43697842c..f2153e2af 100644 --- a/Minecraft.World/Level/LevelConflictException.h +++ b/Minecraft.World/Level/LevelConflictException.h @@ -4,7 +4,7 @@ class LevelConflictException : public RuntimeException { private: - static const __int32 serialVersionUID = 1L; + static const int32_t serialVersionUID = 1L; public: LevelConflictException(const std::wstring& msg); diff --git a/Minecraft.World/Platform/stdafx.h b/Minecraft.World/Platform/stdafx.h index 22011f618..5f03e70a1 100644 --- a/Minecraft.World/Platform/stdafx.h +++ b/Minecraft.World/Platform/stdafx.h @@ -4,10 +4,6 @@ // #pragma once -#ifdef _WINDOWS64 -typedef unsigned __int64 __uint64; -#endif - #ifdef _WINDOWS64 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include