Fixed some warning that showed up in gcc but not clang++, and vice

versa (I guess it's useful to test under multiple compilers).

Bumped version # for next test release.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3008 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-10-18 15:57:03 +00:00
parent 2d9eb76510
commit fe1713ee87
9 changed files with 26 additions and 29 deletions

View File

@ -22,7 +22,7 @@
#include <cstdlib>
#define STELLA_VERSION "4.2_pre"
#define STELLA_VERSION "4.2_beta1"
#define STELLA_BUILD atoi("$Rev$" + 6)
#endif

View File

@ -1778,7 +1778,7 @@ void EventHandler::takeSnapshot(uInt32 number)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::setMouseControllerMode(const string& enable)
{
if(&myOSystem.console())
if(myOSystem.hasConsole())
{
delete myMouseControl; myMouseControl = NULL;
@ -1851,7 +1851,7 @@ void EventHandler::leaveMenuMode()
bool EventHandler::enterDebugMode()
{
#ifdef DEBUGGER_SUPPORT
if(myState == S_DEBUGGER || !(&myOSystem.console()))
if(myState == S_DEBUGGER || !myOSystem.hasConsole())
return false;
// Make sure debugger starts in a consistent state
@ -1955,15 +1955,10 @@ void EventHandler::setEventState(State state)
// Inform various subsystems about the new state
myOSystem.stateChanged(myState);
if(&myOSystem.frameBuffer())
{
myOSystem.frameBuffer().stateChanged(myState);
myOSystem.frameBuffer().setCursorState();
}
if(&myOSystem.console())
{
myOSystem.frameBuffer().stateChanged(myState);
myOSystem.frameBuffer().setCursorState();
if(myOSystem.hasConsole())
myOSystem.console().stateChanged(myState);
}
// Always clear any pending events when changing states
myEvent.clear();

View File

@ -439,7 +439,7 @@ class EventHandler
void saveMapping();
const StellaJoystick* joy(int id) const {
return id < mySticks.size() ? mySticks[id] : NULL;
return id < (int)mySticks.size() ? mySticks[id] : NULL;
}
private:

View File

@ -360,7 +360,7 @@ int EventHandler::JoystickHandler::remove(int index)
// Sticks that are removed must have initially been added
// So we use the 'active' joystick list to access them
if(index >= 0 && index < mySticks.size() && mySticks[index] != NULL)
if(index >= 0 && index < (int)mySticks.size() && mySticks[index] != NULL)
{
StellaJoystick* stick = mySticks[index];

View File

@ -81,46 +81,48 @@ class OSystem
public:
/**
Get the event handler of the system
Get the event handler of the system.
@return The event handler
*/
EventHandler& eventHandler() const { return *myEventHandler; }
/**
Get the frame buffer of the system
Get the frame buffer of the system.
@return The frame buffer
*/
FrameBuffer& frameBuffer() const { return *myFrameBuffer; }
/**
Get the sound object of the system
Get the sound object of the system.
@return The sound object
*/
Sound& sound() const { return *mySound; }
/**
Get the settings object of the system
Get the settings object of the system.
@return The settings object
*/
Settings& settings() const { return *mySettings; }
/**
Get the set of game properties for the system
Get the set of game properties for the system.
@return The properties set object
*/
PropertiesSet& propSet() const { return *myPropSet; }
/**
Get the console of the system.
Get the console of the system. The console won't always exist,
so we should test if it's available.
@return The console object
*/
Console& console() const { return *myConsole; }
bool hasConsole() const { return myConsole != NULL; }
/**
Get the serial port of the system.

View File

@ -168,7 +168,7 @@ void StateManager::update()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void StateManager::loadState(int slot)
{
if(&myOSystem->console())
if(myOSystem->hasConsole())
{
if(slot < 0) slot = myCurrentSlot;
@ -212,7 +212,7 @@ void StateManager::loadState(int slot)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void StateManager::saveState(int slot)
{
if(&myOSystem->console())
if(myOSystem->hasConsole())
{
if(slot < 0) slot = myCurrentSlot;
@ -270,7 +270,7 @@ void StateManager::changeState()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool StateManager::loadState(Serializer& in)
{
if(&myOSystem->console())
if(myOSystem->hasConsole())
{
// Make sure the file can be opened for reading
if(in.isValid())
@ -290,7 +290,7 @@ bool StateManager::saveState(Serializer& out)
{
try
{
if(&myOSystem->console())
if(myOSystem->hasConsole())
{
// Make sure the file can be opened for writing
if(out.isValid())

View File

@ -166,7 +166,7 @@ void AudioDialog::saveConfig()
// Only force a re-initialization when necessary, since it can
// be a time-consuming operation
if(&instance().console())
if(instance().hasConsole())
instance().console().initializeAudio();
}

View File

@ -379,13 +379,13 @@ void GameInfoDialog::loadConfig()
myPropertiesLoaded = false;
myDefaultsSelected = false;
if(&instance().console())
if(instance().hasConsole())
{
myGameProperties = instance().console().properties();
myPropertiesLoaded = true;
loadView();
}
else if(&instance().launcher())
else
{
const string& md5 = instance().launcher().selectedRomMD5();
if(md5 != "")
@ -506,7 +506,7 @@ void GameInfoDialog::saveConfig()
instance().propSet().insert(myGameProperties);
// In any event, inform the Console and save the properties
if(&instance().console())
if(instance().hasConsole())
instance().console().setProperties(myGameProperties);
instance().propSet().save(instance().propertiesFile());
}

View File

@ -416,7 +416,7 @@ void VideoDialog::saveConfig()
// Framerate
int i = myFrameRate->getValue();
instance().settings().setValue("framerate", i);
if(&instance().console())
if(instance().hasConsole())
{
// Make sure auto-frame calculation is only enabled when necessary
instance().console().tia().enableAutoFrame(i <= 0);
@ -428,7 +428,7 @@ void VideoDialog::saveConfig()
// PAL color-loss effect
instance().settings().setValue("colorloss", myColorLoss->getState());
if(&instance().console())
if(instance().hasConsole())
instance().console().toggleColorLoss(myColorLoss->getState());
// Fullscreen stretch setting