From 3e18027b8d20bca08dfb5197bded1ed448b067d2 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 19 Oct 2013 14:16:07 -0700 Subject: [PATCH] Fix some type comparison warnings. --- Common/ChunkFile.cpp | 12 ++++++------ Common/ChunkFile.h | 4 ++-- Common/LogManager.cpp | 2 +- Qt/QtHost.cpp | 2 +- Qt/QtHost.h | 4 ++-- Qt/debugger_disasm.cpp | 2 +- Qt/debugger_displaylist.cpp | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Common/ChunkFile.cpp b/Common/ChunkFile.cpp index 0d1d31a0c..8b3c1551e 100644 --- a/Common/ChunkFile.cpp +++ b/Common/ChunkFile.cpp @@ -203,7 +203,7 @@ CChunkFileReader::Error CChunkFileReader::LoadFile(const std::string& _rFilename sz = (int)(fileSize - headerSize); if (header.ExpectedSize != sz) { - ERROR_LOG(COMMON, "ChunkReader: Bad file size, got %d expected %d", sz, header.ExpectedSize); + ERROR_LOG(COMMON, "ChunkReader: Bad file size, got %u expected %u", (u32)sz, header.ExpectedSize); return ERROR_BAD_FILE; } @@ -220,8 +220,8 @@ CChunkFileReader::Error CChunkFileReader::LoadFile(const std::string& _rFilename u8 *uncomp_buffer = new u8[header.UncompressedSize]; size_t uncomp_size = header.UncompressedSize; snappy_uncompress((const char *)buffer, sz, (char *)uncomp_buffer, &uncomp_size); - if ((int)uncomp_size != header.UncompressedSize) { - ERROR_LOG(COMMON, "Size mismatch: file: %i calc: %i", (int)header.UncompressedSize, (int)uncomp_size); + if ((u32)uncomp_size != header.UncompressedSize) { + ERROR_LOG(COMMON, "Size mismatch: file: %u calc: %u", header.UncompressedSize, (u32)uncomp_size); return ERROR_BAD_FILE; } _buffer = uncomp_buffer; @@ -248,8 +248,8 @@ CChunkFileReader::Error CChunkFileReader::SaveFile(const std::string& _rFilename SChunkHeader header; header.Compress = compress ? 1 : 0; header.Revision = _Revision; - header.ExpectedSize = (int)sz; - header.UncompressedSize = (int)sz; + header.ExpectedSize = (u32)sz; + header.UncompressedSize = (u32)sz; strncpy(header.GitVersion, _VersionString, 32); header.GitVersion[31] = '\0'; @@ -259,7 +259,7 @@ CChunkFileReader::Error CChunkFileReader::SaveFile(const std::string& _rFilename u8 *compressed_buffer = new u8[comp_len]; snappy_compress((const char *)buffer, sz, (char *)compressed_buffer, &comp_len); delete [] buffer; - header.ExpectedSize = (int)comp_len; + header.ExpectedSize = (u32)comp_len; if (!pFile.WriteArray(&header, 1)) { ERROR_LOG(COMMON, "ChunkReader: Failed writing header"); diff --git a/Common/ChunkFile.h b/Common/ChunkFile.h index 56ae42ec0..85c0ca14e 100644 --- a/Common/ChunkFile.h +++ b/Common/ChunkFile.h @@ -651,8 +651,8 @@ private: { int Revision; int Compress; - int ExpectedSize; - int UncompressedSize; + u32 ExpectedSize; + u32 UncompressedSize; char GitVersion[32]; }; }; diff --git a/Common/LogManager.cpp b/Common/LogManager.cpp index 5b410a982..8241edc1a 100644 --- a/Common/LogManager.cpp +++ b/Common/LogManager.cpp @@ -88,7 +88,7 @@ static const LogNameTableEntry logTable[] = { LogManager::LogManager() { for (size_t i = 0; i < ARRAY_SIZE(logTable); i++) { if (i != logTable[i].logType) { - FLOG("Bad logtable at %i", i); + FLOG("Bad logtable at %i", (int)i); } log_[logTable[i].logType] = new LogChannel(logTable[i].name, logTable[i].longName); } diff --git a/Qt/QtHost.cpp b/Qt/QtHost.cpp index 8ca533eb0..9e202067a 100644 --- a/Qt/QtHost.cpp +++ b/Qt/QtHost.cpp @@ -213,7 +213,7 @@ void QtHost::SendGPUWait(u32 cmd, u32 addr, void *data) EmuThread_LockDraw(true); } -void QtHost::SetGPUStep(bool value, int flag, int data) +void QtHost::SetGPUStep(bool value, int flag, u32 data) { m_GPUStep = value; m_GPUFlag = flag; diff --git a/Qt/QtHost.h b/Qt/QtHost.h index 1aacbc10c..8eb606b93 100644 --- a/Qt/QtHost.h +++ b/Qt/QtHost.h @@ -53,7 +53,7 @@ public: bool GpuStep(); void SendGPUWait(u32 cmd, u32 addr, void* data); void SendGPUStart(); - void SetGPUStep(bool value, int flag = 0, int data = 0); + void SetGPUStep(bool value, int flag = 0, u32 data = 0); void NextGPUStep(); signals: @@ -62,7 +62,7 @@ private: MainWindow* mainWindow; bool m_GPUStep; int m_GPUFlag; - int m_GPUData; + u32 m_GPUData; }; #endif // QTAPP_H diff --git a/Qt/debugger_disasm.cpp b/Qt/debugger_disasm.cpp index 6a398ede2..c7cf4a7a6 100644 --- a/Qt/debugger_disasm.cpp +++ b/Qt/debugger_disasm.cpp @@ -289,7 +289,7 @@ void Debugger_Disasm::on_GotoLr_clicked() void Debugger_Disasm::on_GotoInt_currentIndexChanged(int index) { CtrlDisAsmView *ptr = ui->DisasmView; - int addr = ui->GotoInt->itemData(index,Qt::UserRole).toInt(); + u32 addr = ui->GotoInt->itemData(index,Qt::UserRole).toInt(); if (addr != 0xFFFFFFFF) ptr->gotoAddr(addr); } diff --git a/Qt/debugger_displaylist.cpp b/Qt/debugger_displaylist.cpp index 00add8f8f..ebffa64ca 100644 --- a/Qt/debugger_displaylist.cpp +++ b/Qt/debugger_displaylist.cpp @@ -182,7 +182,7 @@ void Debugger_DisplayList::ShowDLCode() std::set usedTexAddr; std::set usedVtxAddr; std::set usedIdxAddr; - for(int i = 0; i < drawGPUState.size(); i++) + for(int i = 0; i < (int)drawGPUState.size(); i++) { // Textures QTreeWidgetItem* item = new QTreeWidgetItem();