DSPAssembler: Rename FindOpcode parameters

Having opcod and opcode as parameter names is kind of silly.
This commit is contained in:
Lioncash 2017-01-19 17:04:33 -05:00
parent 14f0e66809
commit 2b5b21f2a4
2 changed files with 13 additions and 13 deletions

View File

@ -442,29 +442,29 @@ u32 DSPAssembler::GetParams(char* parstr, param_t* par)
return count; return count;
} }
const opc_t* DSPAssembler::FindOpcode(const char* opcode, u32 par_count, const opc_t* const opcod, const opc_t* DSPAssembler::FindOpcode(const char* name, u32 par_count, const opc_t* const opcodes,
size_t opcod_size) size_t opcodes_size)
{ {
if (opcode[0] == 'C' && opcode[1] == 'W') if (name[0] == 'C' && name[1] == 'W')
return &cw; return &cw;
AliasMap::const_iterator alias_iter = aliases.find(opcode); const auto alias_iter = aliases.find(name);
if (alias_iter != aliases.end()) if (alias_iter != aliases.end())
opcode = alias_iter->second.c_str(); name = alias_iter->second.c_str();
for (size_t i = 0; i < opcod_size; i++) for (size_t i = 0; i < opcodes_size; i++)
{ {
const opc_t* opc = &opcod[i]; const opc_t* opcode = &opcodes[i];
if (strcmp(opc->name, opcode) == 0) if (strcmp(opcode->name, name) == 0)
{ {
if (par_count < opc->param_count) if (par_count < opcode->param_count)
{ {
ShowError(ERR_NOT_ENOUGH_PARAMETERS); ShowError(ERR_NOT_ENOUGH_PARAMETERS);
} }
if (par_count > opc->param_count) else if (par_count > opcode->param_count)
{ {
ShowError(ERR_TOO_MANY_PARAMETERS); ShowError(ERR_TOO_MANY_PARAMETERS);
} }
return opc; return opcode;
} }
} }
ShowError(ERR_UNKNOWN_OPCODE); ShowError(ERR_UNKNOWN_OPCODE);

View File

@ -90,8 +90,8 @@ private:
// void ShowWarning(err_t err_code, const char *extra_info = nullptr); // void ShowWarning(err_t err_code, const char *extra_info = nullptr);
char* FindBrackets(char* src, char* dst); char* FindBrackets(char* src, char* dst);
const opc_t* FindOpcode(const char* opcode, u32 par_count, const opc_t* const opcod, const opc_t* FindOpcode(const char* name, u32 par_count, const opc_t* opcodes,
size_t opcod_size); size_t opcodes_size);
bool VerifyParams(const opc_t* opc, param_t* par, size_t count, bool ext = false); 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); void BuildCode(const opc_t* opc, param_t* par, u32 par_count, u16* outbuf);