Skip to content

Commit

Permalink
Merge pull request #204 from ppwwyyxx/master
Browse files Browse the repository at this point in the history
fix compiler warnings
  • Loading branch information
mgbellemare authored Jul 2, 2017
2 parents 8e7604f + 9f777e9 commit 5c7dfa5
Show file tree
Hide file tree
Showing 82 changed files with 105 additions and 106 deletions.
3 changes: 1 addition & 2 deletions src/ale_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ bool ALEInterface::game_over() const {
}

// The remaining number of lives.
const int ALEInterface::lives() {
int ALEInterface::lives() {
if (!romSettings.get()) {
throw std::runtime_error("ROM not set");
}
Expand Down Expand Up @@ -357,7 +357,6 @@ void ALEInterface::restoreSystemState(const ALEState& state) {
}

void ALEInterface::saveScreenPNG(const std::string& filename) {

ScreenExporter exporter(theOSystem->colourPalette());
exporter.save(environment->getScreen(), filename);
}
Expand Down
2 changes: 1 addition & 1 deletion src/ale_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class ALEInterface {
int getFrameNumber();

// The remaining number of lives.
const int lives();
int lives();

// Returns the frame number since the start of the current episode
int getEpisodeFrameNumber() const;
Expand Down
18 changes: 9 additions & 9 deletions src/common/SoundNull.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class SoundNull : public Sound
using the object.
*/
SoundNull(OSystem* osystem);

/**
Destructor
*/
Expand All @@ -54,30 +54,30 @@ class SoundNull : public Sound
@param enable Either true or false, to enable or disable the sound system
@return Whether the sound system was enabled or disabled
*/
void setEnabled(bool enable) { }
void setEnabled(bool) { }

/**
The system cycle counter is being adjusting by the specified amount. Any
members using the system cycle counter should be adjusted as needed.
@param amount The amount the cycle counter is being adjusted by
*/
void adjustCycleCounter(Int32 amount) { }
void adjustCycleCounter(Int32) { }

/**
Sets the number of channels (mono or stereo sound).
@param channels The number of channels
*/
void setChannels(uInt32 channels) { }
void setChannels(uInt32) { }

/**
Sets the display framerate. Sound generation for NTSC and PAL games
depends on the framerate, so we need to set it here.
@param framerate The base framerate depending on NTSC or PAL ROM
*/
void setFrameRate(uInt32 framerate) { }
void setFrameRate(uInt32) { }

/**
Initializes the sound device. This must be called before any
Expand All @@ -103,7 +103,7 @@ class SoundNull : public Sound
@param state Mutes sound if true, unmute if false
*/
void mute(bool state) { }
void mute(bool) { }

/**
Reset the sound device.
Expand All @@ -117,7 +117,7 @@ class SoundNull : public Sound
@param value The value to save into the register
@param cycle The system cycle at which the register is being updated
*/
void set(uInt16 addr, uInt8 value, Int32 cycle) { }
void set(uInt16, uInt8, Int32) { }

/**
Sets the volume of the sound device to the specified level. The
Expand All @@ -126,15 +126,15 @@ class SoundNull : public Sound
@param percent The new volume percentage level for the sound device
*/
void setVolume(Int32 percent) { }
void setVolume(Int32) { }

/**
Adjusts the volume of the sound device based on the given direction.
@param direction Increase or decrease the current volume by a predefined
amount based on the direction (1 = increase, -1 =decrease)
*/
void adjustVolume(Int8 direction) { }
void adjustVolume(Int8) { }

/**
* Tells the sound engine to record one frame's worth of sound.
Expand Down
2 changes: 1 addition & 1 deletion src/common/display_screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class DisplayScreen {
/** A dummy class that simply ignores display events. */
class DisplayScreen {
public:
DisplayScreen(MediaSource* mediaSource, Sound* sound, ColourPalette &palette) {}
DisplayScreen(MediaSource*, Sound*, ColourPalette &) {}
void display_screen() {}
bool manual_control_engaged() { return false; }
Action getUserAction() { return UNDEFINED; }
Expand Down
4 changes: 2 additions & 2 deletions src/emucore/Control.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ Controller::Controller(Jack jack, const Event& event, Type type)
myType(type)
{
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Controller::~Controller()
{
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const Controller::Type Controller::type()
Controller::Type Controller::type()
{
return myType;
}
Expand Down
4 changes: 2 additions & 2 deletions src/emucore/Control.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Controller
@param type The type for this controller
*/
Controller(Jack jack, const Event& event, Type type);

/**
Destructor
*/
Expand All @@ -96,7 +96,7 @@ class Controller
/**
Returns the type of this controller.
*/
const Type type();
Type type();

/**
Inform this controller about the current System.
Expand Down
18 changes: 9 additions & 9 deletions src/emucore/OSystem.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ class OSystem
/**
Get the maximum dimensions of a window for the video hardware.
*/
const uInt32 desktopWidth() const { return myDesktopWidth; }
const uInt32 desktopHeight() const { return myDesktopHeight; }
uInt32 desktopWidth() const { return myDesktopWidth; }
uInt32 desktopHeight() const { return myDesktopHeight; }

/**
Get the supported fullscreen resolutions for the video hardware.
Expand Down Expand Up @@ -410,7 +410,7 @@ class OSystem
*/
//ALE virtual void stateChanged(EventHandler::State state);


protected:
/**
Query the OSystem video hardware for resolution information.
Expand All @@ -434,7 +434,7 @@ class OSystem
void setConfigFile(const std::string& file) { myConfigFile = file; }



protected:
// Pointer to the EventHandler object
//ALE EventHandler* myEventHandler;
Expand All @@ -455,10 +455,10 @@ class OSystem

// Pointer to the (currently defined) Console object
Console* myConsole;

// Random number generator shared across the emulator's components
Random myRandGen;

// Pointer to the Menu object
//ALE Menu* myMenu;

Expand All @@ -476,7 +476,7 @@ class OSystem

// Pointer to the AI object
//ALE AIBase *aiBase;

// Maximum dimensions of the desktop area
uInt32 myDesktopWidth, myDesktopHeight;

Expand Down Expand Up @@ -515,7 +515,7 @@ class OSystem

// The font object to use for the console/debugger
//ALE GUI::Font* myConsoleFont;

public: //ALE
// Time per frame for a video update, based on the current framerate
uInt32 myTimePerFrame;
Expand All @@ -536,7 +536,7 @@ class OSystem
//ALE static uInt32 ourGUIColors[kNumUIPalettes][kNumColors-256];
public:
DisplayScreen* p_display_screen; //MHAUSKN

private:

ColourPalette m_colour_palette;
Expand Down
10 changes: 5 additions & 5 deletions src/environment/ale_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ class ALEState {
void setActionJoysticks(Event* event_obj, int player_a_action, int player_b_action);

void incrementFrame(int steps = 1);

void resetEpisodeFrameNumber();

//Get the frames executed so far
const int getFrameNumber() const { return m_frame_number; }
int getFrameNumber() const { return m_frame_number; }

//Get the number of frames executed this episode.
const int getEpisodeFrameNumber() const { return m_episode_frame_number; }
int getEpisodeFrameNumber() const { return m_episode_frame_number; }

std::string serialize();

Expand Down Expand Up @@ -94,7 +94,7 @@ class ALEState {

/** Calculates the Paddle resistance, based on the given x val */
int calcPaddleResistance(int x_val);

private:
int m_left_paddle; // Current value for the left-paddle
int m_right_paddle; // Current value for the right-paddle
Expand Down
2 changes: 1 addition & 1 deletion src/games/RomSettings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct RomSettings {
virtual bool isLegal(const Action &a) const;

// Remaining lives.
virtual const int lives() { return isTerminal() ? 0 : 1; }
virtual int lives() { return isTerminal() ? 0 : 1; }

// Returns a restricted (minimal) set of actions. If not overriden, this is all actions.
virtual ActionVect getMinimalActionSet();
Expand Down
2 changes: 1 addition & 1 deletion src/games/supported/Alien.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class AlienSettings : public RomSettings {
// loads the state of the rom settings
void loadState(Deserializer & ser);

virtual const int lives() { return m_lives; }
virtual int lives() { return m_lives; }

private:

Expand Down
2 changes: 1 addition & 1 deletion src/games/supported/Amidar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class AmidarSettings : public RomSettings {
// loads the state of the rom settings
void loadState(Deserializer & ser);

virtual const int lives() { return isTerminal() ? 0 : m_lives; }
virtual int lives() { return isTerminal() ? 0 : m_lives; }

private:

Expand Down
2 changes: 1 addition & 1 deletion src/games/supported/Assault.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class AssaultSettings : public RomSettings {
// loads the state of the rom settings
void loadState(Deserializer & ser);

virtual const int lives() { return isTerminal() ? 0 : m_lives; }
virtual int lives() { return isTerminal() ? 0 : m_lives; }

private:

Expand Down
4 changes: 2 additions & 2 deletions src/games/supported/Asterix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ class AsterixSettings : public RomSettings {

// saves the state of the rom settings
void saveState(Serializer & ser);

// loads the state of the rom settings
void loadState(Deserializer & ser);

// Asterix requires the fire action to start the game
ActionVect getStartingActions();

virtual const int lives() { return isTerminal() ? 0 : m_lives; }
virtual int lives() { return isTerminal() ? 0 : m_lives; }

private:

Expand Down
2 changes: 1 addition & 1 deletion src/games/supported/Asteroids.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class AsteroidsSettings : public RomSettings {
// loads the state of the rom settings
void loadState(Deserializer & ser);

virtual const int lives() { return isTerminal() ? 0 : m_lives; }
virtual int lives() { return isTerminal() ? 0 : m_lives; }

private:

Expand Down
2 changes: 1 addition & 1 deletion src/games/supported/Atlantis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class AtlantisSettings : public RomSettings {
// loads the state of the rom settings
void loadState(Deserializer & ser);

virtual const int lives() { return isTerminal() ? 0 : m_lives; }
virtual int lives() { return isTerminal() ? 0 : m_lives; }

private:

Expand Down
2 changes: 1 addition & 1 deletion src/games/supported/BankHeist.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class BankHeistSettings : public RomSettings {
// loads the state of the rom settings
void loadState(Deserializer & ser);

virtual const int lives() { return isTerminal() ? 0 : m_lives; }
virtual int lives() { return isTerminal() ? 0 : m_lives; }

private:

Expand Down
2 changes: 1 addition & 1 deletion src/games/supported/BattleZone.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class BattleZoneSettings : public RomSettings {
// loads the state of the rom settings
void loadState(Deserializer & ser);

virtual const int lives() { return isTerminal() ? 0 : m_lives; }
virtual int lives() { return isTerminal() ? 0 : m_lives; }

private:

Expand Down
2 changes: 1 addition & 1 deletion src/games/supported/BeamRider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class BeamRiderSettings : public RomSettings {

ActionVect getStartingActions();

virtual const int lives() { return isTerminal() ? 0 : m_lives; }
virtual int lives() { return isTerminal() ? 0 : m_lives; }

private:

Expand Down
2 changes: 1 addition & 1 deletion src/games/supported/Berzerk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class BerzerkSettings : public RomSettings {
// loads the state of the rom settings
void loadState(Deserializer & ser);

virtual const int lives() { return isTerminal() ? 0 : m_lives; }
virtual int lives() { return isTerminal() ? 0 : m_lives; }

private:

Expand Down
2 changes: 1 addition & 1 deletion src/games/supported/Bowling.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class BowlingSettings : public RomSettings {
void loadState(Deserializer & ser);

// No lives in bowling!
virtual const int lives() { return 0; }
virtual int lives() { return 0; }

private:

Expand Down
2 changes: 1 addition & 1 deletion src/games/supported/Boxing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class BoxingSettings : public RomSettings {
// loads the state of the rom settings
void loadState(Deserializer & ser);

virtual const int lives() { return 0; }
virtual int lives() { return 0; }

private:

Expand Down
2 changes: 1 addition & 1 deletion src/games/supported/Breakout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class BreakoutSettings : public RomSettings {
void loadState(Deserializer & ser);

// remaining lives
const int lives() { return isTerminal() ? 0 : m_lives; }
int lives() { return isTerminal() ? 0 : m_lives; }

private:

Expand Down
2 changes: 1 addition & 1 deletion src/games/supported/Carnival.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class CarnivalSettings : public RomSettings {
// loads the state of the rom settings
void loadState(Deserializer & ser);

virtual const int lives() { return 0; }
virtual int lives() { return 0; }

private:

Expand Down
2 changes: 1 addition & 1 deletion src/games/supported/Centipede.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class CentipedeSettings : public RomSettings {
// loads the state of the rom settings
void loadState(Deserializer & ser);

virtual const int lives() { return isTerminal() ? 0 : m_lives; }
virtual int lives() { return isTerminal() ? 0 : m_lives; }

private:

Expand Down
Loading

0 comments on commit 5c7dfa5

Please sign in to comment.