From 2b5b21f2a4238cfe076ebf8618d90f04d2b67962 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 19 Jan 2017 17:04:33 -0500 Subject: [PATCH] DSPAssembler: Rename FindOpcode parameters Having opcod and opcode as parameter names is kind of silly. --- Source/Core/Core/DSP/DSPAssembler.cpp | 22 +++++++++++----------- Source/Core/Core/DSP/DSPAssembler.h | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/Core/Core/DSP/DSPAssembler.cpp b/Source/Core/Core/DSP/DSPAssembler.cpp index 01974ebd0d..820850c3fc 100644 --- a/Source/Core/Core/DSP/DSPAssembler.cpp +++ b/Source/Core/Core/DSP/DSPAssembler.cpp @@ -442,29 +442,29 @@ u32 DSPAssembler::GetParams(char* parstr, param_t* par) return count; } -const opc_t* DSPAssembler::FindOpcode(const char* opcode, u32 par_count, const opc_t* const opcod, - size_t opcod_size) +const opc_t* DSPAssembler::FindOpcode(const char* name, u32 par_count, const opc_t* const opcodes, + size_t opcodes_size) { - if (opcode[0] == 'C' && opcode[1] == 'W') + if (name[0] == 'C' && name[1] == 'W') return &cw; - AliasMap::const_iterator alias_iter = aliases.find(opcode); + const auto alias_iter = aliases.find(name); if (alias_iter != aliases.end()) - opcode = alias_iter->second.c_str(); - for (size_t i = 0; i < opcod_size; i++) + name = alias_iter->second.c_str(); + for (size_t i = 0; i < opcodes_size; i++) { - const opc_t* opc = &opcod[i]; - if (strcmp(opc->name, opcode) == 0) + const opc_t* opcode = &opcodes[i]; + if (strcmp(opcode->name, name) == 0) { - if (par_count < opc->param_count) + if (par_count < opcode->param_count) { ShowError(ERR_NOT_ENOUGH_PARAMETERS); } - if (par_count > opc->param_count) + else if (par_count > opcode->param_count) { ShowError(ERR_TOO_MANY_PARAMETERS); } - return opc; + return opcode; } } ShowError(ERR_UNKNOWN_OPCODE); diff --git a/Source/Core/Core/DSP/DSPAssembler.h b/Source/Core/Core/DSP/DSPAssembler.h index 252abae9e1..383451feea 100644 --- a/Source/Core/Core/DSP/DSPAssembler.h +++ b/Source/Core/Core/DSP/DSPAssembler.h @@ -90,8 +90,8 @@ private: // void ShowWarning(err_t err_code, const char *extra_info = nullptr); char* FindBrackets(char* src, char* dst); - const opc_t* FindOpcode(const char* opcode, u32 par_count, const opc_t* const opcod, - size_t opcod_size); + const opc_t* FindOpcode(const char* name, u32 par_count, const opc_t* opcodes, + size_t opcodes_size); bool VerifyParams(const opc_t* opc, param_t* par, size_t count, bool ext = false); void BuildCode(const opc_t* opc, param_t* par, u32 par_count, u16* outbuf);