More clang warning cleanups.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3209 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2015-09-15 15:50:25 +00:00
parent 75893a6a3e
commit ef5f1bad4d
13 changed files with 15 additions and 45 deletions

View File

@ -140,20 +140,10 @@ shared_ptr<Cheat> CheatManager::createCheat(const string& name, const string& co
// Create new cheat based on string length
switch(code.size())
{
case 4:
return make_shared<RamCheat>(myOSystem, name, code);
break;
case 6:
return make_shared<CheetahCheat>(myOSystem, name, code);
break;
case 8:
return make_shared<BankRomCheat>(myOSystem, name, code);
break;
default:
return nullptr;
case 4: return make_shared<RamCheat>(myOSystem, name, code);
case 6: return make_shared<CheetahCheat>(myOSystem, name, code);
case 8: return make_shared<BankRomCheat>(myOSystem, name, code);
default: return nullptr;
}
}

View File

@ -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;
}
}

View File

@ -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 =

View File

@ -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));
}

View File

@ -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
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -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;
}
}

View File

@ -587,7 +587,6 @@ bool Dialog::handleNavEvent(Event::Type e)
default:
return false;
break;
}
return false;
}

View File

@ -25,8 +25,6 @@
#include "PopUpWidget.hxx"
#define UP_DOWN_BOX_HEIGHT 10
// Little up/down arrow
static uInt32 up_down_arrows[8] = {
0x00000000,

View File

@ -670,7 +670,6 @@ bool SliderWidget::handleEvent(Event::Type e)
default:
return false;
break;
}
return true;
}

View File

@ -332,8 +332,7 @@ int yylex() {
return o;
}
}
break;
// break; Never executed
case ST_DEFAULT:
default: