Mercurial > otakunoraifu
diff scn2k/scn2k_cmd.cc @ 43:01aa5ddf7dc8
A lot of very minor improvements (deleted some unused variables, and other things like that...)
author | thib |
---|---|
date | Tue, 24 Mar 2009 19:45:48 +0000 |
parents | d229cce98f50 |
children | a85cdca1980a |
line wrap: on
line diff
--- a/scn2k/scn2k_cmd.cc +++ b/scn2k/scn2k_cmd.cc @@ -76,7 +76,7 @@ Flags::Flags(void) { bool Flags::IsInt(int type) const { int v = type % 26; - return v >= 0 && v < 7 || v == 25; + return (v >= 0 && v < 7) || v == 25; } int Flags::MaxIndex(int type) const { @@ -372,7 +372,8 @@ bool Flags::Exec(Cmd& cmd) { string s = cmd.Str(cmd.args[1]); const char* sc = s.c_str(); int len = cmd.args[2].value; - int i;for (i=0; i<sc[i]!=0 && len != 0; i++, len--) { + int i; + for (i=0; i < sc[i] && len != 0; i++, len--) { if (sc[i]<0 && sc[i+1]!=0) i++; } s.erase(i); // 全角で len 文字まで切り詰める @@ -1066,7 +1067,6 @@ int Cmd::GetSwitch(const char*& d) { int i; for (i=0; i<argc; i++) { dprintf("\t"); if (*d++ != 0x28) {SetError(); return -1;} - int item = -1; // default if (*d != 0x29) { int item = GetExpression(d); if (*d++ != 0x29) {SetError(); return -1;} @@ -1220,7 +1220,6 @@ void Cmd::GetSelection(const char*& d) { return; } -static char* op_str3[11] = { "+=", "-=", "*=", "/=", "%=", "&=", "|=", "^=", "<<=", ">>=", "="}; void Cmd::GetCmd(Flags& flags_orig, const char*& d ) { if (d == 0) { SetError(); return;} if (cmd_type != CMD_NOP) return; @@ -1302,7 +1301,7 @@ retry: else if (cmd1 == 1 && cmd2 == 0x15 && cmd3 == 0x28) GetArgsSpecial(0, d); else if (cmd1 == 1 && cmd2 == 4 && (cmd3 == 0x26c || cmd3 == 0x26d || cmd3 == 0x270 || cmd3 == 0x276)) GetArgsSpecial(0, d); else if (cmd1 == 1 && cmd2 == 4 && cmd3 == 0x586) GetArgsSpecial(1, d); - else if (cmd1 == 1 && (cmd2 == 0x21 && cmd3 == 0x4b) || (cmd2 == 0x28 && cmd3 == 0x64)) GetArgsSpecial(2,d); + else if (cmd1 == 1 && ((cmd2 == 0x21 && cmd3 == 0x4b) || (cmd2 == 0x28 && cmd3 == 0x64))) GetArgsSpecial(2,d); else GetArgs(d); dprintf("\n"); @@ -1413,7 +1412,7 @@ int Cmd::GetString(const char*& d) { d++; } else if (quote_flag) { strheap[strend++] = *d++; - } else if (stype = StrType(d)) { + } else if ((stype = StrType(d))) { strheap[strend++] = *d++; if (stype == 2) strheap[strend++] = *d++; } else break;