From e764723832b1ce60f8c1720b6676d5622bca436e Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Wed, 27 Aug 2008 16:12:05 +0000 Subject: [PATCH] Fixed warnings about comparison between signed and unsigned integer expressions. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@366 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/ChunkFile.cpp | 4 ++-- Source/Core/Common/Src/StringUtil.cpp | 4 ++-- Source/Core/Common/Src/Thread.cpp | 2 +- Source/Core/Core/Src/HLE/HLE.cpp | 6 +++--- Source/Core/DolphinWX/src/FileSearch.cpp | 2 +- Source/Core/DolphinWX/src/GameListCtrl.cpp | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/Core/Common/Src/ChunkFile.cpp b/Source/Core/Common/Src/ChunkFile.cpp index 48f4498fef..849f692631 100644 --- a/Source/Core/Common/Src/ChunkFile.cpp +++ b/Source/Core/Common/Src/ChunkFile.cpp @@ -89,7 +89,7 @@ bool ChunkFile::Do(void *ptr, int size) //let's get into the business bool ChunkFile::Descend(const char *cid) { - int id = *((int*)cid); + unsigned int id = *reinterpret_cast(cid); if (mode == MODE_READ) { bool found = false; @@ -100,7 +100,7 @@ bool ChunkFile::Descend(const char *cid) stack[stack_ptr].parentStartLocation = startPos; stack[stack_ptr].parentEOF = eof; - int firstID = 0; + unsigned int firstID = 0; //let's search through children.. while (ftell(f) < eof) { diff --git a/Source/Core/Common/Src/StringUtil.cpp b/Source/Core/Common/Src/StringUtil.cpp index 03bdff88d5..590b20fc4a 100644 --- a/Source/Core/Common/Src/StringUtil.cpp +++ b/Source/Core/Common/Src/StringUtil.cpp @@ -334,14 +334,14 @@ bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _ #else bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _pFilename, std::string* _pExtension) { - int last_slash = full_path.rfind('/'); + size_t last_slash = full_path.rfind('/'); if (last_slash == std::string::npos) { return(false); } - int last_dot = full_path.rfind('.'); + size_t last_dot = full_path.rfind('.'); if ((last_dot == std::string::npos) || (last_dot < last_slash)) { diff --git a/Source/Core/Common/Src/Thread.cpp b/Source/Core/Common/Src/Thread.cpp index 1c46b5bba3..61c2f13c5e 100644 --- a/Source/Core/Common/Src/Thread.cpp +++ b/Source/Core/Common/Src/Thread.cpp @@ -256,7 +256,7 @@ void Thread::SetAffinity(int mask) cpu_set_t cpu_set; CPU_ZERO(&cpu_set); - for (int i = 0; i < sizeof(mask) * 8; i++) + for (unsigned int i = 0; i < sizeof(mask) * 8; i++) { if ((mask >> i) & 1){CPU_SET(i, &cpu_set);} } diff --git a/Source/Core/Core/Src/HLE/HLE.cpp b/Source/Core/Core/Src/HLE/HLE.cpp index be04833c7a..72d7cb5da3 100644 --- a/Source/Core/Core/Src/HLE/HLE.cpp +++ b/Source/Core/Core/Src/HLE/HLE.cpp @@ -125,15 +125,15 @@ void PatchFunctions() void Execute(u32 _CurrentPC, u32 _Instruction) { - int FunctionIndex = _Instruction & 0xFFFFF; + unsigned int FunctionIndex = _Instruction & 0xFFFFF; if ((FunctionIndex > 0) && (FunctionIndex < (sizeof(OSPatches) / sizeof(SPatch)))) { OSPatches[FunctionIndex].PatchFunction(); - } + } else { PanicAlert("HLE system tried to call an undefined HLE function %i.", FunctionIndex); - } + } // _dbg_assert_msg_(HLE,NPC == LR, "Broken HLE function (doesn't set NPC)", OSPatches[pos].m_szPatchName); } diff --git a/Source/Core/DolphinWX/src/FileSearch.cpp b/Source/Core/DolphinWX/src/FileSearch.cpp index d4441404d6..f3bf7db712 100644 --- a/Source/Core/DolphinWX/src/FileSearch.cpp +++ b/Source/Core/DolphinWX/src/FileSearch.cpp @@ -67,7 +67,7 @@ void CFileSearch::FindFiles(const std::string& _searchString, const std::string& } #else - int dot_pos = _searchString.rfind("."); + size_t dot_pos = _searchString.rfind("."); if (dot_pos == std::string::npos) { diff --git a/Source/Core/DolphinWX/src/GameListCtrl.cpp b/Source/Core/DolphinWX/src/GameListCtrl.cpp index 920fadb721..dcc8090292 100644 --- a/Source/Core/DolphinWX/src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/src/GameListCtrl.cpp @@ -234,7 +234,7 @@ CGameListCtrl::InsertItemInReportView(size_t _Index) item.SetBackgroundColour(color); DiscIO::IVolume::ECountry Country = rISOFile.GetCountry(); - if (Country < m_FlagImageIndex.size()) + if (size_t(Country) < m_FlagImageIndex.size()) { item.SetImage(m_FlagImageIndex[rISOFile.GetCountry()]); }