From a32cf817ffe3392e8757db9d7f9e7d2e48a25abb Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 7 Jul 2013 18:24:53 -0700 Subject: [PATCH] Fix some minor warnings. --- Common/ChunkFile.h | 4 ++-- Core/CwCheat.cpp | 2 +- Core/Dialog/SavedataParam.cpp | 6 +++--- Core/Font/PGF.cpp | 7 +++++++ Core/HLE/sceAtrac.cpp | 2 +- Core/HLE/sceHttp.cpp | 8 ++++---- Core/HLE/sceKernelModule.cpp | 2 +- Core/PSPLoaders.cpp | 2 +- Core/SaveState.cpp | 1 + GPU/GLES/TextureScaler.cpp | 2 +- UI/EmuScreen.cpp | 2 +- 11 files changed, 23 insertions(+), 15 deletions(-) diff --git a/Common/ChunkFile.h b/Common/ChunkFile.h index 7e7d640288..36df8a3a97 100644 --- a/Common/ChunkFile.h +++ b/Common/ChunkFile.h @@ -170,7 +170,7 @@ public: template void Do(std::map &x) { - T dv; + T dv = T(); DoMap(x, dv); } @@ -230,7 +230,7 @@ public: template void Do(std::multimap &x) { - T dv; + T dv = T(); DoMultimap(x, dv); } diff --git a/Core/CwCheat.cpp b/Core/CwCheat.cpp index d8724b4dac..5e51e1bfb8 100644 --- a/Core/CwCheat.cpp +++ b/Core/CwCheat.cpp @@ -437,7 +437,7 @@ void CWCheatEngine::Run() { break; case 0x8: // 8-bit and 16-bit patch code code = GetNextCode(); - if (code[0] != NULL) { + if (code[0] != 0) { int data = code[0]; int dataAdd = code[1]; diff --git a/Core/Dialog/SavedataParam.cpp b/Core/Dialog/SavedataParam.cpp index a2e8d8dfa0..c22c318f59 100644 --- a/Core/Dialog/SavedataParam.cpp +++ b/Core/Dialog/SavedataParam.cpp @@ -319,7 +319,7 @@ bool SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &save { const int FILE_LIST_ITEM_SIZE = 13 + 16 + 3; const int FILE_LIST_COUNT_MAX = 99; - const int FILE_LIST_TOTAL_SIZE = FILE_LIST_ITEM_SIZE * FILE_LIST_COUNT_MAX; + const u32 FILE_LIST_TOTAL_SIZE = FILE_LIST_ITEM_SIZE * FILE_LIST_COUNT_MAX; u32 tmpDataSize = 0; u8 *tmpDataOrig = sfoFile.GetValueData("SAVEDATA_FILE_LIST", &tmpDataSize); u8 *tmpData = new u8[FILE_LIST_TOTAL_SIZE]; @@ -346,7 +346,7 @@ bool SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &save if (fName + 13 + 16 <= (char*)tmpData + FILE_LIST_TOTAL_SIZE) memcpy(fName+13, cryptedHash, 16); } - sfoFile.SetValue("SAVEDATA_FILE_LIST", tmpData, FILE_LIST_TOTAL_SIZE, FILE_LIST_TOTAL_SIZE); + sfoFile.SetValue("SAVEDATA_FILE_LIST", tmpData, FILE_LIST_TOTAL_SIZE, (int)FILE_LIST_TOTAL_SIZE); delete[] tmpData; } @@ -892,7 +892,7 @@ int SavedataParam::GetFilesList(SceUtilitySavedataParam *param) u32 sfoFileListSize = 0; char *sfoFileList = (char *)sfoFile.GetValueData("SAVEDATA_FILE_LIST", &sfoFileListSize); const int FILE_LIST_ITEM_SIZE = 13 + 16 + 3; - const int FILE_LIST_COUNT_MAX = 99; + const u32 FILE_LIST_COUNT_MAX = 99; // Filenames are 13 bytes long at most. Add a NULL so there's no surprises. char temp[14]; diff --git a/Core/Font/PGF.cpp b/Core/Font/PGF.cpp index 5503755470..3dbf50b23f 100644 --- a/Core/Font/PGF.cpp +++ b/Core/Font/PGF.cpp @@ -22,6 +22,7 @@ #include "Common/CommonTypes.h" #include "Core/MemMap.h" +#include "Core/Reporting.h" #include "Core/Font/PGF.h" #include "Core/HLE/HLE.h" @@ -490,6 +491,12 @@ void PGF::DrawCharacter(const GlyphImage *image, int clipX, int clipY, int clipW pixelColor |= pixelColor << 8; pixelColor |= pixelColor << 16; break; + case PSP_FONT_PIXELFORMAT_4: + case PSP_FONT_PIXELFORMAT_4_REV: + break; + default: + ERROR_LOG_REPORT(HLE, "Unhandled font pixel format: %d", image->pixelFormat); + break; } SetFontPixel(image->bufferPtr, image->bytesPerLine, image->bufWidth, image->bufHeight, pixelX, pixelY, pixelColor, image->pixelFormat); diff --git a/Core/HLE/sceAtrac.cpp b/Core/HLE/sceAtrac.cpp index b2de674213..80a85916ad 100644 --- a/Core/HLE/sceAtrac.cpp +++ b/Core/HLE/sceAtrac.cpp @@ -1389,7 +1389,7 @@ int sceAtracSetMOutHalfwayBufferAndGetID(u32 halfBuffer, u32 readSize, u32 halfB delete atrac; return atracID; } - INFO_LOG(HLE, "sceAtracSetMOutHalfwayBufferAndGetID(%08x, %08x, %08x)", atracID, halfBuffer, readSize, halfBufferSize); + INFO_LOG(HLE, "%d=sceAtracSetMOutHalfwayBufferAndGetID(%08x, %08x, %08x)", atracID, halfBuffer, readSize, halfBufferSize); int ret = _AtracSetData(atracID, halfBuffer, halfBufferSize, true); if (ret < 0) return ret; diff --git a/Core/HLE/sceHttp.cpp b/Core/HLE/sceHttp.cpp index daaf1008ec..3a8edba925 100644 --- a/Core/HLE/sceHttp.cpp +++ b/Core/HLE/sceHttp.cpp @@ -107,7 +107,7 @@ int sceHttpSetSendTimeOut(int id, u32 timeout) { } u32 sceHttpSetProxy(u32 id, u32 activateFlagPtr, u32 mode, u32 newProxyHostPtr, u32 newProxyPort) { - ERROR_LOG(HLE, "UNIMPL sceHttpSetProxy(%d, %x, %x, %x, %d, %x)", id, activateFlagPtr, mode, newProxyHostPtr, newProxyPort); + ERROR_LOG(HLE, "UNIMPL sceHttpSetProxy(%d, %x, %x, %x, %d)", id, activateFlagPtr, mode, newProxyHostPtr, newProxyPort); return 0; } @@ -143,7 +143,7 @@ int sceHttpsEnd() { // Parameter "method" should be one of PSPHttpMethod's listed entries int sceHttpCreateRequest(int connectionID, int method, const char *path, u64 contentLength) { - ERROR_LOG(HLE, "UNIMPL sceHttpCreateRequest(%d, %d, %s, %x)", connectionID, method, path, contentLength); + ERROR_LOG(HLE, "UNIMPL sceHttpCreateRequest(%d, %d, %s, %llx)", connectionID, method, path, contentLength); return 0; } @@ -229,7 +229,7 @@ int sceHttpCreateTemplate(const char *agent, int unknown1, int unknown2) { // Parameter "method" should be one of PSPHttpMethod's listed entries int sceHttpCreateRequestWithURL(int connectionID, int method, const char *url, u64 contentLength) { - ERROR_LOG(HLE, "UNIMPL sceHttpCreateRequestWithURL(%d, %d, %s, %x)", connectionID, method, url, contentLength); + ERROR_LOG(HLE, "UNIMPL sceHttpCreateRequestWithURL(%d, %d, %s, %llx)", connectionID, method, url, contentLength); return 0; } @@ -249,7 +249,7 @@ int sceHttpGetAllHeader(int request, u32 headerPtrToPtr, u32 headerSize) { } int sceHttpGetContentLength(int requestID, u64 contentLengthPtr) { - ERROR_LOG(HLE, "UNIMPL sceHttpGetContentLength(%d, %x)", requestID, contentLengthPtr); + ERROR_LOG(HLE, "UNIMPL sceHttpGetContentLength(%d, %llx)", requestID, contentLengthPtr); return 0; } diff --git a/Core/HLE/sceKernelModule.cpp b/Core/HLE/sceKernelModule.cpp index 2da852a2cd..e77bbe3397 100644 --- a/Core/HLE/sceKernelModule.cpp +++ b/Core/HLE/sceKernelModule.cpp @@ -1349,7 +1349,7 @@ u32 sceKernelGetModuleIdByAddress(u32 moduleAddr) state.result = SCE_KERNEL_ERROR_UNKNOWN_MODULE; kernelObjects.Iterate(&__GetModuleIdByAddressIterator, &state); - if (state.result == SCE_KERNEL_ERROR_UNKNOWN_MODULE) + if (state.result == (SceUID)SCE_KERNEL_ERROR_UNKNOWN_MODULE) ERROR_LOG(HLE, "sceKernelGetModuleIdByAddress(%08x): module not found", moduleAddr) else DEBUG_LOG(HLE, "%x=sceKernelGetModuleIdByAddress(%08x)", state.result, moduleAddr); diff --git a/Core/PSPLoaders.cpp b/Core/PSPLoaders.cpp index 6b04e80872..a177ba6db5 100644 --- a/Core/PSPLoaders.cpp +++ b/Core/PSPLoaders.cpp @@ -72,7 +72,7 @@ void InitMemoryForGameISO(std::string fileToStart) { { gameID = g_paramSFO.GetValueString("DISC_ID"); - for(int i = 0; i < ARRAY_SIZE(g_HDRemasters); i++) { + for (size_t i = 0; i < ARRAY_SIZE(g_HDRemasters); i++) { if(g_HDRemasters[i].gameID == gameID) { g_RemasterMode = true; Memory::g_MemorySize = g_HDRemasters[i].MemorySize; diff --git a/Core/SaveState.cpp b/Core/SaveState.cpp index d590e01190..83885d3fc0 100644 --- a/Core/SaveState.cpp +++ b/Core/SaveState.cpp @@ -255,6 +255,7 @@ namespace SaveState default: ERROR_LOG(COMMON, "Savestate failure: unknown operation type %d", op.type); + result = false; break; } diff --git a/GPU/GLES/TextureScaler.cpp b/GPU/GLES/TextureScaler.cpp index 886f02acd9..b592c2cdb2 100644 --- a/GPU/GLES/TextureScaler.cpp +++ b/GPU/GLES/TextureScaler.cpp @@ -526,7 +526,7 @@ TextureScaler::TextureScaler() { bool TextureScaler::IsEmptyOrFlat(u32* data, int pixels, GLenum fmt) { int pixelsPerWord = (fmt == GL_UNSIGNED_BYTE) ? 1 : 2; - int ref = data[0]; + u32 ref = data[0]; for(int i=0; i