From 04b99e3503e367329aa57afca609b851e903c713 Mon Sep 17 00:00:00 2001 From: stephena Date: Sat, 20 Dec 2014 22:59:43 +0000 Subject: [PATCH] Fixed some shadowed variable warnings detected by Xcode. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3111 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- src/common/MouseControl.hxx | 12 ++++++------ src/debugger/CartDebug.cxx | 8 ++++---- src/debugger/DebuggerParser.cxx | 4 ++-- src/debugger/DiStella.cxx | 4 ++-- src/emucore/EventHandler.cxx | 4 ++-- src/emucore/EventJoyHandler.cxx | 16 ++++++++-------- src/gui/CommandDialog.cxx | 4 ++-- src/gui/Dialog.cxx | 4 ++-- src/gui/OptionsDialog.cxx | 4 ++-- src/macosx/Info-Stella.plist | 4 +--- src/macosx/stella.xcodeproj/project.pbxproj | 2 +- 11 files changed, 32 insertions(+), 34 deletions(-) diff --git a/src/common/MouseControl.hxx b/src/common/MouseControl.hxx index cd2a07036..cdf3be140 100644 --- a/src/common/MouseControl.hxx +++ b/src/common/MouseControl.hxx @@ -88,13 +88,13 @@ class MouseControl xid(-1), yid(-1), message(msg) { } - MouseMode(Controller::Type xtype, int xid, - Controller::Type ytype, int yid, + MouseMode(Controller::Type xt, int xi, + Controller::Type yt, int yi, const string& msg) - : xtype(xtype), - ytype(ytype), - xid(xid), - yid(yid), + : xtype(xt), + ytype(yt), + xid(xi), + yid(yi), message(msg) { } friend ostream& operator<<(ostream& os, const MouseMode& mm) diff --git a/src/debugger/CartDebug.cxx b/src/debugger/CartDebug.cxx index 6dbd75b9b..c64d83ccf 100644 --- a/src/debugger/CartDebug.cxx +++ b/src/debugger/CartDebug.cxx @@ -1036,8 +1036,8 @@ string CartDebug::saveDisassembly() { buf << ".byte " << (settings.gfx_format == Base::F_2 ? "%" : "$") << tag.bytes << " ; |"; - for(int i = 12; i < 20; ++i) - buf << ((tag.disasm[i] == '\x1e') ? "#" : " "); + for(int c = 12; c < 20; ++c) + buf << ((tag.disasm[c] == '\x1e') ? "#" : " "); buf << "| $" << Base::HEX4 << tag.address << " (G)\n"; break; } @@ -1045,8 +1045,8 @@ string CartDebug::saveDisassembly() { buf << ".byte " << (settings.gfx_format == Base::F_2 ? "%" : "$") << tag.bytes << " ; |"; - for(int i = 12; i < 20; ++i) - buf << ((tag.disasm[i] == '\x1f') ? "*" : " "); + for(int c = 12; c < 20; ++c) + buf << ((tag.disasm[c] == '\x1f') ? "*" : " "); buf << "| $" << Base::HEX4 << tag.address << " (P)\n"; break; } diff --git a/src/debugger/DebuggerParser.cxx b/src/debugger/DebuggerParser.cxx index 49aad0678..2cd9eee0e 100644 --- a/src/debugger/DebuggerParser.cxx +++ b/src/debugger/DebuggerParser.cxx @@ -392,9 +392,9 @@ bool DebuggerParser::getArgs(const string& command, string& verb) } */ - for(int i = 0; i < argCount; i++) + for(int arg = 0; arg < argCount; ++arg) { - if(!YaccParser::parse(argStrings[i].c_str())) + if(!YaccParser::parse(argStrings[arg].c_str())) { unique_ptr expr(YaccParser::getResult()); args.push_back(expr->evaluate()); diff --git a/src/debugger/DiStella.cxx b/src/debugger/DiStella.cxx index 58d894547..5d2844cf9 100644 --- a/src/debugger/DiStella.cxx +++ b/src/debugger/DiStella.cxx @@ -24,12 +24,12 @@ using namespace Common; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list, - CartDebug::BankInfo& info, const DiStella::Settings& settings, + CartDebug::BankInfo& info, const DiStella::Settings& s, uInt8* labels, uInt8* directives, CartDebug::ReservedEquates& reserved) : myDbg(dbg), myList(list), - mySettings(settings), + mySettings(s), myReserved(reserved), myLabels(labels), myDirectives(directives) diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index 1efca5a4d..b8466941b 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -1196,10 +1196,10 @@ void EventHandler::setKeymap() if(event == Event::LastType && map.size() == KBDK_LAST * kNumModes) { // Fill the keymap table with events - auto event = map.begin(); + auto e = map.begin(); for(int mode = 0; mode < kNumModes; ++mode) for(int i = 0; i < KBDK_LAST; ++i) - myKeyTable[i][mode] = (Event::Type) *event++; + myKeyTable[i][mode] = (Event::Type) *e++; } else { diff --git a/src/emucore/EventJoyHandler.cxx b/src/emucore/EventJoyHandler.cxx index 2c434972f..bafa94016 100644 --- a/src/emucore/EventJoyHandler.cxx +++ b/src/emucore/EventJoyHandler.cxx @@ -121,9 +121,9 @@ string EventHandler::StellaJoystick::getMap() const } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool EventHandler::StellaJoystick::setMap(const string& m) +bool EventHandler::StellaJoystick::setMap(const string& mapString) { - istringstream buf(m); + istringstream buf(mapString); StringList items; string item; while(getline(buf, item, '|')) @@ -445,20 +445,20 @@ void EventHandler::JoystickHandler::setStickDefaultMapping(int stick, EventHandler& handler = myOSystem.eventHandler(); bool eraseAll = (event == Event::NoType); - auto setDefaultAxis = [&](int stick, int axis, int value, Event::Type a_event) + auto setDefaultAxis = [&](int a_stick, int a_axis, int a_value, Event::Type a_event) { if(eraseAll || a_event == event) - handler.addJoyAxisMapping(a_event, mode, stick, axis, value, false); + handler.addJoyAxisMapping(a_event, mode, a_stick, a_axis, a_value, false); }; - auto setDefaultBtn = [&](int stick, int button, Event::Type b_event) + auto setDefaultBtn = [&](int b_stick, int b_button, Event::Type b_event) { if(eraseAll || b_event == event) - handler.addJoyButtonMapping(b_event, mode, stick, button, false); + handler.addJoyButtonMapping(b_event, mode, b_stick, b_button, false); }; - auto setDefaultHat = [&](int stick, int hat, int dir, Event::Type h_event) + auto setDefaultHat = [&](int h_stick, int h_hat, int h_dir, Event::Type h_event) { if(eraseAll || h_event == event) - handler.addJoyHatMapping(h_event, mode, stick, hat, dir, false); + handler.addJoyHatMapping(h_event, mode, h_stick, h_hat, h_dir, false); }; switch(mode) diff --git a/src/gui/CommandDialog.cxx b/src/gui/CommandDialog.cxx index abef658d8..44a6876bc 100644 --- a/src/gui/CommandDialog.cxx +++ b/src/gui/CommandDialog.cxx @@ -46,10 +46,10 @@ CommandDialog::CommandDialog(OSystem& osystem, DialogContainer& parent) auto ADD_CD_BUTTON = [&](const string& label, int cmd) { - ButtonWidget* b = new ButtonWidget(this, font, xoffset, yoffset, + ButtonWidget* bw = new ButtonWidget(this, font, xoffset, yoffset, buttonWidth, buttonHeight, label, cmd); xoffset += buttonWidth + 6; - return b; + return bw; }; // Row 1 diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx index a7a119976..479a95dc0 100644 --- a/src/gui/Dialog.cxx +++ b/src/gui/Dialog.cxx @@ -165,8 +165,8 @@ void Dialog::addToFocusList(WidgetArray& list, TabWidget* w, int tabId) assert(w == _myTabList[w->getID()].widget); // All focusable widgets should retain focus - for(const auto& w: list) - w->setFlags(WIDGET_RETAIN_FOCUS); + for(const auto& fw: list) + fw->setFlags(WIDGET_RETAIN_FOCUS); // First get the appropriate focus list FocusList& focus = _myTabList[w->getID()].focus; diff --git a/src/gui/OptionsDialog.cxx b/src/gui/OptionsDialog.cxx index 56024164e..bb5afc13e 100644 --- a/src/gui/OptionsDialog.cxx +++ b/src/gui/OptionsDialog.cxx @@ -62,10 +62,10 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent, auto ADD_OD_BUTTON = [&](const string& label, int cmd) { - ButtonWidget* b = new ButtonWidget(this, font, xoffset, yoffset, + ButtonWidget* bw = new ButtonWidget(this, font, xoffset, yoffset, buttonWidth, buttonHeight, label, cmd); yoffset += rowHeight; - return b; + return bw; }; b = ADD_OD_BUTTON("Video Settings", kVidCmd); diff --git a/src/macosx/Info-Stella.plist b/src/macosx/Info-Stella.plist index 9922a684f..9c2b8f87f 100644 --- a/src/macosx/Info-Stella.plist +++ b/src/macosx/Info-Stella.plist @@ -56,10 +56,8 @@ 4.5 LSMinimumSystemVersionByArchitecture - i386 - 10.5.0 x86_64 - 10.6.0 + 10.7.0 NSMainNibFile SDLMain.nib diff --git a/src/macosx/stella.xcodeproj/project.pbxproj b/src/macosx/stella.xcodeproj/project.pbxproj index 968082c7f..bd8bc12c2 100644 --- a/src/macosx/stella.xcodeproj/project.pbxproj +++ b/src/macosx/stella.xcodeproj/project.pbxproj @@ -1314,6 +1314,7 @@ 2D6050C5089876F300C6DE89 /* common */ = { isa = PBXGroup; children = ( + DCC467EA14FBEC9600E15508 /* tv_filters */, DC79F81017A88D9E00288B91 /* Base.cxx */, DC79F81117A88D9E00288B91 /* Base.hxx */, DCC527D810B9DA6A005E1287 /* bspf.hxx */, @@ -1338,7 +1339,6 @@ DC5D1AA6102C6FC900E59AC1 /* Stack.hxx */, DC5C768E14C26F7C0031EBC7 /* StellaKeys.hxx */, DC74D6A0138D4D7E00F05C5C /* StringParser.hxx */, - DCC467EA14FBEC9600E15508 /* tv_filters */, DC7A24D4173B1CF600B20FE9 /* Variant.hxx */, DCF490791A0ECE5B00A67AA9 /* Vec.hxx */, DCF467BC0F9399F500B25D7A /* Version.hxx */,