diff --git a/minecraft/Minecraft.Client/Common/Consoles_App.cpp b/minecraft/Minecraft.Client/Common/Consoles_App.cpp index bd5d226ae..44a845ade 100644 --- a/minecraft/Minecraft.Client/Common/Consoles_App.cpp +++ b/minecraft/Minecraft.Client/Common/Consoles_App.cpp @@ -3791,7 +3791,7 @@ int CMinecraftApp::SignoutExitWorldThreadProc(void* lpParameter) { std::this_thread::sleep_for(std::chrono::milliseconds(1)); } - return S_OK; + return 0; } int CMinecraftApp::UnlockFullInviteReturned(void* pParam, int iPad, @@ -4639,7 +4639,7 @@ int CMinecraftApp::ExitAndJoinFromInviteSaveDialogReturned( &CMinecraftApp::WarningTrialTexturePackReturned, pClass); - return S_OK; + return 0; } } // does the save exist? @@ -4719,7 +4719,7 @@ int CMinecraftApp::ExitAndJoinFromInviteAndSaveReturned( IDS_WARNING_DLC_TRIALTEXTUREPACK_TEXT, uiIDA, 2, iPad, &CMinecraftApp::WarningTrialTexturePackReturned, nullptr); - return S_OK; + return 0; } } // bool validSave = @@ -5243,7 +5243,7 @@ std::unordered_map CMinecraftApp::DLCInfo_SkinName; int32_t CMinecraftApp::RegisterMojangData(wchar_t* pXuidName, PlayerUID xuid, wchar_t* pSkin, wchar_t* pCape) { - int32_t hr = S_OK; + int32_t hr = 0; eXUID eTempXuid = eXUID_Undefined; MOJANG_DATA* pMojangData = nullptr; @@ -5277,7 +5277,7 @@ MOJANG_DATA* CMinecraftApp::GetMojangDataForXuid(PlayerUID xuid) { } int32_t CMinecraftApp::RegisterConfigValues(wchar_t* pType, int iValue) { - int32_t hr = S_OK; + int32_t hr = 0; // #ifdef 0 // if(pType!=nullptr) @@ -5311,7 +5311,7 @@ int32_t CMinecraftApp::RegisterDLCData(wchar_t* pType, wchar_t* pBannerName, wchar_t* pFirstSkin, unsigned int uiSortIndex, int iConfig, wchar_t* pDataFile) { - int32_t hr = S_OK; + int32_t hr = 0; DLC_INFO* pDLCData = new DLC_INFO; ZeroMemory(pDLCData, sizeof(DLC_INFO)); pDLCData->ullOfferID_Full = ullOfferID_Full; @@ -5364,7 +5364,7 @@ int32_t CMinecraftApp::RegisterDLCData(wchar_t* pType, wchar_t* pBannerName, fprintf(stderr, "warning: CMinecraftApp::RegisterDLCData unimplemented for " "platform `__linux__`\n"); - return S_OK; + return 0; } #else @@ -5373,7 +5373,7 @@ int32_t CMinecraftApp::RegisterDLCData(char* pchDLCName, char* pchImageURL) { // on PS3 we get all the required info from the name char chDLCType[3]; - int32_t hr = S_OK; + int32_t hr = 0; DLC_INFO* pDLCData = new DLC_INFO; ZeroMemory(pDLCData, sizeof(DLC_INFO)); @@ -5576,7 +5576,7 @@ int CMinecraftApp::RemoteSaveThreadProc(void* lpParameter) { Tile::ReleaseThreadStorage(); - return S_OK; + return 0; } void CMinecraftApp::ExitGameFromRemoteSave(void* lpParameter) { diff --git a/minecraft/Minecraft.Client/Common/Source Files/Network/GameNetworkManager.cpp b/minecraft/Minecraft.Client/Common/Source Files/Network/GameNetworkManager.cpp index aa94d4973..735366aeb 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/Network/GameNetworkManager.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/Network/GameNetworkManager.cpp @@ -826,7 +826,7 @@ int CGameNetworkManager::ServerThreadProc(void* lpParameter) { if (lpParameter != nullptr) delete (NetworkGameInitData*)lpParameter; - return S_OK; + return 0; } int CGameNetworkManager::ExitAndJoinFromInviteThreadProc(void* lpParam) { @@ -846,7 +846,7 @@ int CGameNetworkManager::ExitAndJoinFromInviteThreadProc(void* lpParam) { JoinFromInviteData* inviteData = (JoinFromInviteData*)lpParam; app.SetAction(inviteData->dwUserIndex, eAppAction_JoinFromInvite, lpParam); - return S_OK; + return 0; } void CGameNetworkManager::_LeaveGame() { @@ -1004,7 +1004,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc(void* lpParam) { app.SetChangingSessionType(false); app.SetReallyChangingSessionType(false); - return S_OK; + return 0; } void CGameNetworkManager::SystemFlagSet(INetworkPlayer* pNetworkPlayer, diff --git a/minecraft/Minecraft.Client/Common/Source Files/Network/PlatformNetworkManagerStub.cpp b/minecraft/Minecraft.Client/Common/Source Files/Network/PlatformNetworkManagerStub.cpp index 201e917f4..664fbabf1 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/Network/PlatformNetworkManagerStub.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/Network/PlatformNetworkManagerStub.cpp @@ -177,7 +177,7 @@ int CPlatformNetworkManagerStub::GetLocalPlayerMask(int playerIndex) { bool CPlatformNetworkManagerStub::AddLocalPlayerByUserIndex(int userIndex) { NotifyPlayerJoined(m_pIQNet->GetLocalPlayerByUserIndex(userIndex)); - return (m_pIQNet->AddLocalPlayerByUserIndex(userIndex) == S_OK); + return (m_pIQNet->AddLocalPlayerByUserIndex(userIndex) == 0); } bool CPlatformNetworkManagerStub::RemoveLocalPlayerByUserIndex(int userIndex) { @@ -563,7 +563,7 @@ bool CPlatformNetworkManagerStub::IsHost() { bool CPlatformNetworkManagerStub::JoinGameFromInviteInfo( int userIndex, int userMask, const INVITE_INFO* pInviteInfo) { return (m_pIQNet->JoinGameFromInviteInfo(userIndex, userMask, - pInviteInfo) == S_OK); + pInviteInfo) == 0); } void CPlatformNetworkManagerStub::SetSessionTexturePackParentId(int id) { diff --git a/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AbstractContainerMenu.cpp b/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AbstractContainerMenu.cpp index 55eaaaa41..cee8b98a9 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AbstractContainerMenu.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_AbstractContainerMenu.cpp @@ -1087,7 +1087,7 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, tutorial->handleUIInput(iAction); if (ui.IsTutorialVisible(getPad()) && !tutorial->isInputAllowed(iAction)) { - return S_OK; + return 0; } } } @@ -1101,7 +1101,7 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool itemEditorKeyPress = false; // Ignore input from other players - // if(pMinecraft->player->GetXboxPad()!=pInputData->UserIndex) return S_OK; + // if(pMinecraft->player->GetXboxPad()!=pInputData->UserIndex) return 0; switch (iAction) { #if defined(_DEBUG_MENUS_ENABLED) @@ -1178,7 +1178,7 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, } bHandled = true; - return S_OK; + return 0; } break; case ACTION_MENU_LEFT: { // ui.PlayUISFX(eSFX_Focus); diff --git a/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CraftingMenu.cpp b/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CraftingMenu.cpp index a013c364f..91e4321d0 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CraftingMenu.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_CraftingMenu.cpp @@ -128,7 +128,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) { // ignore key repeats of the X key - because it's X to open this menu, it // can come through as a repeat on opening if (bRepeat && (iAction == ACTION_MENU_X)) { - return S_OK; + return 0; } Minecraft* pMinecraft = Minecraft::GetInstance(); @@ -140,7 +140,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) { tutorial->handleUIInput(iAction); if (ui.IsTutorialVisible(getPad()) && !tutorial->isInputAllowed(iAction)) { - return S_OK; + return 0; } } } diff --git a/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_PauseMenu.cpp b/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_PauseMenu.cpp index 2757ac1bb..129797412 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_PauseMenu.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_PauseMenu.cpp @@ -67,7 +67,7 @@ int IUIScene_PauseMenu::ExitGameSaveDialogReturned( &IUIScene_PauseMenu::WarningTrialTexturePackReturned, pParam); - return S_OK; + return 0; } } @@ -226,7 +226,7 @@ int IUIScene_PauseMenu::SaveWorldThreadProc(void* lpParameter) { if (!MinecraftServer::serverHalted() && !app.GetChangingSessionType()) app.SetGameStarted(true); - int32_t hr = S_OK; + int32_t hr = 0; if (app.GetChangingSessionType()) { // 4J Stu - This causes the fullscreenprogress scene to ignore the // action it was given @@ -244,7 +244,7 @@ int IUIScene_PauseMenu::ExitWorldThreadProc(void* lpParameter) { _ExitWorld(lpParameter); - return S_OK; + return 0; } // This function performs the meat of exiting from a level. It should be called diff --git a/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_TradingMenu.cpp b/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_TradingMenu.cpp index 35a77f1b1..60b65f7a4 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_TradingMenu.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/UI/All Platforms/IUIScene_TradingMenu.cpp @@ -41,7 +41,7 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) { tutorial->handleUIInput(iAction); if (ui.IsTutorialVisible(getPad()) && !tutorial->isInputAllowed(iAction)) { - return S_OK; + return 0; } } } diff --git a/minecraft/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_FullscreenProgress.cpp b/minecraft/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_FullscreenProgress.cpp index 30d64b482..379b71825 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_FullscreenProgress.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/UI/Scenes/UIScene_FullscreenProgress.cpp @@ -148,7 +148,7 @@ void UIScene_FullscreenProgress::tick() { if (exitcode != C4JThread::kStillActive) { // If we failed (currently used by network connection thread), navigate // back - if (exitcode != S_OK) { + if (exitcode != 0) { if (exitcode == ERROR_CANCELLED) { // Current thread cancelled for whatever reason // Currently used only for the diff --git a/minecraft/Minecraft.Client/Linux/Linux_Minecraft.cpp b/minecraft/Minecraft.Client/Linux/Linux_Minecraft.cpp index 9f2cdc457..d45794baa 100644 --- a/minecraft/Minecraft.Client/Linux/Linux_Minecraft.cpp +++ b/minecraft/Minecraft.Client/Linux/Linux_Minecraft.cpp @@ -622,7 +622,7 @@ int32_t InitDevice() { RenderManager.Initialise(g_pd3dDevice, g_pSwapChain); - return S_OK; + return 0; } //-------------------------------------------------------------------------------------- diff --git a/minecraft/Minecraft.Client/Linux/Stubs/winapi_stubs.h b/minecraft/Minecraft.Client/Linux/Stubs/winapi_stubs.h index 70b1244b3..0d3533338 100644 --- a/minecraft/Minecraft.Client/Linux/Stubs/winapi_stubs.h +++ b/minecraft/Minecraft.Client/Linux/Stubs/winapi_stubs.h @@ -14,16 +14,12 @@ #include #include -#define TRUE true -#define FALSE false #define RtlZeroMemory(Destination, Length) memset((Destination), 0, (Length)) #define ZeroMemory RtlZeroMemory -#define WINAPI #define __cdecl #define _vsnprintf_s vsnprintf; -#define S_OK 0 typedef unsigned int DWORD; typedef unsigned char BYTE; typedef BYTE* PBYTE; @@ -64,8 +60,6 @@ typedef float FLOAT; #define ERROR_SUCCESS 0L #define ERROR_IO_PENDING 997L // dderror #define ERROR_CANCELLED 1223L -// #define S_OK ((HRESULT)0x00000000L) -#define S_FALSE ((HRESULT)0x00000001L) #define INFINITE 0xFFFFFFFF // Infinite timeout @@ -356,7 +350,7 @@ static inline HANDLE CreateFile(const wchar_t* lpFileName, } static inline bool CloseHandle(HANDLE hObject) { - if (hObject == INVALID_HANDLE_VALUE) return FALSE; + if (hObject == INVALID_HANDLE_VALUE) return false; return close((int)(intptr_t)hObject) == 0; } @@ -373,13 +367,13 @@ static inline DWORD GetFileSize(HANDLE hFile, DWORD* lpFileSizeHigh) { static inline bool GetFileSizeEx(HANDLE hFile, LARGE_INTEGER* lpFileSize) { struct stat st{}; - if (fstat((int)(intptr_t)hFile, &st) != 0) return FALSE; + if (fstat((int)(intptr_t)hFile, &st) != 0) return false; if (lpFileSize) { lpFileSize->QuadPart = st.st_size; lpFileSize->LowPart = (DWORD)(st.st_size & 0xFFFFFFFF); lpFileSize->HighPart = (LONG)(st.st_size >> 32); } - return TRUE; + return true; } static inline bool ReadFile(HANDLE hFile, void* lpBuffer, @@ -506,13 +500,13 @@ static inline bool SystemTimeToFileTime(const SYSTEMTIME* lpSystemTime, tm.tm_sec = lpSystemTime->wSecond; time_t t = timegm(&tm); - if (t == (time_t)-1) return FALSE; + if (t == (time_t)-1) return false; uint64_t ft = ((uint64_t)t + 11644473600ULL) * 10000000ULL; ft += lpSystemTime->wMilliseconds * 10000ULL; lpFileTime->dwLowDateTime = (DWORD)(ft & 0xFFFFFFFF); lpFileTime->dwHighDateTime = (DWORD)(ft >> 32); - return TRUE; + return true; } // https://learn.microsoft.com/en-us/windows/win32/api/timezoneapi/nf-timezoneapi-filetimetosystemtime @@ -526,7 +520,7 @@ static inline bool FileTimeToSystemTime(const FILETIME* lpFileTime, struct tm tm; gmtime_r(&t, &tm); // UTC _FillSystemTime(&tm, remainder_ns, lpSystemTime); - return TRUE; + return true; } static inline DWORD GetTickCount() { struct timespec ts; @@ -592,7 +586,7 @@ static inline HANDLE CreateEvent(void*, bool manual_reset, bool initial_state, static inline bool SetEvent(HANDLE hEvent) { Event* ev = (Event*)hEvent; - if (!ev) return FALSE; + if (!ev) return false; pthread_mutex_lock(&ev->mutex); ev->signaled = 1; if (ev->manual_reset) @@ -600,16 +594,16 @@ static inline bool SetEvent(HANDLE hEvent) { else pthread_cond_signal(&ev->cond); pthread_mutex_unlock(&ev->mutex); - return TRUE; + return true; } static inline bool ResetEvent(HANDLE hEvent) { Event* ev = (Event*)hEvent; - if (!ev) return FALSE; + if (!ev) return false; pthread_mutex_lock(&ev->mutex); ev->signaled = 0; pthread_mutex_unlock(&ev->mutex); - return TRUE; + return true; } #define WAIT_FAILED ((DWORD)0xFFFFFFFF) @@ -796,14 +790,14 @@ static inline DWORD ResumeThread(HANDLE hThread) { static inline bool SetThreadPriority(HANDLE hThread, int nPriority) { (void)hThread; (void)nPriority; - return TRUE; + return true; } static inline bool GetExitCodeThread(HANDLE hThread, DWORD* lpExitCode) { LinuxThread* lt = (LinuxThread*)hThread; - if (!lt || !lpExitCode) return FALSE; + if (!lt || !lpExitCode) return false; *lpExitCode = lt->exitCode; - return TRUE; + return true; } static inline DWORD GetCurrentThreadId() { @@ -873,7 +867,7 @@ static inline void* VirtualAlloc(void* lpAddress, size_t dwSize, static inline bool VirtualFree(void* lpAddress, size_t dwSize, DWORD dwFreeType) { - if (lpAddress == nullptr) return FALSE; + if (lpAddress == nullptr) return false; // MEM_RELEASE (0x8000) frees the whole region if (dwFreeType == 0x8000 /*MEM_RELEASE*/) { // dwSize should be 0 for MEM_RELEASE per Win32 API, but we don't track @@ -885,7 +879,7 @@ static inline bool VirtualFree(void* lpAddress, size_t dwSize, // MEM_DECOMMIT (0x4000) - just decommit (make inaccessible) madvise(lpAddress, dwSize, MADV_DONTNEED); } - return TRUE; + return true; } #define swscanf_s swscanf diff --git a/minecraft/Minecraft.Client/Source Files/Extrax64Stubs.cpp b/minecraft/Minecraft.Client/Source Files/Extrax64Stubs.cpp index 3fede7824..98864d86e 100644 --- a/minecraft/Minecraft.Client/Source Files/Extrax64Stubs.cpp +++ b/minecraft/Minecraft.Client/Source Files/Extrax64Stubs.cpp @@ -28,7 +28,7 @@ ATG::XMLParser::XMLParser() {} ATG::XMLParser::~XMLParser() {} int32_t ATG::XMLParser::ParseXMLBuffer(const char* strBuffer, uint32_t uBufferSize) { - return S_OK; + return 0; } void ATG::XMLParser::RegisterSAXCallbackInterface(ISAXCallback* pISAXCallback) { } @@ -36,7 +36,7 @@ void ATG::XMLParser::RegisterSAXCallbackInterface(ISAXCallback* pISAXCallback) { uint32_t XShowPartyUI(uint32_t dwUserIndex) { return 0; } uint32_t XShowFriendsUI(uint32_t dwUserIndex) { return 0; } -int32_t XPartyGetUserList(void* pUserList) { return S_OK; } +int32_t XPartyGetUserList(void* pUserList) { return 0; } uint32_t XContentGetThumbnail(uint32_t dwUserIndex, const XCONTENT_DATA* pContentData, uint8_t* pbThumbnail, uint32_t* pcbThumbnail, @@ -144,7 +144,7 @@ IQNetPlayer IQNet::m_player[4]; bool _bQNetStubGameRunning = false; -int32_t IQNet::AddLocalPlayerByUserIndex(uint32_t dwUserIndex) { return S_OK; } +int32_t IQNet::AddLocalPlayerByUserIndex(uint32_t dwUserIndex) { return 0; } IQNetPlayer* IQNet::GetHostPlayer() { return &m_player[0]; } IQNetPlayer* IQNet::GetLocalPlayerByUserIndex(uint32_t dwUserIndex) { return &m_player[dwUserIndex]; @@ -161,7 +161,7 @@ QNET_STATE IQNet::GetState() { bool IQNet::IsHost() { return true; } int32_t IQNet::JoinGameFromInviteInfo(uint32_t dwUserIndex, uint32_t dwUserMask, const INVITE_INFO* pInviteInfo) { - return S_OK; + return 0; } void IQNet::HostGame() { _bQNetStubGameRunning = true; } void IQNet::EndGame() { _bQNetStubGameRunning = false; } @@ -179,7 +179,7 @@ uint32_t XUserGetSigninInfo(uint32_t dwUserIndex, uint32_t dwFlags, const wchar_t* CXuiStringTable::Lookup(const wchar_t* szId) { return szId; } const wchar_t* CXuiStringTable::Lookup(uint32_t nIndex) { return L"String"; } void CXuiStringTable::Clear() {} -int32_t CXuiStringTable::Load(const wchar_t* szId) { return S_OK; } +int32_t CXuiStringTable::Load(const wchar_t* szId) { return 0; } uint32_t XUserAreUsersFriends(uint32_t dwUserIndex, PPlayerUID pXuids, uint32_t dwXuidCount, bool* pfResult, @@ -191,7 +191,7 @@ int32_t XMemDecompress(XMEMDECOMPRESSION_CONTEXT Context, void* pDestination, size_t* pDestSize, void* pSource, size_t SrcSize) { memcpy(pDestination, pSource, SrcSize); *pDestSize = SrcSize; - return S_OK; + return 0; /* DECOMPRESSOR_HANDLE Decompressor = (DECOMPRESSOR_HANDLE)Context; @@ -203,7 +203,7 @@ int32_t XMemDecompress(XMEMDECOMPRESSION_CONTEXT Context, void* pDestination, *pDestSize, // Decompressed buffer size pDestSize) ) // Decompressed data size { - return S_OK; + return 0; } else */ @@ -216,7 +216,7 @@ int32_t XMemCompress(XMEMCOMPRESSION_CONTEXT Context, void* pDestination, size_t* pDestSize, void* pSource, size_t SrcSize) { memcpy(pDestination, pSource, SrcSize); *pDestSize = SrcSize; - return S_OK; + return 0; /* COMPRESSOR_HANDLE Compressor = (COMPRESSOR_HANDLE)Context; @@ -228,7 +228,7 @@ int32_t XMemCompress(XMEMCOMPRESSION_CONTEXT Context, void* pDestination, Compressed Buffer size pDestSize) ) // Compressed Data size { - return S_OK; + return 0; } else */ @@ -440,7 +440,7 @@ void C_4JProfile::SetNotificationsCallback(void (*Func)(void*, std::uint32_t, void* lpParam) {} bool C_4JProfile::RegionIsNorthAmerica(void) { return false; } bool C_4JProfile::LocaleIsUSorCanada(void) { return false; } -int32_t C_4JProfile::GetLiveConnectionStatus() { return S_OK; } +int32_t C_4JProfile::GetLiveConnectionStatus() { return 0; } bool C_4JProfile::IsSystemUIDisplayed() { return false; } void C_4JProfile::SetProfileReadErrorCallback(void (*Func)(void*), void* lpParam) {} diff --git a/minecraft/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl b/minecraft/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl index 1ab1f13f7..66167f977 100644 --- a/minecraft/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl +++ b/minecraft/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl @@ -477,7 +477,7 @@ static GDrawTexture * RADLINK gdraw_MakeTextureEnd(GDraw_MakeTexture_ProcessingI GDrawHandle *t = (GDrawHandle *) p->p0; D3D1X_(SUBRESOURCE_DATA) mipdata[24]; S32 i, w, h, nmips, bpp; - HRESULT hr = S_OK; + HRESULT hr = 0; char *failed_call; U8 *ptr; @@ -2392,7 +2392,7 @@ GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, D3D1X_(SUBRESOURCE_DATA) mipdata[24] = { 0 }; S32 k; - HRESULT hr = S_OK; + HRESULT hr = 0; width = texture->w; height = texture->h; diff --git a/minecraft/Minecraft.Client/Windows64/Source Files/Windows64_Minecraft.cpp b/minecraft/Minecraft.Client/Windows64/Source Files/Windows64_Minecraft.cpp index b444262d3..abde05fb4 100644 --- a/minecraft/Minecraft.Client/Windows64/Source Files/Windows64_Minecraft.cpp +++ b/minecraft/Minecraft.Client/Windows64/Source Files/Windows64_Minecraft.cpp @@ -533,7 +533,7 @@ LRESULT CALLBACK DlgProc(HWND hWndDlg, uint32_t Msg, WPARAM wParam, // Create Direct3D device and swap chain //-------------------------------------------------------------------------------------- int32_t InitDevice() { - int32_t hr = S_OK; + int32_t hr = 0; RECT rc; GetClientRect(g_hWnd, &rc); @@ -639,7 +639,7 @@ int32_t InitDevice() { RenderManager.Initialise(g_pd3dDevice, g_pSwapChain); - return S_OK; + return 0; } //-------------------------------------------------------------------------------------- diff --git a/minecraft/Minecraft.Client/Windows64/XML/ATGXmlParser.cpp b/minecraft/Minecraft.Client/Windows64/XML/ATGXmlParser.cpp index d7756462f..c24328715 100644 --- a/minecraft/Minecraft.Client/Windows64/XML/ATGXmlParser.cpp +++ b/minecraft/Minecraft.Client/Windows64/XML/ATGXmlParser.cpp @@ -94,7 +94,7 @@ int32_t XMLParser::ConsumeSpace() { if (FAILED(hr = AdvanceCharacter())) return hr; } SkipNextAdvance(); - return S_OK; + return 0; } //------------------------------------------------------------------------------------- @@ -156,7 +156,7 @@ int32_t XMLParser::ConvertEscape() { // copy character into the buffer m_Ch = wVal; - return S_OK; + return 0; } // must be an entity reference @@ -203,7 +203,7 @@ int32_t XMLParser::ConvertEscape() { } m_Ch = wVal; - return S_OK; + return 0; } //------------------------------------------------------------------------------------- @@ -250,7 +250,7 @@ int32_t XMLParser::AdvanceAttrVal() { *m_pWritePtr = m_Ch; m_pWritePtr++; } - return S_OK; + return 0; } //------------------------------------------------------------------------------------- @@ -289,7 +289,7 @@ int32_t XMLParser::AdvanceName() { } SkipNextAdvance(); - return S_OK; + return 0; } //------------------------------------------------------------------------------------- @@ -303,7 +303,7 @@ int32_t XMLParser::AdvanceName() { int32_t XMLParser::AdvanceCharacter(bool bOkToFail) { if (m_bSkipNextAdvance) { m_bSkipNextAdvance = false; - return S_OK; + return 0; } // If we hit EOF in the middle of a character, @@ -346,7 +346,7 @@ int32_t XMLParser::AdvanceCharacter(bool bOkToFail) { } else if (m_Ch != '\r') m_pISAXCallback->m_LinePos++; - return S_OK; + return 0; } //------------------------------------------------------------------------------------- @@ -374,7 +374,7 @@ int32_t XMLParser::AdvanceElement() { return E_INVALID_XML_SYNTAX; } if (FAILED(hr = AdvanceComment())) return hr; - return S_OK; + return 0; } if (m_Ch != '[') { @@ -436,7 +436,7 @@ int32_t XMLParser::AdvanceElement() { for (;;) { if (FAILED(hr = AdvanceCharacter())) return hr; - if (m_Ch == '>') return S_OK; + if (m_Ch == '>') return 0; } } else { XMLAttribute Attributes[XML_MAX_ATTRIBUTES_PER_ELEMENT]; @@ -525,7 +525,7 @@ int32_t XMLParser::AdvanceElement() { } } - return S_OK; + return 0; } //------------------------------------------------------------------------------------- @@ -570,7 +570,7 @@ int32_t XMLParser::AdvanceCDATA() { if (FAILED(m_pISAXCallback->CDATAEnd())) return E_ABORT; - return S_OK; + return 0; } //------------------------------------------------------------------------------------- @@ -595,7 +595,7 @@ int32_t XMLParser::AdvanceComment() { wStage = 0; } - return S_OK; + return 0; } //------------------------------------------------------------------------------------- @@ -618,7 +618,7 @@ ISAXCallback* XMLParser::GetSAXCallbackInterface() { return m_pISAXCallback; } //------------------------------------------------------------------------------------- int32_t XMLParser::MainParseLoop() { bool bWhiteSpaceOnly = true; - int32_t hr = S_OK; + int32_t hr = 0; if (FAILED(m_pISAXCallback->StartDocument())) return E_ABORT; @@ -664,7 +664,7 @@ int32_t XMLParser::MainParseLoop() { if (FAILED(m_pISAXCallback->EndDocument())) return E_ABORT; - return S_OK; + return 0; } if (m_Ch == '<') { diff --git a/minecraft/Minecraft.Client/Windows64/XML/xmlFilesCallback.h b/minecraft/Minecraft.Client/Windows64/XML/xmlFilesCallback.h index 54b2c9e7f..26b712e86 100644 --- a/minecraft/Minecraft.Client/Windows64/XML/xmlFilesCallback.h +++ b/minecraft/Minecraft.Client/Windows64/XML/xmlFilesCallback.h @@ -8,8 +8,8 @@ using namespace ATG; class xmlMojangCallback : public ATG::ISAXCallback { public: - virtual int32_t StartDocument() { return S_OK; }; - virtual int32_t EndDocument() { return S_OK; }; + virtual int32_t StartDocument() { return 0; }; + virtual int32_t EndDocument() { return 0; }; virtual int32_t ElementBegin(const wchar_t* strName, uint32_t NameLen, const XMLAttribute* pAttributes, @@ -22,12 +22,12 @@ public: PlayerUID xuid = 0LL; if (NameLen > 31) - return S_FALSE; + return 1; else wcsncpy(wAttName, strName, NameLen); if (_wcsicmp(wAttName, L"root") == 0) { - return S_OK; + return 0; } else if (_wcsicmp(wAttName, L"data") == 0) { for (uint32_t i = 0; i < NumAttributes; i++) { wcsncpy_s(wAttName, pAttributes[i].strName, @@ -61,29 +61,29 @@ public: return CConsoleMinecraftApp::RegisterMojangData( wNameXUID, xuid, wNameSkin, wNameCloak); } else - return S_FALSE; + return 1; } else { - return S_FALSE; + return 1; } }; virtual int32_t ElementContent(const wchar_t* strData, uint32_t DataLen, bool More) { - return S_OK; + return 0; }; virtual int32_t ElementEnd(const wchar_t* strName, uint32_t NameLen) { - return S_OK; + return 0; }; - virtual int32_t CDATABegin() { return S_OK; }; + virtual int32_t CDATABegin() { return 0; }; virtual int32_t CDATAData(const wchar_t* strCDATA, uint32_t CDATALen, bool bMore) { - return S_OK; + return 0; }; - virtual int32_t CDATAEnd() { return S_OK; }; + virtual int32_t CDATAEnd() { return 0; }; virtual void Error(int32_t hError, const char* strMessage) { app.DebugPrintf("Error when Parsing xuids.XML\n"); @@ -92,8 +92,8 @@ public: class xmlConfigCallback : public ATG::ISAXCallback { public: - virtual int32_t StartDocument() { return S_OK; }; - virtual int32_t EndDocument() { return S_OK; }; + virtual int32_t StartDocument() { return 0; }; + virtual int32_t EndDocument() { return 0; }; virtual int32_t ElementBegin(const wchar_t* strName, uint32_t NameLen, const XMLAttribute* pAttributes, @@ -105,12 +105,12 @@ public: int iValue = -1; if (NameLen > 31) - return S_FALSE; + return 1; else wcsncpy_s(wAttName, strName, NameLen); if (_wcsicmp(wAttName, L"root") == 0) { - return S_OK; + return 0; } else if (_wcsicmp(wAttName, L"data") == 0) { for (uint32_t i = 0; i < NumAttributes; i++) { wcsncpy_s(wAttName, pAttributes[i].strName, @@ -139,30 +139,30 @@ public: return CConsoleMinecraftApp::RegisterConfigValues(wType, iValue); } else { - return S_FALSE; + return 1; } } else { - return S_FALSE; + return 1; } } virtual int32_t ElementContent(const wchar_t* strData, uint32_t DataLen, bool More) { - return S_OK; + return 0; }; virtual int32_t ElementEnd(const wchar_t* strName, uint32_t NameLen) { - return S_OK; + return 0; }; - virtual int32_t CDATABegin() { return S_OK; }; + virtual int32_t CDATABegin() { return 0; }; virtual int32_t CDATAData(const wchar_t* strCDATA, uint32_t CDATALen, bool bMore) { - return S_OK; + return 0; }; - virtual int32_t CDATAEnd() { return S_OK; }; + virtual int32_t CDATAEnd() { return 0; }; virtual void Error(int32_t hError, const char* strMessage) { app.DebugPrintf("Error when Parsing xuids.XML\n"); @@ -171,8 +171,8 @@ public: class xmlDLCInfoCallback : public ATG::ISAXCallback { public: - virtual int32_t StartDocument() { return S_OK; }; - virtual int32_t EndDocument() { return S_OK; }; + virtual int32_t StartDocument() { return 0; }; + virtual int32_t EndDocument() { return 0; }; virtual int32_t ElementBegin(const wchar_t* strName, uint32_t NameLen, const XMLAttribute* pAttributes, @@ -191,12 +191,12 @@ public: int iConfig = 0; if (NameLen > 31) - return S_FALSE; + return 1; else wcsncpy_s(wAttName, strName, NameLen); if (_wcsicmp(wAttName, L"root") == 0) { - return S_OK; + return 0; } else if (_wcsicmp(wAttName, L"data") == 0) { for (uint32_t i = 0; i < NumAttributes; i++) { wcsncpy_s(wAttName, pAttributes[i].strName, @@ -271,30 +271,30 @@ public: wType, wNameBanner, iGender, ullFull, ullTrial, wFirstSkin, uiSortIndex, iConfig, wDataFile); } else { - return S_FALSE; + return 1; } } else { - return S_FALSE; + return 1; } }; virtual int32_t ElementContent(const wchar_t* strData, uint32_t DataLen, bool More) { - return S_OK; + return 0; }; virtual int32_t ElementEnd(const wchar_t* strName, uint32_t NameLen) { - return S_OK; + return 0; }; - virtual int32_t CDATABegin() { return S_OK; }; + virtual int32_t CDATABegin() { return 0; }; virtual int32_t CDATAData(const wchar_t* strCDATA, uint32_t CDATALen, bool bMore) { - return S_OK; + return 0; }; - virtual int32_t CDATAEnd() { return S_OK; }; + virtual int32_t CDATAEnd() { return 0; }; virtual void Error(int32_t hError, const char* strMessage) { app.DebugPrintf("Error when Parsing DLC.XML\n"); diff --git a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp index b4f909e93..2cd0ff20c 100644 --- a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp +++ b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp @@ -513,7 +513,7 @@ void ConsoleSaveFileSplit::_init(const std::wstring& fileName, void* pvSaveData, if (Compression::getCompression()->Decompress( buf, &decompSize, (unsigned char*)pvSaveMem + 8, - fileSize - 8) == S_OK) { + fileSize - 8) == 0) { // Only ReAlloc if we need to (we might already have enough) // and align to 512 byte boundaries unsigned int currentHeapSize = diff --git a/minecraft/Minecraft.World/Source Files/compression.cpp b/minecraft/Minecraft.World/Source Files/compression.cpp index 298ef008b..5e3377848 100644 --- a/minecraft/Minecraft.World/Source Files/compression.cpp +++ b/minecraft/Minecraft.World/Source Files/compression.cpp @@ -95,7 +95,7 @@ int32_t Compression::CompressLZXRLE(void* pDestination, unsigned int* pDestSize, PIXEndNamedEvent(); // printf("Compressed from %d to %d to %d\n",SrcSize,rleSize,*pDestSize); - return S_OK; + return 0; } int32_t Compression::CompressRLE(void* pDestination, unsigned int* pDestSize, @@ -153,7 +153,7 @@ int32_t Compression::CompressRLE(void* pDestination, unsigned int* pDestSize, #endif } - return S_OK; + return 0; } int32_t Compression::DecompressLZXRLE(void* pDestination, @@ -215,7 +215,7 @@ int32_t Compression::DecompressLZXRLE(void* pDestination, if (dynamicRleBuf != nullptr) delete[] dynamicRleBuf; - return S_OK; + return 0; } int32_t Compression::DecompressRLE(void* pDestination, unsigned int* pDestSize, @@ -249,7 +249,7 @@ int32_t Compression::DecompressRLE(void* pDestination, unsigned int* pDestSize, } *pDestSize = (unsigned int)(pucOut - (unsigned char*)pDestination); - return S_OK; + return 0; } int32_t Compression::Compress(void* pDestination, unsigned int* pDestSize, @@ -261,7 +261,7 @@ int32_t Compression::Compress(void* pDestination, unsigned int* pDestSize, int res = ::compress((Bytef*)pDestination, (uLongf*)&destSize, (Bytef*)pSource, SrcSize); *pDestSize = (unsigned int)destSize; - return ((res == Z_OK) ? S_OK : -1); + return ((res == Z_OK) ? 0 : -1); #else size_t destSize = (size_t)(*pDestSize); int32_t res = XMemCompress(compressionContext, pDestination, &destSize, @@ -289,7 +289,7 @@ int32_t Compression::Decompress(void* pDestination, unsigned int* pDestSize, int res = ::uncompress((Bytef*)pDestination, (uLongf*)&destSize, (Bytef*)pSource, SrcSize); *pDestSize = (unsigned int)destSize; - return ((res == Z_OK) ? S_OK : -1); + return ((res == Z_OK) ? 0 : -1); #else size_t destSize = (size_t)(*pDestSize); int32_t res = XMemDecompress(decompressionContext, pDestination, @@ -340,7 +340,7 @@ int32_t Compression::DecompressWithType(void* pDestination, case eCompressionType_None: memcpy(pDestination, pSource, SrcSize); *pDestSize = SrcSize; - return S_OK; + return 0; case eCompressionType_LZXRLE: { #if defined(_WIN64) size_t destSize = (size_t)(*pDestSize); @@ -419,7 +419,7 @@ int32_t Compression::DecompressWithType(void* pDestination, // Delete uncompressed data delete uncompr.data; - return S_OK; + return 0; } else break; // Cannot decompress when destination is nullptr #else diff --git a/minecraft/Minecraft.World/net/minecraft/network/Connection.h b/minecraft/Minecraft.World/net/minecraft/network/Connection.h index 3b92b62b2..7a41f6dba 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/Connection.h +++ b/minecraft/Minecraft.World/net/minecraft/network/Connection.h @@ -29,10 +29,10 @@ class SocketAddress; class ByteArrayOutputStream; class Connection { - friend uint32_t WINAPI runRead(void* lpParam); - friend uint32_t WINAPI runWrite(void* lpParam); - friend uint32_t WINAPI runSendAndQuit(void* lpParam); - friend uint32_t WINAPI runClose(void* lpParam); + friend uint32_t runRead(void* lpParam); + friend uint32_t runWrite(void* lpParam); + friend uint32_t runSendAndQuit(void* lpParam); + friend uint32_t runClose(void* lpParam); private: static const int SEND_BUFFER_SIZE = 1024 * 5;