diff --git a/Common/ArmABI.cpp b/Common/ArmABI.cpp index b3608707ce..a3781a7eaf 100644 --- a/Common/ArmABI.cpp +++ b/Common/ArmABI.cpp @@ -78,7 +78,7 @@ void ARMXEmitter::ARMABI_PopAllCalleeSavedRegsAndAdjustStack() { const char *conditions[] = {"EQ", "NEQ", "CS", "CC", "MI", "PL", "VS", "VC", "HI", "LS", "GE", "LT", "GT", "LE", "AL" }; static void ShowCondition(u32 cond) { - printf("Condition: %s[%d]\n", conditions[cond], cond); + printf("Condition: %s[%d]\n", conditions[cond], (int)cond); } void ARMXEmitter::ARMABI_ShowConditions() { diff --git a/Common/ArmEmitter.cpp b/Common/ArmEmitter.cpp index 024eea1a77..039c68b41e 100644 --- a/Common/ArmEmitter.cpp +++ b/Common/ArmEmitter.cpp @@ -3036,7 +3036,7 @@ void ARMXEmitter::VMOV_imm(u32 Size, ARMReg Vd, VIMMMode type, int imm) { return; error: - _dbg_assert_msg_(JIT, false, "Bad Size or type specified in %s: Size %i Type %i", __FUNCTION__, Size, type); + _dbg_assert_msg_(JIT, false, "Bad Size or type specified in %s: Size %i Type %i", __FUNCTION__, (int)Size, type); } void ARMXEmitter::VMOV_immf(ARMReg Vd, float value) { // This only works with a select few values. I've hardcoded 1.0f. diff --git a/Core/Debugger/SymbolMap.cpp b/Core/Debugger/SymbolMap.cpp index f71562b666..7528a53673 100644 --- a/Core/Debugger/SymbolMap.cpp +++ b/Core/Debugger/SymbolMap.cpp @@ -95,7 +95,7 @@ bool SymbolMap::LoadSymbolMap(const char *filename) { } } - if (strlen(line) < 4 || sscanf(line, "%s", temp) != 1) + if (strlen(line) < 4 || sscanf(line, "%255s", temp) != 1) continue; if (strcmp(temp,"UNUSED")==0) continue; @@ -123,7 +123,7 @@ bool SymbolMap::LoadSymbolMap(const char *filename) { SymbolType type; char name[128] = {0}; - if (sscanf(line, ".module %x %08x %08x %127c", &moduleIndex, &address, &size, name) >= 3) { + if (sscanf(line, ".module %x %08x %08x %127c", (unsigned int *)&moduleIndex, &address, &size, name) >= 3) { // Found a module definition. ModuleEntry mod; mod.index = moduleIndex; @@ -229,7 +229,7 @@ bool SymbolMap::LoadNocashSym(const char *filename) { break; u32 address; - if (sscanf(line, "%08X %s", &address, value) != 2) + if (sscanf(line, "%08X %255s", &address, value) != 2) continue; if (address == 0 && strcmp(value, "0") == 0) continue; @@ -255,7 +255,7 @@ bool SymbolMap::LoadNocashSym(const char *filename) { } } } else { // labels - int size = 1; + unsigned int size = 1; char* seperator = strchr(value, ','); if (seperator != NULL) { *seperator = 0; diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index 528cde669c..3f049f86f3 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -386,7 +386,7 @@ public: (nt.status & THREADSTATUS_SUSPEND) ? "SUSPEND" : "", (nt.status & THREADSTATUS_DORMANT) ? "DORMANT" : "", (nt.status & THREADSTATUS_DEAD) ? "DEAD" : "", - nt.waitType, + (int)nt.waitType, nt.waitID, waitInfo.waitValue); } diff --git a/Qt/Debugger/ctrldisasmview.cpp b/Qt/Debugger/ctrldisasmview.cpp index 931fc84ed6..af496e30a8 100644 --- a/Qt/Debugger/ctrldisasmview.cpp +++ b/Qt/Debugger/ctrldisasmview.cpp @@ -332,7 +332,7 @@ void CtrlDisAsmView::paintEvent(QPaintEvent *) } if (mojs) { - int offs; + unsigned int offs; sscanf(mojs+3,"%08x",&offs); branches[numBranches].src=rowY1 + rowHeight/2; branches[numBranches].srcAddr=address/align; diff --git a/ext/native/ext/vjson/main.cpp b/ext/native/ext/vjson/main.cpp index c0658c3ae0..81f72e5c28 100644 --- a/ext/native/ext/vjson/main.cpp +++ b/ext/native/ext/vjson/main.cpp @@ -25,7 +25,7 @@ void populate_sources(const char *filter, std::vector > &sourc } } - printf("Loaded %d json files\n", sources.size()); + printf("Loaded %d json files\n", (int)sources.size()); } #define IDENT(n) for (int i = 0; i < n; ++i) printf(" ") @@ -91,13 +91,13 @@ int main(int argc, char **argv) int passed = 0; for (size_t i = 0; i < sources.size(); ++i) { - printf("Parsing %d\n", i + 1); + printf("Parsing %d\n", (int)i + 1); if (parse(&sources[i][0])) { ++passed; } } - printf("Passed %d from %d tests\n", passed, sources.size()); + printf("Passed %d from %d tests\n", passed, (int)sources.size()); // Pass sources.clear(); @@ -106,13 +106,13 @@ int main(int argc, char **argv) passed = 0; for (size_t i = 0; i < sources.size(); ++i) { - printf("Parsing %d\n", i + 1); + printf("Parsing %d\n", (int)i + 1); if (parse(&sources[i][0])) { ++passed; } } - printf("Passed %d from %d tests\n", passed, sources.size()); + printf("Passed %d from %d tests\n", passed, (int)sources.size()); return 0; } diff --git a/ext/native/net/http_client.cpp b/ext/native/net/http_client.cpp index 99d019ad33..b4fdb82fe8 100644 --- a/ext/native/net/http_client.cpp +++ b/ext/native/net/http_client.cpp @@ -160,7 +160,7 @@ void DeChunk(Buffer *inbuffer, Buffer *outbuffer, int contentLength, float *prog inbuffer->TakeLineCRLF(&line); if (!line.size()) return; - int chunkSize; + unsigned int chunkSize; sscanf(line.c_str(), "%x", &chunkSize); if (chunkSize) { std::string data; diff --git a/ext/native/tools/atlastool.cpp b/ext/native/tools/atlastool.cpp index b152f66d0d..0e14364ef5 100644 --- a/ext/native/tools/atlastool.cpp +++ b/ext/native/tools/atlastool.cpp @@ -833,7 +833,7 @@ int main(int argc, char **argv) { char locales[256]; int pixheight; float vertOffset = 0; - sscanf(rest, "%s %s %s %i %f", fontname, fontfile, locales, &pixheight, &vertOffset); + sscanf(rest, "%255s %255s %255s %i %f", fontname, fontfile, locales, &pixheight, &vertOffset); printf("Font: %s (%s) in size %i. Locales: %s\n", fontname, fontfile, pixheight, locales); std::vector ranges; @@ -846,7 +846,7 @@ int main(int argc, char **argv) { char imagename[256]; char imagefile[256]; char effectname[256]; - sscanf(rest, "%s %s %s", imagename, imagefile, effectname); + sscanf(rest, "%255s %255s %255s", imagename, imagefile, effectname); Effect effect = GetEffect(effectname); printf("Image %s with effect %s (%i)\n", imagefile, effectname, (int)effect); ImageDesc desc; diff --git a/ext/native/util/text/parsers.cpp b/ext/native/util/text/parsers.cpp index ea53d43d6f..8024324b08 100644 --- a/ext/native/util/text/parsers.cpp +++ b/ext/native/util/text/parsers.cpp @@ -28,7 +28,7 @@ int Version::ToInteger() const { } bool ParseMacAddress(std::string str, uint8_t macAddr[6]) { - int mac[6]; + unsigned int mac[6]; if (6 != sscanf(str.c_str(), "%02x:%02x:%02x:%02x:%02x:%02x", &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5])) { return false; } @@ -36,4 +36,4 @@ bool ParseMacAddress(std::string str, uint8_t macAddr[6]) { macAddr[i] = mac[i]; } return true; -} \ No newline at end of file +}