Fixed some compiler warnings picked up by Xcode 4.3

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2417 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2012-03-16 13:19:29 +00:00
parent 89cd0b897d
commit 5ce726f180
9 changed files with 13 additions and 14 deletions

View File

@ -818,7 +818,7 @@ int DiStella::mark(uInt32 address, uInt8 mask, bool directive)
if(directive) myDirectives[address-myOffset] = mask;
return 1;
}
else if (address >= 0 && address <= 0x3f)
else if (address <= 0x3f)
{
return 2;
}

View File

@ -637,7 +637,7 @@ void DataGridWidget::startEditMode()
if (_editable && !_editMode && _selectedItem >= 0)
{
_editMode = true;
setEditString(""); // Erase current entry when starting editing
setEditString("", true ); // Erase current entry when starting editing
}
}

View File

@ -150,8 +150,7 @@ Console::Console(OSystem* osystem, Cartridge* cart, const Properties& props)
// TODO - query these values directly from the TIA if value is 'AUTO'
uInt32 ystart = atoi(myProperties.get(Display_YStart).c_str());
if(ystart < 0) ystart = 0;
else if(ystart > 64) ystart = 64;
if(ystart > 64) ystart = 64;
uInt32 height = atoi(myProperties.get(Display_Height).c_str());
if(height < 210) height = 210;
else if(height > 256) height = 256;
@ -537,21 +536,21 @@ void Console::changeYStart(int direction)
if(direction == +1) // increase YStart
{
ystart++;
if(ystart > 64)
if(ystart >= 64)
{
myOSystem->frameBuffer().showMessage("YStart at maximum");
return;
}
ystart++;
}
else if(direction == -1) // decrease YStart
{
ystart--;
if(ystart < 0)
if(ystart == 0)
{
myOSystem->frameBuffer().showMessage("YStart at minimum");
return;
}
ystart--;
}
else
return;

View File

@ -149,7 +149,7 @@ uInt8 TIASound::get(uInt16 address) const
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIASound::volume(uInt32 percent)
{
if((percent >= 0) && (percent <= 100))
if(percent <= 100)
myVolumePercentage = percent;
}

View File

@ -992,7 +992,7 @@ extern int ZEXPORT unzReadCurrentFile
return UNZ_PARAMERROR;
if ((pfile_in_zip_read_info->read_buffer == NULL))
if (pfile_in_zip_read_info->read_buffer == NULL)
return UNZ_END_OF_LIST_OF_FILE;
if (len==0)
return 0;

View File

@ -44,7 +44,7 @@ EditTextWidget::EditTextWidget(GuiObject* boss, const GUI::Font& font,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EditTextWidget::setEditString(const string& str, bool changed)
{
EditableWidget::setEditString(str);
EditableWidget::setEditString(str, changed);
_backupString = str;
_changed = changed;
}

View File

@ -36,7 +36,7 @@ class EditTextWidget : public EditableWidget
void setEditString(const string& str, bool changed = false);
virtual void handleMouseDown(int x, int y, int button, int clickCount);
void handleMouseDown(int x, int y, int button, int clickCount);
protected:
void drawWidget(bool hilite);

View File

@ -51,7 +51,7 @@ EditableWidget::~EditableWidget()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EditableWidget::setEditString(const string& str)
void EditableWidget::setEditString(const string& str, bool)
{
// TODO: We probably should filter the input string here,
// e.g. using tryInsertChar.

View File

@ -43,7 +43,7 @@ class EditableWidget : public Widget, public CommandSender
int x, int y, int w, int h);
virtual ~EditableWidget();
virtual void setEditString(const string& str);
virtual void setEditString(const string& str, bool changed = false);
virtual const string& getEditString() const { return _editString; }
bool isEditable() const { return _editable; }