From 309f0d97f2fab4a50fb97af7c66a996456ad83c7 Mon Sep 17 00:00:00 2001 From: Herman Semenov Date: Thu, 14 Dec 2023 19:26:10 +0300 Subject: [PATCH] [Common Data Net/Core Debugger HLE/GPU Debugger] Fixed reduction data type size to strict 32-bit integer --- Common/Data/Format/ZIMLoad.cpp | 4 ++-- Common/Net/HTTPServer.cpp | 2 +- Core/Debugger/SymbolMap.cpp | 2 +- Core/HLE/sceKernelModule.cpp | 2 +- GPU/Debugger/Playback.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Common/Data/Format/ZIMLoad.cpp b/Common/Data/Format/ZIMLoad.cpp index 9a145afbe1..1379521c7c 100644 --- a/Common/Data/Format/ZIMLoad.cpp +++ b/Common/Data/Format/ZIMLoad.cpp @@ -132,9 +132,9 @@ int LoadZIM(const char *filename, int *width, int *height, int *format, uint8_t return 0; } - int retval = LoadZIMPtr(buffer, (int)size, width, height, format, image); + int retval = LoadZIMPtr(buffer, size, width, height, format, image); if (!retval) { - ERROR_LOG(IO, "Not a valid ZIM file: %s (size: %d bytes)", filename, (int)size); + ERROR_LOG(IO, "Not a valid ZIM file: %s (size: %lld bytes)", filename, (long long)size); } delete [] buffer; return retval; diff --git a/Common/Net/HTTPServer.cpp b/Common/Net/HTTPServer.cpp index 3822083b79..f8bb760503 100644 --- a/Common/Net/HTTPServer.cpp +++ b/Common/Net/HTTPServer.cpp @@ -118,7 +118,7 @@ void ServerRequest::WriteHttpResponseHeader(const char *ver, int status, int64_t buffer->Printf("Content-Length: %llu\r\n", size); } if (otherHeaders) { - buffer->Push(otherHeaders, (int)strlen(otherHeaders)); + buffer->Push(otherHeaders, strlen(otherHeaders)); } buffer->Push("\r\n"); } diff --git a/Core/Debugger/SymbolMap.cpp b/Core/Debugger/SymbolMap.cpp index 199ce16485..78efc1777e 100644 --- a/Core/Debugger/SymbolMap.cpp +++ b/Core/Debugger/SymbolMap.cpp @@ -1114,7 +1114,7 @@ void SymbolMap::FillSymbolListBox(HWND listbox,SymbolType symType) { case ST_DATA: { - int count = ARRAYSIZE(defaultSymbols)+(int)activeData.size(); + size_t count = ARRAYSIZE(defaultSymbols)+activeData.size(); SendMessage(listbox, LB_INITSTORAGE, (WPARAM)count, (LPARAM)count * 30); for (int i = 0; i < ARRAYSIZE(defaultSymbols); i++) { diff --git a/Core/HLE/sceKernelModule.cpp b/Core/HLE/sceKernelModule.cpp index 87cf486f4a..5501b8f967 100644 --- a/Core/HLE/sceKernelModule.cpp +++ b/Core/HLE/sceKernelModule.cpp @@ -1912,7 +1912,7 @@ bool __KernelLoadGEDump(const std::string &base_filename, std::string *error_str }; for (size_t i = 0; i < ARRAY_SIZE(runDumpCode); ++i) { - Memory::WriteUnchecked_U32(runDumpCode[i], mipsr4k.pc + (int)i * sizeof(u32_le)); + Memory::WriteUnchecked_U32(runDumpCode[i], mipsr4k.pc + (u32)i * sizeof(u32_le)); } PSPModule *module = new PSPModule(); diff --git a/GPU/Debugger/Playback.cpp b/GPU/Debugger/Playback.cpp index 593236889a..413fd8de76 100644 --- a/GPU/Debugger/Playback.cpp +++ b/GPU/Debugger/Playback.cpp @@ -369,7 +369,7 @@ bool DumpExecute::SubmitCmds(const void *p, u32 sz) { gpu->EnableInterrupts(true); } - u32 pendingSize = (int)execListQueue.size() * sizeof(u32); + u32 pendingSize = (u32)execListQueue.size() * sizeof(u32); // Validate space for jump. u32 allocSize = pendingSize + sz + 8; if (execListPos + allocSize >= execListBuf + LIST_BUF_SIZE) {