Fixed shadowing of local variables.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3165 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2015-04-28 20:18:44 +00:00
parent e7fb7318fb
commit e9e3670134
2 changed files with 43 additions and 43 deletions

View File

@ -1082,10 +1082,10 @@ void EventHandler::setActionMappings(EventMode mode)
}
#ifdef JOYSTICK_SUPPORT
for(const auto& i: myJoyHandler->sticks())
for(const auto& st: myJoyHandler->sticks())
{
uInt32 stick = i.first;
const StellaJoystick* joy = i.second;
uInt32 stick = st.first;
const StellaJoystick* joy = st.second;
if(!joy) continue;
// Joystick button mapping/labeling

View File

@ -106,24 +106,24 @@ inline bool is_operator(char x)
// current base, or (if there's a base override) the selected base.
// Returns -1 on error, since negative numbers are the parser's
// responsibility, not the lexer's
int const_to_int(char *c) {
int const_to_int(char* ch) {
// what base is the input in?
Common::Base::Format format = Common::Base::format();
switch(*c) {
switch(*ch) {
case '\\':
format = Common::Base::F_2;
c++;
ch++;
break;
case '#':
format = Common::Base::F_10;
c++;
ch++;
break;
case '$':
format = Common::Base::F_16;
c++;
ch++;
break;
default: // not a base_prefix, use default base
@ -133,34 +133,34 @@ int const_to_int(char *c) {
int ret = 0;
switch(format) {
case Common::Base::F_2:
while(*c) {
if(*c != '0' && *c != '1')
while(*ch) {
if(*ch != '0' && *ch != '1')
return -1;
ret *= 2;
ret += (*c - '0');
c++;
ret += (*ch - '0');
ch++;
}
return ret;
case Common::Base::F_10:
while(*c) {
if(!isdigit(*c))
while(*ch) {
if(!isdigit(*ch))
return -1;
ret *= 10;
ret += (*c - '0');
c++;
ret += (*ch - '0');
ch++;
}
return ret;
case Common::Base::F_16:
while(*c) { // FIXME: error check!
if(!isxdigit(*c))
while(*ch) { // FIXME: error check!
if(!isxdigit(*ch))
return -1;
int dig = (*c - '0');
if(dig > 9) dig = tolower(*c) - 'a' + 10;
int dig = (*ch - '0');
if(dig > 9) dig = tolower(*ch) - 'a' + 10;
ret *= 16;
ret += dig;
c++;
ch++;
}
return ret;
@ -171,59 +171,59 @@ int const_to_int(char *c) {
}
// special methods that get e.g. CPU registers
CpuMethod getCpuSpecial(char* c)
CpuMethod getCpuSpecial(char* ch)
{
if(BSPF_equalsIgnoreCase(c, "a"))
if(BSPF_equalsIgnoreCase(ch, "a"))
return &CpuDebug::a;
else if(BSPF_equalsIgnoreCase(c, "x"))
else if(BSPF_equalsIgnoreCase(ch, "x"))
return &CpuDebug::x;
else if(BSPF_equalsIgnoreCase(c, "y"))
else if(BSPF_equalsIgnoreCase(ch, "y"))
return &CpuDebug::y;
else if(BSPF_equalsIgnoreCase(c, "pc"))
else if(BSPF_equalsIgnoreCase(ch, "pc"))
return &CpuDebug::pc;
else if(BSPF_equalsIgnoreCase(c, "sp"))
else if(BSPF_equalsIgnoreCase(ch, "sp"))
return &CpuDebug::sp;
else if(BSPF_equalsIgnoreCase(c, "c"))
else if(BSPF_equalsIgnoreCase(ch, "c"))
return &CpuDebug::c;
else if(BSPF_equalsIgnoreCase(c, "z"))
else if(BSPF_equalsIgnoreCase(ch, "z"))
return &CpuDebug::z;
else if(BSPF_equalsIgnoreCase(c, "n"))
else if(BSPF_equalsIgnoreCase(ch, "n"))
return &CpuDebug::n;
else if(BSPF_equalsIgnoreCase(c, "v"))
else if(BSPF_equalsIgnoreCase(ch, "v"))
return &CpuDebug::v;
else if(BSPF_equalsIgnoreCase(c, "d"))
else if(BSPF_equalsIgnoreCase(ch, "d"))
return &CpuDebug::d;
else if(BSPF_equalsIgnoreCase(c, "i"))
else if(BSPF_equalsIgnoreCase(ch, "i"))
return &CpuDebug::i;
else if(BSPF_equalsIgnoreCase(c, "b"))
else if(BSPF_equalsIgnoreCase(ch, "b"))
return &CpuDebug::b;
else
return 0;
}
// special methods that get Cart RAM/ROM internal state
CartMethod getCartSpecial(char* c)
CartMethod getCartSpecial(char* ch)
{
if(BSPF_equalsIgnoreCase(c, "_bank"))
if(BSPF_equalsIgnoreCase(ch, "_bank"))
return &CartDebug::getBank;
else if(BSPF_equalsIgnoreCase(c, "_rwport"))
else if(BSPF_equalsIgnoreCase(ch, "_rwport"))
return &CartDebug::readFromWritePort;
else
return 0;
}
// special methods that get TIA internal state
TiaMethod getTiaSpecial(char* c)
TiaMethod getTiaSpecial(char* ch)
{
if(BSPF_equalsIgnoreCase(c, "_scan"))
if(BSPF_equalsIgnoreCase(ch, "_scan"))
return &TIADebug::scanlines;
else if(BSPF_equalsIgnoreCase(c, "_fcount"))
else if(BSPF_equalsIgnoreCase(ch, "_fcount"))
return &TIADebug::frameCount;
else if(BSPF_equalsIgnoreCase(c, "_cclocks"))
else if(BSPF_equalsIgnoreCase(ch, "_cclocks"))
return &TIADebug::clocksThisLine;
else if(BSPF_equalsIgnoreCase(c, "_vsync"))
else if(BSPF_equalsIgnoreCase(ch, "_vsync"))
return &TIADebug::vsyncAsInt;
else if(BSPF_equalsIgnoreCase(c, "_vblank"))
else if(BSPF_equalsIgnoreCase(ch, "_vblank"))
return &TIADebug::vblankAsInt;
else
return 0;