diff --git a/Common/Vulkan/VulkanMemory.cpp b/Common/Vulkan/VulkanMemory.cpp index 54c2cb6f46..4460a57492 100644 --- a/Common/Vulkan/VulkanMemory.cpp +++ b/Common/Vulkan/VulkanMemory.cpp @@ -283,9 +283,9 @@ bool VulkanDeviceAllocator::AllocateFromSlab(Slab &slab, size_t &start, size_t b int VulkanDeviceAllocator::ComputeUsagePercent() const { int blockSum = 0; int blocksUsed = 0; - for (int i = 0; i < slabs_.size(); i++) { + for (size_t i = 0; i < slabs_.size(); i++) { blockSum += (int)slabs_[i].usage.size(); - for (int j = 0; j < slabs_[i].usage.size(); j++) { + for (size_t j = 0; j < slabs_[i].usage.size(); j++) { blocksUsed += slabs_[i].usage[j] != 0 ? 1 : 0; } } diff --git a/Core/CwCheat.cpp b/Core/CwCheat.cpp index 0b14aa764a..0c39d9fe2f 100644 --- a/Core/CwCheat.cpp +++ b/Core/CwCheat.cpp @@ -351,7 +351,7 @@ std::vector CWCheatEngine::GetCodesList() { // It also goes through other "_" lines, but they all have to meet this requirement anyway // so we don't have to specify any syntax checks here that are made by cheat engine. if (line.length() >= 5 && line[0] == '_') { - for (int i = 4; i < line.length(); i++) { + for (size_t i = 4; i < line.length(); i++) { if (line[i] != ' ') { validCheatLine = true; break; diff --git a/Core/ELF/ElfReader.cpp b/Core/ELF/ElfReader.cpp index b68e7775b8..68f7531e2d 100644 --- a/Core/ELF/ElfReader.cpp +++ b/Core/ELF/ElfReader.cpp @@ -29,7 +29,7 @@ const char *ElfReader::GetSectionName(int section) const { return nullptr; int nameOffset = sections[section].sh_name; - if (nameOffset < 0 || nameOffset >= size_) { + if (nameOffset < 0 || (size_t)nameOffset >= size_) { ERROR_LOG(LOADER, "ELF: Bad name offset %d in section %d (max = %d)", nameOffset, section, (int)size_); return nullptr; } diff --git a/Core/FileSystems/BlobFileSystem.cpp b/Core/FileSystems/BlobFileSystem.cpp index b72b69ff30..b0a7639b39 100644 --- a/Core/FileSystems/BlobFileSystem.cpp +++ b/Core/FileSystems/BlobFileSystem.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017- PPSSPP Project. +// Copyright (c) 2017- PPSSPP Project. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -50,9 +50,9 @@ void BlobFileSystem::CloseFile(u32 handle) { size_t BlobFileSystem::ReadFile(u32 handle, u8 *pointer, s64 size) { auto entry = entries_.find(handle); if (entry != entries_.end()) { - size_t readSize = fileLoader_->ReadAt(entry->second, size, pointer); + s64 readSize = fileLoader_->ReadAt(entry->second, size, pointer); entry->second += readSize; - return readSize; + return (size_t)readSize; } return 0; } diff --git a/GPU/Vulkan/DebugVisVulkan.cpp b/GPU/Vulkan/DebugVisVulkan.cpp index 7bfc54bdeb..9002f82a7d 100644 --- a/GPU/Vulkan/DebugVisVulkan.cpp +++ b/GPU/Vulkan/DebugVisVulkan.cpp @@ -58,7 +58,7 @@ void DrawAllocatorVis(UIContext *ui, GPUInterface *gpu) { uint32_t *wideData = (uint32_t *)initData.data(); // Convert to nice colors. If we really wanted to save on memory, we could use a 16-bit texture... - for (int j = 0; j < usage.size(); j++) { + for (size_t j = 0; j < usage.size(); j++) { switch (usage[j]) { case 0: wideData[j] = 0xFF333333; break; case 1: wideData[j] = 0xFF33FF33; break; diff --git a/ext/native/thin3d/GLQueueRunner.cpp b/ext/native/thin3d/GLQueueRunner.cpp index c8faa9958b..e37b411e69 100644 --- a/ext/native/thin3d/GLQueueRunner.cpp +++ b/ext/native/thin3d/GLQueueRunner.cpp @@ -65,7 +65,7 @@ void GLQueueRunner::RunInitSteps(const std::vector &steps) { GLuint boundTexture = (GLuint)-1; bool allocatedTextures = false; - for (int i = 0; i < steps.size(); i++) { + for (size_t i = 0; i < steps.size(); i++) { const GLRInitStep &step = steps[i]; switch (step.stepType) { case GLRInitStepType::CREATE_TEXTURE: @@ -98,9 +98,9 @@ void GLQueueRunner::RunInitSteps(const std::vector &steps) { GLRProgram *program = step.create_program.program; program->program = glCreateProgram(); _assert_msg_(G3D, step.create_program.num_shaders > 0, "Can't create a program with zero shaders"); - for (int i = 0; i < step.create_program.num_shaders; i++) { - _dbg_assert_msg_(G3D, step.create_program.shaders[i]->shader, "Can't create a program with a null shader"); - glAttachShader(program->program, step.create_program.shaders[i]->shader); + for (int j = 0; j < step.create_program.num_shaders; j++) { + _dbg_assert_msg_(G3D, step.create_program.shaders[j]->shader, "Can't create a program with a null shader"); + glAttachShader(program->program, step.create_program.shaders[j]->shader); } for (auto iter : program->semantics_) { @@ -161,15 +161,15 @@ void GLQueueRunner::RunInitSteps(const std::vector &steps) { glUseProgram(program->program); // Query all the uniforms. - for (int i = 0; i < program->queries_.size(); i++) { - auto &x = program->queries_[i]; + for (size_t j = 0; j < program->queries_.size(); j++) { + auto &x = program->queries_[j]; assert(x.name); *x.dest = glGetUniformLocation(program->program, x.name); } // Run initializers. - for (int i = 0; i < program->initialize_.size(); i++) { - auto &init = program->initialize_[i]; + for (size_t j = 0; j < program->initialize_.size(); j++) { + auto &init = program->initialize_[j]; GLint uniform = *init.uniform; if (uniform != -1) { switch (init.type) { @@ -399,7 +399,7 @@ void GLQueueRunner::InitCreateFramebuffer(const GLRInitStep &step) { } void GLQueueRunner::RunSteps(const std::vector &steps) { - for (int i = 0; i < steps.size(); i++) { + for (size_t i = 0; i < steps.size(); i++) { const GLRStep &step = *steps[i]; switch (step.stepType) { case GLRStepType::RENDER: diff --git a/ext/native/thin3d/GLRenderManager.h b/ext/native/thin3d/GLRenderManager.h index 8b489c197d..2e50f392a5 100644 --- a/ext/native/thin3d/GLRenderManager.h +++ b/ext/native/thin3d/GLRenderManager.h @@ -267,7 +267,7 @@ public: step.create_program.program->initialize_ = initalizers; step.create_program.support_dual_source = supportDualSource; _assert_msg_(G3D, shaders.size() > 0, "Can't create a program with zero shaders"); - for (int i = 0; i < shaders.size(); i++) { + for (size_t i = 0; i < shaders.size(); i++) { step.create_program.shaders[i] = shaders[i]; } #ifdef _DEBUG diff --git a/ext/native/thin3d/VulkanQueueRunner.cpp b/ext/native/thin3d/VulkanQueueRunner.cpp index 5cd4008386..6c04fd3d30 100644 --- a/ext/native/thin3d/VulkanQueueRunner.cpp +++ b/ext/native/thin3d/VulkanQueueRunner.cpp @@ -241,7 +241,7 @@ void VulkanQueueRunner::RunSteps(VkCommandBuffer cmd, const std::vector &steps) { ILOG("======================================="); - for (int i = 0; i < steps.size(); i++) { + for (size_t i = 0; i < steps.size(); i++) { const VKRStep &step = *steps[i]; switch (step.stepType) { case VKRStepType::RENDER: