diff --git a/src/cheat/CheatManager.cxx b/src/cheat/CheatManager.cxx index 1f3ab423f..17c066b83 100644 --- a/src/cheat/CheatManager.cxx +++ b/src/cheat/CheatManager.cxx @@ -140,20 +140,10 @@ shared_ptr CheatManager::createCheat(const string& name, const string& co // Create new cheat based on string length switch(code.size()) { - case 4: - return make_shared(myOSystem, name, code); - break; - - case 6: - return make_shared(myOSystem, name, code); - break; - - case 8: - return make_shared(myOSystem, name, code); - break; - - default: - return nullptr; + case 4: return make_shared(myOSystem, name, code); + case 6: return make_shared(myOSystem, name, code); + case 8: return make_shared(myOSystem, name, code); + default: return nullptr; } } diff --git a/src/common/tv_filters/atari_ntsc_impl.hxx b/src/common/tv_filters/atari_ntsc_impl.hxx index bf26af078..d4d4292c4 100644 --- a/src/common/tv_filters/atari_ntsc_impl.hxx +++ b/src/common/tv_filters/atari_ntsc_impl.hxx @@ -264,7 +264,7 @@ static void init( init_t* impl, atari_ntsc_setup_t const* setup ) do { float const* in = decoder; - int n = 3; + int n2 = 3; do { float i = *in++; @@ -272,7 +272,7 @@ static void init( init_t* impl, atari_ntsc_setup_t const* setup ) *out++ = i * c - q * s; *out++ = i * s + q * c; } - while ( --n ); + while ( --n2 ); if ( burst_count <= 1 ) break; ROTATE_IQ( s, c, 0.866025f, -0.5f ); /* +120 degrees */ @@ -364,9 +364,9 @@ static void gen_kernel( init_t* impl, float y, float i, float q, atari_ntsc_rgb_ ++pixel; for ( n = rgb_kernel_size; n; --n ) { - float i = k[0]*ic0 + k[2]*ic2; - float q = k[1]*qc1 + k[3]*qc3; - float y = k[kernel_size+0]*yc0 + k[kernel_size+1]*yc1 + + float fi = k[0]*ic0 + k[2]*ic2; + float fq = k[1]*qc1 + k[3]*qc3; + float fy = k[kernel_size+0]*yc0 + k[kernel_size+1]*yc1 + k[kernel_size+2]*yc2 + k[kernel_size+3]*yc3 + rgb_offset; if ( rescale_out <= 1 ) k--; @@ -375,7 +375,7 @@ static void gen_kernel( init_t* impl, float y, float i, float q, atari_ntsc_rgb_ else k -= kernel_size * 2 * (rescale_out - 1) + 2; { - int r, g, b = YIQ_TO_RGB( y, i, q, to_rgb, int, r, g ); + int r, g, b = YIQ_TO_RGB( fy, fi, fq, to_rgb, int, r, g ); *out++ = PACK_RGB( r, g, b ) - rgb_bias; } } diff --git a/src/debugger/gui/CartMCWidget.cxx b/src/debugger/gui/CartMCWidget.cxx index 9e7020b2e..edde5deee 100644 --- a/src/debugger/gui/CartMCWidget.cxx +++ b/src/debugger/gui/CartMCWidget.cxx @@ -28,8 +28,6 @@ CartridgeMCWidget::CartridgeMCWidget( : CartDebugWidget(boss, lfont, nfont, x, y, w, h), myCart(cart) { -#define ROM_BLOCKS - uInt32 size = 128 * 1024; string info = diff --git a/src/emucore/CartDPCPlus.cxx b/src/emucore/CartDPCPlus.cxx index 1d8e217b2..4380e2ab1 100644 --- a/src/emucore/CartDPCPlus.cxx +++ b/src/emucore/CartDPCPlus.cxx @@ -144,7 +144,7 @@ inline void CartridgeDPCPlus::clockRandomNumberGenerator() inline void CartridgeDPCPlus::priorClockRandomNumberGenerator() { // Update random number generator (32-bit LFSR, reversed) - myRandomNumber = ((myRandomNumber & (1<<31)) ? + myRandomNumber = ((myRandomNumber & (1u<<31)) ? ((0x10adab1e^myRandomNumber) << 11) | ((0x10adab1e^myRandomNumber) >> 21) : (myRandomNumber << 11) | (myRandomNumber >> 21)); } diff --git a/src/emucore/CartWD.cxx b/src/emucore/CartWD.cxx index a5c9e846a..f8bc1e701 100644 --- a/src/emucore/CartWD.cxx +++ b/src/emucore/CartWD.cxx @@ -144,7 +144,7 @@ uInt8 CartridgeWD::peek(uInt16 address) return mySegment3[address & 0x03FF]; } - return 0; // We'll never reach this + return 0; // Make the compiler happy; we'll never reach this } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index c07d79c93..4b8095340 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -1140,7 +1140,6 @@ void EventHandler::setActionMappings(EventMode mode) break; default: return; - break; } ostringstream buf; @@ -1582,7 +1581,6 @@ void EventHandler::setDefaultKeymap(Event::Type event, EventMode mode) default: return; - break; } setActionMappings(mode); } @@ -1744,16 +1742,13 @@ Event::Type EventHandler::eventAtIndex(int idx, EventMode mode) const return Event::NoType; else return ourEmulActionList[idx].event; - break; case kMenuMode: if(idx < 0 || idx >= kMenuActionListSize) return Event::NoType; else return ourMenuActionList[idx].event; - break; default: return Event::NoType; - break; } } @@ -1767,16 +1762,13 @@ string EventHandler::actionAtIndex(int idx, EventMode mode) const return EmptyString; else return ourEmulActionList[idx].action; - break; case kMenuMode: if(idx < 0 || idx >= kMenuActionListSize) return EmptyString; else return ourMenuActionList[idx].action; - break; default: return EmptyString; - break; } } @@ -1790,16 +1782,13 @@ string EventHandler::keyAtIndex(int idx, EventMode mode) const return EmptyString; else return ourEmulActionList[idx].key; - break; case kMenuMode: if(idx < 0 || idx >= kMenuActionListSize) return EmptyString; else return ourMenuActionList[idx].key; - break; default: return EmptyString; - break; } } diff --git a/src/emucore/Props.cxx b/src/emucore/Props.cxx index 7342aea83..0502f3b19 100644 --- a/src/emucore/Props.cxx +++ b/src/emucore/Props.cxx @@ -61,7 +61,7 @@ void Properties::set(PropertyType key, const string& value) case Display_Phosphor: { transform(myProperties[key].begin(), myProperties[key].end(), - myProperties[key].begin(), (int(*)(int)) toupper); + myProperties[key].begin(), ::toupper); break; } diff --git a/src/emucore/TIA.cxx b/src/emucore/TIA.cxx index 0dd72b958..1b3841d37 100644 --- a/src/emucore/TIA.cxx +++ b/src/emucore/TIA.cxx @@ -1299,7 +1299,7 @@ inline uInt8 TIA::dumpedInputPort(int resistance) else return 0x00; } - return 0x00; + return 0x00; // Make the compiler happy; we'll never reach this } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/CheckListWidget.cxx b/src/gui/CheckListWidget.cxx index b1badcc44..8bf84c845 100644 --- a/src/gui/CheckListWidget.cxx +++ b/src/gui/CheckListWidget.cxx @@ -166,11 +166,9 @@ bool CheckListWidget::handleEvent(Event::Type e) // Simulate a mouse button click _checkList[ListWidget::getSelected()]->handleMouseUp(0, 0, 1, 0); return true; - break; default: return ListWidget::handleEvent(e); - break; } } diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx index 6daccca50..6fe2552c9 100644 --- a/src/gui/Dialog.cxx +++ b/src/gui/Dialog.cxx @@ -587,7 +587,6 @@ bool Dialog::handleNavEvent(Event::Type e) default: return false; - break; } return false; } diff --git a/src/gui/PopUpWidget.cxx b/src/gui/PopUpWidget.cxx index 2910dd6ec..073d313de 100644 --- a/src/gui/PopUpWidget.cxx +++ b/src/gui/PopUpWidget.cxx @@ -25,8 +25,6 @@ #include "PopUpWidget.hxx" -#define UP_DOWN_BOX_HEIGHT 10 - // Little up/down arrow static uInt32 up_down_arrows[8] = { 0x00000000, diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index 866238e89..edefb811d 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -670,7 +670,6 @@ bool SliderWidget::handleEvent(Event::Type e) default: return false; - break; } return true; } diff --git a/src/yacc/YaccParser.cxx b/src/yacc/YaccParser.cxx index 4f5d3c6b1..db51e5dc8 100644 --- a/src/yacc/YaccParser.cxx +++ b/src/yacc/YaccParser.cxx @@ -332,8 +332,7 @@ int yylex() { return o; } } - - break; + // break; Never executed case ST_DEFAULT: default: