diff --git a/Common/ArmEmitter.cpp b/Common/ArmEmitter.cpp index 00b686b3db..9e9a351abf 100644 --- a/Common/ArmEmitter.cpp +++ b/Common/ArmEmitter.cpp @@ -537,7 +537,7 @@ void ARMXEmitter::MOVI2R(ARMReg reg, u32 val, bool optimize) } } -static const char *armRegStrings[] = { +static const char *const armRegStrings[] = { "r0","r1","r2","r3", "r4","r5","r6","r7", "r8","r9","r10","r11", diff --git a/Common/GPU/OpenGL/GLFeatures.cpp b/Common/GPU/OpenGL/GLFeatures.cpp index fa3463e5d4..c069c0a641 100644 --- a/Common/GPU/OpenGL/GLFeatures.cpp +++ b/Common/GPU/OpenGL/GLFeatures.cpp @@ -646,7 +646,7 @@ void ResetGLExtensions() { g_all_egl_extensions.clear(); } -static const char *glsl_fragment_prelude = +static const char * const glsl_fragment_prelude = "#ifdef GL_ES\n" "precision mediump float;\n" "#endif\n"; diff --git a/Common/GPU/ShaderTranslation.cpp b/Common/GPU/ShaderTranslation.cpp index 0977a089f8..dc15433742 100644 --- a/Common/GPU/ShaderTranslation.cpp +++ b/Common/GPU/ShaderTranslation.cpp @@ -74,7 +74,7 @@ struct Builtin { const char *replacement; }; -static const char *cbufferDecl = R"( +static const char * const cbufferDecl = R"( cbuffer data : register(b0) { float2 u_texelDelta; float2 u_pixelDelta; @@ -85,13 +85,13 @@ cbuffer data : register(b0) { }; )"; -static const char *vulkanPrologue = +static const char * const vulkanPrologue = R"(#version 450 #extension GL_ARB_separate_shader_objects : enable #extension GL_ARB_shading_language_420pack : enable )"; -static const char *vulkanUboDecl = R"( +static const char * const vulkanUboDecl = R"( layout (std140, set = 0, binding = 0) uniform Data { vec2 u_texelDelta; vec2 u_pixelDelta; @@ -102,7 +102,7 @@ layout (std140, set = 0, binding = 0) uniform Data { }; )"; -static const char *d3d9RegisterDecl = R"( +static const char * const d3d9RegisterDecl = R"( float4 gl_HalfPixel : register(c0); float2 u_texelDelta : register(c1); float2 u_pixelDelta : register(c2); diff --git a/Common/GPU/Vulkan/VulkanContext.cpp b/Common/GPU/Vulkan/VulkanContext.cpp index f3bc37dfd9..6fdb98c045 100644 --- a/Common/GPU/Vulkan/VulkanContext.cpp +++ b/Common/GPU/Vulkan/VulkanContext.cpp @@ -35,7 +35,7 @@ using namespace PPSSPP_VK; VulkanLogOptions g_LogOptions; -static const char *validationLayers[] = { +static const char * const validationLayers[] = { "VK_LAYER_KHRONOS_validation", /* // For layers included in the Android NDK. diff --git a/Common/GPU/Vulkan/VulkanFramebuffer.cpp b/Common/GPU/Vulkan/VulkanFramebuffer.cpp index 3f77f24efe..aceb2db6e1 100644 --- a/Common/GPU/Vulkan/VulkanFramebuffer.cpp +++ b/Common/GPU/Vulkan/VulkanFramebuffer.cpp @@ -2,7 +2,7 @@ #include "Common/GPU/Vulkan/VulkanFramebuffer.h" #include "Common/GPU/Vulkan/VulkanQueueRunner.h" -static const char *rpTypeDebugNames[] = { +static const char * const rpTypeDebugNames[] = { "RENDER", "RENDER_DEPTH", "MV_RENDER", diff --git a/Common/GPU/Vulkan/VulkanLoader.cpp b/Common/GPU/Vulkan/VulkanLoader.cpp index e950e63329..aaac2c037f 100644 --- a/Common/GPU/Vulkan/VulkanLoader.cpp +++ b/Common/GPU/Vulkan/VulkanLoader.cpp @@ -268,13 +268,13 @@ bool g_vulkanMayBeAvailable = false; #define LOAD_GLOBAL_FUNC_LOCAL(lib, x) (PFN_ ## x)dlsym(lib, #x); -static const char *device_name_blacklist[] = { +static const char * const device_name_blacklist[] = { "NVIDIA:SHIELD Tablet K1", "SDL:Horizon", }; #ifndef _WIN32 -static const char *so_names[] = { +static const char * const so_names[] = { #if PPSSPP_PLATFORM(IOS) "@executable_path/Frameworks/libMoltenVK.dylib", #elif PPSSPP_PLATFORM(MAC) diff --git a/Common/LogManager.cpp b/Common/LogManager.cpp index d7fac46d39..cc3c6bf884 100644 --- a/Common/LogManager.cpp +++ b/Common/LogManager.cpp @@ -78,7 +78,7 @@ bool GenericLogEnabled(LogLevel level, LogType type) { LogManager *LogManager::logManager_ = NULL; // NOTE: Needs to be kept in sync with the LogType enum. -static const char *g_logTypeNames[] = { +static const char * const g_logTypeNames[] = { "SYSTEM", "BOOT", "COMMON", diff --git a/Common/LoongArchCPUDetect.cpp b/Common/LoongArchCPUDetect.cpp index 64f4acd9a0..3c003c986e 100644 --- a/Common/LoongArchCPUDetect.cpp +++ b/Common/LoongArchCPUDetect.cpp @@ -73,7 +73,7 @@ LoongArchCPUInfoParser::LoongArchCPUInfoParser() { } int LoongArchCPUInfoParser::ProcessorCount() { - static const char *marker = "core"; + static const char * const marker = "core"; std::set coreIndex; for (auto core : cores_) { for (auto line : core) { diff --git a/Common/Net/URL.cpp b/Common/Net/URL.cpp index 0fdeab107c..43e297128a 100644 --- a/Common/Net/URL.cpp +++ b/Common/Net/URL.cpp @@ -2,11 +2,35 @@ #include "Common/StringUtils.h" #include "Common/Net/URL.h" -const char *UrlEncoder::unreservedChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.~"; -const char *UrlEncoder::hexChars = "0123456789ABCDEF"; - int MultipartFormDataEncoder::seq = 0; +void UrlEncoder::AppendEscaped(const std::string &value) +{ + static const char * const unreservedChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.~"; + static const char * const hexChars = "0123456789ABCDEF"; + + for (size_t lastEnd = 0; lastEnd < value.length(); ) + { + size_t pos = value.find_first_not_of(unreservedChars, lastEnd); + if (pos == value.npos) + { + data += value.substr(lastEnd); + break; + } + + if (pos != lastEnd) + data += value.substr(lastEnd, pos - lastEnd); + lastEnd = pos; + + // Encode the reserved character. + char c = value[pos]; + data += '%'; + data += hexChars[(c >> 4) & 15]; + data += hexChars[(c >> 0) & 15]; + ++lastEnd; + } +} + void Url::Split() { size_t colonSlashSlash = url_.find("://"); if (colonSlashSlash == std::string::npos) { diff --git a/Common/Net/URL.h b/Common/Net/URL.h index b6288eaa6c..1a03d397a8 100644 --- a/Common/Net/URL.h +++ b/Common/Net/URL.h @@ -86,34 +86,10 @@ protected: } // Percent encoding, aka application/x-www-form-urlencoded. - void AppendEscaped(const std::string &value) - { - for (size_t lastEnd = 0; lastEnd < value.length(); ) - { - size_t pos = value.find_first_not_of(unreservedChars, lastEnd); - if (pos == value.npos) - { - data += value.substr(lastEnd); - break; - } - - if (pos != lastEnd) - data += value.substr(lastEnd, pos - lastEnd); - lastEnd = pos; - - // Encode the reserved character. - char c = value[pos]; - data += '%'; - data += hexChars[(c >> 4) & 15]; - data += hexChars[(c >> 0) & 15]; - ++lastEnd; - } - } + void AppendEscaped(const std::string &value); std::string data; int paramCount; - static const char *unreservedChars; - static const char *hexChars; }; diff --git a/Common/RiscVCPUDetect.cpp b/Common/RiscVCPUDetect.cpp index 5f18db8cd9..c2f4de908b 100644 --- a/Common/RiscVCPUDetect.cpp +++ b/Common/RiscVCPUDetect.cpp @@ -80,7 +80,7 @@ RiscVCPUInfoParser::RiscVCPUInfoParser() { int RiscVCPUInfoParser::ProcessorCount() { // Not using present as that counts the logical CPUs (aka harts.) - static const char *marker = "processor\t: "; + static const char * const marker = "processor\t: "; std::set processors; for (auto core : cores_) { for (auto line : core) { @@ -107,7 +107,7 @@ int RiscVCPUInfoParser::TotalLogicalCount() { return high - low + 1; } - static const char *marker = "hart\t\t: "; + static const char * const marker = "hart\t\t: "; std::set harts; for (auto core : cores_) { for (auto line : core) { @@ -120,7 +120,7 @@ int RiscVCPUInfoParser::TotalLogicalCount() { } std::string RiscVCPUInfoParser::ISAString() { - static const char *marker = "isa\t\t: "; + static const char * const marker = "isa\t\t: "; for (auto core : cores_) { for (auto line : core) { if (line.find(marker) != line.npos) diff --git a/Core/Config.cpp b/Core/Config.cpp index 13eff5b16e..27f6a0cf25 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -76,9 +76,9 @@ struct ConfigPrivate { }; #ifdef _DEBUG -static const char *logSectionName = "LogDebug"; +static const char * const logSectionName = "LogDebug"; #else -static const char *logSectionName = "Log"; +static const char * const logSectionName = "Log"; #endif std::string GPUBackendToString(GPUBackend backend) { diff --git a/Core/Dialog/SavedataParam.cpp b/Core/Dialog/SavedataParam.cpp index 024a2584b1..fc944483ee 100644 --- a/Core/Dialog/SavedataParam.cpp +++ b/Core/Dialog/SavedataParam.cpp @@ -1092,7 +1092,7 @@ int SavedataParam::BuildHash(unsigned char *output, std::string SavedataParam::GetSpaceText(u64 size, bool roundUp) { char text[50]; - static const char *suffixes[] = {"B", "KB", "MB", "GB"}; + static const char * const suffixes[] = {"B", "KB", "MB", "GB"}; for (size_t i = 0; i < ARRAY_SIZE(suffixes); ++i) { if (size < 1024) diff --git a/Core/FileLoaders/DiskCachingFileLoader.cpp b/Core/FileLoaders/DiskCachingFileLoader.cpp index dee0d5a70a..74df741201 100644 --- a/Core/FileLoaders/DiskCachingFileLoader.cpp +++ b/Core/FileLoaders/DiskCachingFileLoader.cpp @@ -42,7 +42,7 @@ #define fseeko fseek #endif -static const char *CACHEFILE_MAGIC = "ppssppDC"; +static const char * const CACHEFILE_MAGIC = "ppssppDC"; static const s64 SAFETY_FREE_DISK_SPACE = 768 * 1024 * 1024; // 768 MB // Aim to allow this many files cached at once. static const u32 CACHE_SPACE_FLEX = 4; diff --git a/Core/FileSystems/DirectoryFileSystem.cpp b/Core/FileSystems/DirectoryFileSystem.cpp index 7695653c03..74b36632ef 100644 --- a/Core/FileSystems/DirectoryFileSystem.cpp +++ b/Core/FileSystems/DirectoryFileSystem.cpp @@ -737,9 +737,9 @@ static void tmFromFiletime(tm &dest, const FILETIME &src) { // Hopefully no PSP games read directories after they create files in them... static std::string SimulateVFATBug(std::string filename) { // These are the characters allowed in DOS filenames. - static const char *FAT_UPPER_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&'(){}-_`~"; - static const char *FAT_LOWER_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&'(){}-_`~"; - static const char *LOWER_CHARS = "abcdefghijklmnopqrstuvwxyz"; + static const char * const FAT_UPPER_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&'(){}-_`~"; + static const char * const FAT_LOWER_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&'(){}-_`~"; + static const char * const LOWER_CHARS = "abcdefghijklmnopqrstuvwxyz"; // To avoid logging/comparing, skip all this if it has no lowercase chars to begin with. size_t lowerchar = filename.find_first_of(LOWER_CHARS); diff --git a/Core/MIPS/IR/IRInst.cpp b/Core/MIPS/IR/IRInst.cpp index 64d1497d5e..376f9951b2 100644 --- a/Core/MIPS/IR/IRInst.cpp +++ b/Core/MIPS/IR/IRInst.cpp @@ -234,7 +234,7 @@ static std::string GetGPRName(int r) { } void DisassembleParam(char *buf, int bufSize, u8 param, char type, u32 constant) { - static const char *vfpuCtrlNames[VFPU_CTRL_MAX] = { + static const char * const vfpuCtrlNames[VFPU_CTRL_MAX] = { "SPFX", "TPFX", "DPFX", @@ -252,7 +252,7 @@ void DisassembleParam(char *buf, int bufSize, u8 param, char type, u32 constant) "RCX6", "RCX7", }; - static const char *initVec4Names[8] = { + static const char * const initVec4Names[8] = { "[0 0 0 0]", "[1 1 1 1]", "[-1 -1 -1 -1]", @@ -261,7 +261,7 @@ void DisassembleParam(char *buf, int bufSize, u8 param, char type, u32 constant) "[0 0 1 0]", "[0 0 0 1]", }; - static const char *xyzw = "xyzw"; + static const char * const xyzw = "xyzw"; switch (type) { case 'G': diff --git a/Core/MIPS/MIPSDebugInterface.cpp b/Core/MIPS/MIPSDebugInterface.cpp index 747a9a5083..7118f09aac 100644 --- a/Core/MIPS/MIPSDebugInterface.cpp +++ b/Core/MIPS/MIPSDebugInterface.cpp @@ -263,7 +263,7 @@ const char *MIPSDebugInterface::GetName() } std::string MIPSDebugInterface::GetRegName(int cat, int index) { - static const char *regName[32] = { + static const char * const regName[32] = { "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", "t0", "t1", "t2", "t3", @@ -273,7 +273,7 @@ std::string MIPSDebugInterface::GetRegName(int cat, int index) { "t8", "t9", "k0", "k1", "gp", "sp", "fp", "ra" }; - static const char *fpRegName[32] = { + static const char * const fpRegName[32] = { "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", "f16", "f16", "f18", "f19", "f20", "f21", "f22", "f23", diff --git a/Core/MIPS/MIPSDisVFPU.cpp b/Core/MIPS/MIPSDisVFPU.cpp index b3116a8b48..24b998d33f 100644 --- a/Core/MIPS/MIPSDisVFPU.cpp +++ b/Core/MIPS/MIPSDisVFPU.cpp @@ -49,7 +49,7 @@ #define MtxOff 4 inline std::string VNStr(int v, VectorSize size) { - static const char *vfpuCtrlNames[VFPU_CTRL_MAX] = { + static const char * const vfpuCtrlNames[VFPU_CTRL_MAX] = { "SPFX", "TPFX", "DPFX", @@ -156,8 +156,8 @@ namespace MIPSDis const char *name = MIPSGetName(op); size_t outpos = snprintf(out, outSize, "%s\t[", name); - static const char *regnam[4] = {"X","Y","Z","W"}; - static const char *constan[8] = {"0","1","2","1/2","3","1/3","1/4","1/6"}; + static const char * const regnam[4] = {"X","Y","Z","W"}; + static const char * const constan[8] = {"0","1","2","1/2","3","1/3","1/4","1/6"}; for (int i=0; i<4; i++) { int regnum = (data>>(i*2)) & 3; @@ -192,7 +192,7 @@ namespace MIPSDis const char *name = MIPSGetName(op); size_t outpos = snprintf(out, outSize, "%s\t[", name); - static const char *satNames[4] = {"", "0:1", "X", "-1:1"}; + static const char * const satNames[4] = {"", "0:1", "X", "-1:1"}; for (int i=0; i<4; i++) { int sat = (data>>i*2)&3; @@ -228,7 +228,7 @@ namespace MIPSDis int conNum = (op>>16) & 0x1f; int vd = _VD; VectorSize sz = GetVecSize(op); - static const char *constants[32] = + static const char * const constants[32] = { "(undef)", "MaxFloat", diff --git a/Core/MIPS/MIPSTables.cpp b/Core/MIPS/MIPSTables.cpp index 825c2d24d7..4b909c2d03 100644 --- a/Core/MIPS/MIPSTables.cpp +++ b/Core/MIPS/MIPSTables.cpp @@ -1064,7 +1064,7 @@ int MIPSInterpret_RunUntil(u64 globalTicks) { const char *MIPSGetName(MIPSOpcode op) { - static const char *noname = "unk"; + static const char * const noname = "unk"; const MIPSInstruction *instr = MIPSGetInstruction(op); if (!instr) return noname; diff --git a/Core/PSPLoaders.cpp b/Core/PSPLoaders.cpp index d07368bac2..e3ac345d84 100644 --- a/Core/PSPLoaders.cpp +++ b/Core/PSPLoaders.cpp @@ -218,7 +218,7 @@ void InitMemoryForGamePBP(FileLoader *fileLoader) { // that probably loads a plugin and then launches the actual game. These stubs don't work in PPSSPP. // No idea why they are doing this, but it works to just bypass it. They could stop // inventing new filenames though... -static const char *altBootNames[] = { +static const char * const altBootNames[] = { "disc0:/PSP_GAME/SYSDIR/EBOOT.OLD", "disc0:/PSP_GAME/SYSDIR/EBOOT.DAT", "disc0:/PSP_GAME/SYSDIR/EBOOT.BI", diff --git a/Core/Replay.cpp b/Core/Replay.cpp index 4a8c26a642..4b375c45ef 100644 --- a/Core/Replay.cpp +++ b/Core/Replay.cpp @@ -57,7 +57,7 @@ enum class ReplayState { // File data formats below. #pragma pack(push, 1) -static const char *REPLAY_MAGIC = "PPREPLAY"; +static const char * const REPLAY_MAGIC = "PPREPLAY"; static const int REPLAY_VERSION_MIN = 1; static const int REPLAY_VERSION_CURRENT = 1; diff --git a/Core/RetroAchievements.cpp b/Core/RetroAchievements.cpp index 20d8b40201..af382742ba 100644 --- a/Core/RetroAchievements.cpp +++ b/Core/RetroAchievements.cpp @@ -64,7 +64,7 @@ void OnAchievementsLoginStateChange() { namespace Achievements { // It's the name of the secret, not a secret name - the value is not secret :) -static const char *RA_TOKEN_SECRET_NAME = "retroachievements"; +static const char * const RA_TOKEN_SECRET_NAME = "retroachievements"; static Achievements::Statistics g_stats; diff --git a/Core/SaveState.h b/Core/SaveState.h index d7bd484c5b..069a1052ef 100644 --- a/Core/SaveState.h +++ b/Core/SaveState.h @@ -34,12 +34,12 @@ namespace SaveState typedef std::function Callback; static const int NUM_SLOTS = 5; - static const char *STATE_EXTENSION = "ppst"; - static const char *SCREENSHOT_EXTENSION = "jpg"; - static const char *UNDO_STATE_EXTENSION = "undo.ppst"; - static const char *UNDO_SCREENSHOT_EXTENSION = "undo.jpg"; + static const char * const STATE_EXTENSION = "ppst"; + static const char * const SCREENSHOT_EXTENSION = "jpg"; + static const char * const UNDO_STATE_EXTENSION = "undo.ppst"; + static const char * const UNDO_SCREENSHOT_EXTENSION = "undo.jpg"; - static const char *LOAD_UNDO_NAME = "load_undo.ppst"; + static const char * const LOAD_UNDO_NAME = "load_undo.ppst"; void Init(); void Shutdown(); diff --git a/GPU/Common/DepthBufferCommon.cpp b/GPU/Common/DepthBufferCommon.cpp index a52a9e3859..ebc936c10a 100644 --- a/GPU/Common/DepthBufferCommon.cpp +++ b/GPU/Common/DepthBufferCommon.cpp @@ -76,7 +76,7 @@ void GenerateDepthDownloadVs(ShaderWriter &writer) { writer.EndVSMain(varyings); } -static const char *stencil_dl_fs = R"( +static const char * const stencil_dl_fs = R"( #ifdef GL_ES #ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; @@ -99,7 +99,7 @@ void main() { } )"; -static const char *stencil_vs = R"( +static const char * const stencil_vs = R"( #ifdef GL_ES precision highp float; #endif diff --git a/GPU/Common/VertexDecoderCommon.cpp b/GPU/Common/VertexDecoderCommon.cpp index 64f85788b4..bef8e6f8c4 100644 --- a/GPU/Common/VertexDecoderCommon.cpp +++ b/GPU/Common/VertexDecoderCommon.cpp @@ -1449,12 +1449,12 @@ void VertexDecoder::CompareToJit(const u8 *startPtr, u8 *decodedptr, int count, } } -static const char *posnames[4] = { "?", "s8", "s16", "f" }; -static const char *nrmnames[4] = { "", "s8", "s16", "f" }; -static const char *tcnames[4] = { "", "u8", "u16", "f" }; -static const char *idxnames[4] = { "-", "u8", "u16", "?" }; -static const char *weightnames[4] = { "-", "u8", "u16", "f" }; -static const char *colnames[8] = { "", "?", "?", "?", "565", "5551", "4444", "8888" }; +static const char * const posnames[4] = { "?", "s8", "s16", "f" }; +static const char * const nrmnames[4] = { "", "s8", "s16", "f" }; +static const char * const tcnames[4] = { "", "u8", "u16", "f" }; +static const char * const idxnames[4] = { "-", "u8", "u16", "?" }; +static const char * const weightnames[4] = { "-", "u8", "u16", "f" }; +static const char * const colnames[8] = { "", "?", "?", "?", "565", "5551", "4444", "8888" }; int VertexDecoder::ToString(char *output, bool spaces) const { char *start = output; diff --git a/GPU/Common/VertexShaderGenerator.cpp b/GPU/Common/VertexShaderGenerator.cpp index b1b9fa5e16..674ff0cef2 100644 --- a/GPU/Common/VertexShaderGenerator.cpp +++ b/GPU/Common/VertexShaderGenerator.cpp @@ -887,7 +887,7 @@ bool GenerateVertexShader(const VShaderID &id, char *buffer, const ShaderLanguag WRITE(p, " mediump vec3 worldnormal = normalizeOr001(mul(vec4(0.0, 0.0, %s1.0, 0.0), u_world).xyz);\n", flipNormal ? "-" : ""); } } else { - static const char *rescale[4] = {"", " * 1.9921875", " * 1.999969482421875", ""}; // 2*127.5f/128.f, 2*32767.5f/32768.f, 1.0f}; + static const char * const rescale[4] = {"", " * 1.9921875", " * 1.999969482421875", ""}; // 2*127.5f/128.f, 2*32767.5f/32768.f, 1.0f}; const char *factor = rescale[boneWeightScale]; static const char * const boneWeightAttr[8] = { diff --git a/GPU/Debugger/RecordFormat.h b/GPU/Debugger/RecordFormat.h index 295273eb0f..57aaa04b21 100644 --- a/GPU/Debugger/RecordFormat.h +++ b/GPU/Debugger/RecordFormat.h @@ -28,7 +28,7 @@ struct Header { uint8_t pad[3]; }; -static const char *HEADER_MAGIC = "PPSSPPGE"; +static const char * const HEADER_MAGIC = "PPSSPPGE"; // Version 1: Uncompressed // Version 2: Uses snappy // Version 3: Adds FRAMEBUF0-FRAMEBUF9 diff --git a/GPU/GLES/StencilBufferGLES.cpp b/GPU/GLES/StencilBufferGLES.cpp index 845cd2b3ac..cb045691fc 100644 --- a/GPU/GLES/StencilBufferGLES.cpp +++ b/GPU/GLES/StencilBufferGLES.cpp @@ -56,7 +56,7 @@ static const VaryingDef varyings[] = { { "vec2", "v_texcoord", Draw::SEM_TEXCOORD0, 0, "highp" }, }; -static const char *stencil_dl_fs = R"( +static const char * const stencil_dl_fs = R"( #ifdef GL_ES #ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; @@ -79,7 +79,7 @@ void main() { } )"; -static const char *stencil_vs = R"( +static const char * const stencil_vs = R"( #ifdef GL_ES precision highp float; #endif diff --git a/GPU/GeDisasm.cpp b/GPU/GeDisasm.cpp index af8131958b..a5ecee595e 100644 --- a/GPU/GeDisasm.cpp +++ b/GPU/GeDisasm.cpp @@ -34,7 +34,7 @@ void GeDescribeVertexType(u32 op, char *buffer, int len) { int morphCount = (op & GE_VTYPE_MORPHCOUNT_MASK) >> GE_VTYPE_MORPHCOUNT_SHIFT; int idx = (op & GE_VTYPE_IDX_MASK) >> GE_VTYPE_IDX_SHIFT; - static const char *colorNames[] = { + static const char * const colorNames[] = { NULL, "unsupported1", "unsupported2", @@ -44,19 +44,19 @@ void GeDescribeVertexType(u32 op, char *buffer, int len) { "ABGR 4444", "ABGR 8888", }; - static const char *typeNames[] = { + static const char * const typeNames[] = { NULL, "u8", "u16", "float", }; - static const char *typeNamesI[] = { + static const char * const typeNamesI[] = { NULL, "u8", "u16", "u32", }; - static const char *typeNamesS[] = { + static const char * const typeNamesS[] = { NULL, "s8", "s16", @@ -474,13 +474,13 @@ void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *buffer, int bufsize) { case GE_CMD_TEXMAPMODE: { - static const char *uvgen[] = { + static const char * const uvgen[] = { "texcoords", "texgen matrix", "env map", "invalid" }; - static const char *uvproj[] = { + static const char * const uvproj[] = { "pos", "uv", "normalized normal", @@ -1006,7 +1006,7 @@ void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *buffer, int bufsize) { case GE_CMD_TEXFUNC: { - const char *texfuncs[] = { + const char * const texfuncs[] = { "modulate", "decal", "blend", @@ -1025,7 +1025,7 @@ void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *buffer, int bufsize) { case GE_CMD_TEXFILTER: { - static const char *textureFilters[] = { + static const char * const textureFilters[] = { "nearest", "linear", "nearest, invalid", @@ -1057,7 +1057,7 @@ void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *buffer, int bufsize) { case GE_CMD_TEXFORMAT: { - static const char *texformats[] = { + static const char * const texformats[] = { "5650", "5551", "4444", @@ -1105,7 +1105,7 @@ void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *buffer, int bufsize) { case GE_CMD_TEXLEVEL: { - static const char *mipLevelModes[] = { + static const char * const mipLevelModes[] = { "auto + bias", "bias", "slope + bias", @@ -1149,14 +1149,14 @@ void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *buffer, int bufsize) { case GE_CMD_STENCILOP: { - static const char *stencilOps[] = { "KEEP", "ZERO", "REPLACE", "INVERT", "INCREMENT", "DECREMENT", "unsupported1", "unsupported2" }; + static const char * const stencilOps[] = { "KEEP", "ZERO", "REPLACE", "INVERT", "INCREMENT", "DECREMENT", "unsupported1", "unsupported2" }; snprintf(buffer, bufsize, "Stencil op: fail=%s, pass/depthfail=%s, pass=%s", stencilOps[data & 7], stencilOps[(data >> 8) & 7], stencilOps[(data >> 16) & 7]); } break; case GE_CMD_STENCILTEST: { - static const char *zTestFuncs[] = { " NEVER ", " ALWAYS ", " == ", " != ", " < ", " <= ", " > ", " >= " }; + static const char * const zTestFuncs[] = { " NEVER ", " ALWAYS ", " == ", " != ", " < ", " <= ", " > ", " >= " }; if (data & ~0xFFFF07) snprintf(buffer, bufsize, "Stencil test: %02x%s(dst.a & %02x) (extra %06x)", (data >> 8) & 0xFF, zTestFuncs[data & 7], (data >> 16) & 0xFF, data & ~0xFFFF07); else @@ -1170,7 +1170,7 @@ void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *buffer, int bufsize) { case GE_CMD_ZTEST: { - static const char *zTestFuncs[] = { "NEVER", "ALWAYS", "==", "!=", "<", "<=", ">", ">=" }; + static const char * const zTestFuncs[] = { "NEVER", "ALWAYS", "==", "!=", "<", "<=", ">", ">=" }; if (data & ~7) snprintf(buffer, bufsize, "Z test mode: %s (extra %06x)", zTestFuncs[data & 7], data & ~7); else @@ -1202,7 +1202,7 @@ void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *buffer, int bufsize) { case GE_CMD_LOGICOP: { - const char *logicOps[] = { + const char * const logicOps[] = { "clear", "and", "reverse and", diff --git a/ios/iCade/iCadeReaderView.m b/ios/iCade/iCadeReaderView.m index cd0e94fa59..f4cd28bbed 100755 --- a/ios/iCade/iCadeReaderView.m +++ b/ios/iCade/iCadeReaderView.m @@ -22,8 +22,8 @@ #import "iCadeReaderView.h" -static const char *ON_STATES = "wdxayhujikol"; -static const char *OFF_STATES = "eczqtrfnmpgv"; +static const char * const ON_STATES = "wdxayhujikol"; +static const char * const OFF_STATES = "eczqtrfnmpgv"; @interface iCadeReaderView()