diff --git a/Common/Vulkan/SPIRVDisasm.cpp b/Common/Vulkan/SPIRVDisasm.cpp index 4c6e78de41..4d7a24c2cb 100644 --- a/Common/Vulkan/SPIRVDisasm.cpp +++ b/Common/Vulkan/SPIRVDisasm.cpp @@ -468,7 +468,8 @@ bool DisassembleSPIRV(std::vector spirv, std::string *output) { uint32_t d = spirv[i]; int wordCount = d >> 16; int opcode = d & 0xFFFF; - const OpInfo &op = opInfo[opcode]; + // Force to a valid index in the array. + const OpInfo &op = opInfo[opcode >= (int)ARRAY_SIZE(opInfo) ? 0 : opcode]; int target = (i < (int)spirv.size() - 1) ? spirv[(i + 1)] : 0; // Not always, but used often enough that we get it here. int source, source2, resType; std::string name; diff --git a/Core/HLE/sceKernelTime.cpp b/Core/HLE/sceKernelTime.cpp index b74772df3b..c656a3f8ce 100644 --- a/Core/HLE/sceKernelTime.cpp +++ b/Core/HLE/sceKernelTime.cpp @@ -176,7 +176,7 @@ u32 sceKernelLibcGettimeofday(u32 timeAddr, u32 tzAddr) std::string KernelTimeNowFormatted() { time_t emulatedTime = (time_t)start_time + (u32)(CoreTiming::GetGlobalTimeUs() / 1000000ULL); tm* timePtr = localtime(&emulatedTime); - bool DST = timePtr->tm_isdst; + bool DST = timePtr->tm_isdst != 0; u8 seconds = timePtr->tm_sec; u8 minutes = timePtr->tm_min; u8 hours = timePtr->tm_hour; @@ -187,4 +187,4 @@ std::string KernelTimeNowFormatted() { u16 years = timePtr->tm_year + 1900; std::string timestamp = StringFromFormat("%04d-%02d-%02d_%02d-%02d-%02d", years, months, days, hours, minutes, seconds); return timestamp; -} \ No newline at end of file +} diff --git a/Core/TextureReplacer.cpp b/Core/TextureReplacer.cpp index b46f429f90..540aad3adf 100644 --- a/Core/TextureReplacer.cpp +++ b/Core/TextureReplacer.cpp @@ -171,7 +171,7 @@ void TextureReplacer::ParseHashRange(const std::string &key, const std::string & return; } - const u64 rangeKey = ((u64)addr << 32) | (fromW << 16) | fromH; + const u64 rangeKey = ((u64)addr << 32) | ((u64)fromW << 16) | fromH; hashranges_[rangeKey] = WidthHeightPair(toW, toH); } @@ -511,7 +511,7 @@ std::string TextureReplacer::HashName(u64 cachekey, u32 hash, int level) { } bool TextureReplacer::LookupHashRange(u32 addr, int &w, int &h) { - const u64 rangeKey = ((u64)addr << 32) | (w << 16) | h; + const u64 rangeKey = ((u64)addr << 32) | ((u64)w << 16) | h; auto range = hashranges_.find(rangeKey); if (range != hashranges_.end()) { const WidthHeightPair &wh = range->second; diff --git a/GPU/Common/ShaderTranslation.cpp b/GPU/Common/ShaderTranslation.cpp index 1a50efbaba..0ca126281b 100644 --- a/GPU/Common/ShaderTranslation.cpp +++ b/GPU/Common/ShaderTranslation.cpp @@ -156,7 +156,6 @@ bool ConvertToVulkanGLSL(std::string *dest, TranslatedShaderMetadata *destMetada std::string line; std::stringstream instream(src); while (std::getline(instream, line)) { - char buffer[256]; int vecSize, num; if (line.find("uniform bool") != std::string::npos) { continue; diff --git a/GPU/Common/StencilCommon.cpp b/GPU/Common/StencilCommon.cpp index b38faffb47..29af15c020 100644 --- a/GPU/Common/StencilCommon.cpp +++ b/GPU/Common/StencilCommon.cpp @@ -1,4 +1,19 @@ -#pragma once +// Copyright (c) 2014- 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 +// the Free Software Foundation, version 2.0 or later versions. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License 2.0 for more details. + +// A copy of the GPL 2.0 should have been included with the program. +// If not, see http://www.gnu.org/licenses/ + +// Official git repository and contact information can be found at +// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #include "GPU/Common/StencilCommon.h" diff --git a/ext/native/gfx_es2/draw_text_android.cpp b/ext/native/gfx_es2/draw_text_android.cpp index 922e578a6e..19dc593255 100644 --- a/ext/native/gfx_es2/draw_text_android.cpp +++ b/ext/native/gfx_es2/draw_text_android.cpp @@ -174,7 +174,7 @@ void TextDrawerAndroid::DrawString(DrawBuffer &target, const char *str, float x, entry->lastUsedFrame = frameCount_; draw_->BindTexture(0, entry->texture); } else { - double size; + double size = 0.0; auto iter = fontMap_.find(fontHash_); if (iter != fontMap_.end()) { size = iter->second.size;