Skip to content

Commit

Permalink
DM: Silent some CppCheck warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke authored and Bendegúz Nagy committed Aug 26, 2016
1 parent 63d06a4 commit 75f9721
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 29 deletions.
4 changes: 2 additions & 2 deletions engines/dm/champion.h
Expand Up @@ -9,7 +9,7 @@ namespace DM {
class Scent {
uint16 _scent;
public:
Scent(uint16 scent = 0): _scent(scent) {}
explicit Scent(uint16 scent = 0): _scent(scent) {}

uint16 getMapX() { return _scent & 0x1F; }
uint16 getMapY() { return (_scent >> 5) & 0x1F; }
Expand Down Expand Up @@ -403,7 +403,7 @@ class ChampionMan {
bool _leaderEmptyHanded; // @ G0415_B_LeaderEmptyHanded
Party _party; // @ G0407_s_Party

ChampionMan(DMEngine *vm);
explicit ChampionMan(DMEngine *vm);
void resetDataToStartGame(); // @ F0278_CHAMPION_ResetDataToStartGame
void addCandidateChampionToParty(uint16 championPortraitIndex); // @ F0280_CHAMPION_AddCandidateChampionToParty
void drawChampionBarGraphs(ChampionIndex champIndex); // @ F0287_CHAMPION_DrawBarGraphs
Expand Down
6 changes: 3 additions & 3 deletions engines/dm/dm.h
Expand Up @@ -62,7 +62,7 @@ class Thing {
static const Thing _thingEndOfList;

Thing() : _data(0) {}
Thing(uint16 d) { set(d); }
explicit Thing(uint16 d) { set(d); }

void set(uint16 d) {
_data = d;
Expand All @@ -88,7 +88,7 @@ class DMEngine : public Engine {
void initializeGame(); // @ F0463_START_InitializeGame_CPSADEF
void gameloop(); // @ F0002_MAIN_GameLoop_CPSDF
public:
DMEngine(OSystem *syst);
explicit DMEngine(OSystem *syst);
~DMEngine();

virtual Common::Error run(); // @ main
Expand Down Expand Up @@ -120,7 +120,7 @@ class DMEngine : public Engine {

class Console : public GUI::Debugger {
public:
Console(DMEngine *vm) {}
explicit Console(DMEngine *vm) {}
virtual ~Console(void) {}
};

Expand Down
32 changes: 16 additions & 16 deletions engines/dm/dungeonman.h
Expand Up @@ -157,7 +157,7 @@ class Door {
Thing _nextThing;
uint16 _attributes;
public:
Door(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {}
explicit Door(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {}
Thing getNextThing() { return _nextThing; }
bool isMeleeDestructible() { return (_attributes >> 8) & 1; }
bool isMagicDestructible() { return (_attributes >> 7) & 1; }
Expand All @@ -178,7 +178,7 @@ class Teleporter {
uint16 _attributes;
uint16 _destMapIndex;
public:
Teleporter(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]), _destMapIndex(rawDat[2]) {}
explicit Teleporter(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]), _destMapIndex(rawDat[2]) {}
Thing getNextThing() { return _nextThing; }
bool makesSound() { return (_attributes >> 15) & 1; }
TeleporterScope getScope() { return (TeleporterScope)((_attributes >> 13) & 1); }
Expand All @@ -195,7 +195,7 @@ class TextString {
Thing _nextThing;
uint16 _textDataRef;
public:
TextString(uint16 *rawDat) : _nextThing(rawDat[0]), _textDataRef(rawDat[1]) {}
explicit TextString(uint16 *rawDat) : _nextThing(rawDat[0]), _textDataRef(rawDat[1]) {}

Thing getNextThing() { return _nextThing; }
uint16 getWordOffset() { return _textDataRef >> 3; }
Expand Down Expand Up @@ -249,7 +249,7 @@ class Sensor {
uint16 _attributes;
uint16 _action;
public:
Sensor(uint16 *rawDat) : _nextThing(rawDat[0]), _datAndType(rawDat[1]), _attributes(rawDat[2]), _action(rawDat[3]) {}
explicit Sensor(uint16 *rawDat) : _nextThing(rawDat[0]), _datAndType(rawDat[1]), _attributes(rawDat[2]), _action(rawDat[3]) {}

Thing getNextThing() { return _nextThing; }
SensorType getType() { return (SensorType)(_datAndType & 0x7F); } // @ M39_TYPE
Expand Down Expand Up @@ -280,7 +280,7 @@ class Group {
uint16 _health[4];
uint16 _attributes;
public:
Group(uint16 *rawDat) : _nextThing(rawDat[0]), _possessionID(rawDat[1]), _type(rawDat[2]),
explicit Group(uint16 *rawDat) : _nextThing(rawDat[0]), _possessionID(rawDat[1]), _type(rawDat[2]),
_position(rawDat[3]), _attributes(rawDat[8]) {
_health[0] = rawDat[4];
_health[1] = rawDat[5];
Expand All @@ -307,7 +307,7 @@ class Weapon {
Thing _nextThing;
uint16 _desc;
public:
Weapon(uint16 *rawDat) : _nextThing(rawDat[0]), _desc(rawDat[1]) {}
explicit Weapon(uint16 *rawDat) : _nextThing(rawDat[0]), _desc(rawDat[1]) {}

WeaponType getType() { return (WeaponType)(_desc & 0x7F); }
bool isLit() { return (_desc >> 15) & 1; }
Expand All @@ -326,7 +326,7 @@ class Armour {
Thing _nextThing;
uint16 _attributes;
public:
Armour(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {}
explicit Armour(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {}

ArmourType getType() { return (ArmourType)(_attributes & 0x7F); }
Thing getNextThing() { return _nextThing; }
Expand All @@ -336,7 +336,7 @@ class Scroll {
Thing _nextThing;
uint16 _attributes;
public:
Scroll(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {}
explicit Scroll(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {}
void set(Thing next, uint16 attribs) {
_nextThing = next;
_attributes = attribs;
Expand Down Expand Up @@ -364,7 +364,7 @@ class Potion {
Thing _nextThing;
uint16 _attributes;
public:
Potion(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {}
explicit Potion(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {}

PotionType getType() { return (PotionType)((_attributes >> 8) & 0x7F); }
Thing getNextThing() { return _nextThing; }
Expand All @@ -375,7 +375,7 @@ class Container {
Thing _nextContainedThing;
uint16 _type;
public:
Container(uint16 *rawDat) : _nextThing(rawDat[0]), _nextContainedThing(rawDat[1]), _type(rawDat[2]) {}
explicit Container(uint16 *rawDat) : _nextThing(rawDat[0]), _nextContainedThing(rawDat[1]), _type(rawDat[2]) {}

uint16 getType() { return (_type >> 1) & 0x3; }
Thing getNextContainedThing() { return _nextContainedThing; }
Expand All @@ -399,7 +399,7 @@ class Junk {
Thing _nextThing;
uint16 _attributes;
public:
Junk(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {}
explicit Junk(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {}

JunkType getType() { return (JunkType)(_attributes & 0x7F); }
uint16 getChargeCount() { return (_attributes >> 14) & 0x3; }
Expand All @@ -414,7 +414,7 @@ class Projectile {
byte _damageEnergy;
uint16 _timerIndex;
public:
Projectile(uint16 *rawDat) : _nextThing(rawDat[0]), _object(rawDat[1]), _kineticEnergy(rawDat[2]),
explicit Projectile(uint16 *rawDat) : _nextThing(rawDat[0]), _object(rawDat[1]), _kineticEnergy(rawDat[2]),
_damageEnergy(rawDat[3]), _timerIndex(rawDat[4]) {}

Thing getNextThing() { return _nextThing; }
Expand All @@ -424,7 +424,7 @@ class Explosion {
Thing _nextThing;
uint16 _attributes;
public:
Explosion(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {}
explicit Explosion(uint16 *rawDat) : _nextThing(rawDat[0]), _attributes(rawDat[1]) {}

Thing getNextThing() { return _nextThing; }
}; // @ EXPLOSION
Expand Down Expand Up @@ -470,8 +470,8 @@ enum SquareType {
class Square {
byte _data;
public:
Square(byte dat = 0) : _data(dat) {}
Square(SquareType type) { setType(type); }
explicit Square(byte dat = 0) : _data(dat) {}
explicit Square(SquareType type) { setType(type); }
Square &set(byte dat) { this->_data = dat; return *this; }
Square &set(SquareMask mask) { _data |= mask; return *this; }
byte get(SquareMask mask) { return _data & mask; }
Expand Down Expand Up @@ -573,7 +573,7 @@ class DungeonMan {
void setCurrentMap(uint16 mapIndex); // @ F0173_DUNGEON_SetCurrentMap

public:
DungeonMan(DMEngine *dmEngine);
explicit DungeonMan(DMEngine *dmEngine);
~DungeonMan();

Thing getSquareFirstThing(int16 mapX, int16 mapY); // @ F0161_DUNGEON_GetSquareFirstThing
Expand Down
4 changes: 3 additions & 1 deletion engines/dm/eventman.h
Expand Up @@ -197,13 +197,15 @@ class EventManager {
void commandTurnParty(CommandType cmdType); // @ F0365_COMMAND_ProcessTypes1To2_TurnParty
void commandMoveParty(CommandType cmdType); // @ F0366_COMMAND_ProcessTypes3To6_MoveParty
public:
explicit EventManager(DMEngine *vm);

MouseInput* _primaryMouseInput;// @ G0441_ps_PrimaryMouseInput
MouseInput* _secondaryMouseInput;// @ G0442_ps_SecondaryMouseInput
bool _mousePointerBitmapUpdated; // @ G0598_B_MousePointerBitmapUpdated
bool _refreshMousePointerInMainLoop; // @ G0326_B_RefreshMousePointerInMainLoop
bool _highlightBoxEnabled; // @ G0341_B_HighlightBoxEnabled
uint16 _useChampionIconOrdinalAsMousePointerBitmap; // @ G0599_ui_UseChampionIconOrdinalAsMousePointerBitmap
EventManager(DMEngine *vm);

void initMouse();
void showMouse(bool visibility);

Expand Down
2 changes: 1 addition & 1 deletion engines/dm/gfx.h
Expand Up @@ -279,7 +279,7 @@ class DisplayMan {
// some methods use this for a stratchpad, don't make assumptions about content between function calls
byte *_tmpBitmap;

DisplayMan(DMEngine *dmEngine);
explicit DisplayMan(DMEngine *dmEngine);
~DisplayMan();

void loadWallSet(WallSet set); // @ F0095_DUNGEONVIEW_LoadWallSet
Expand Down
4 changes: 3 additions & 1 deletion engines/dm/inventory.h
Expand Up @@ -21,9 +21,11 @@ enum PanelContent {
class InventoryMan {
DMEngine *_vm;
public:
explicit InventoryMan(DMEngine *vm);

int16 _inventoryChampionOrdinal; // @ G0423_i_InventoryChampionOrdinal
PanelContent _panelContent; // @ G0424_i_PanelContent
InventoryMan(DMEngine *vm);

void toggleInventory(ChampionIndex championIndex); // @ F0355_INVENTORY_Toggle_CPSE
void drawStatusBoxPortrait(ChampionIndex championIndex); // @ F0354_INVENTORY_DrawStatusBoxPortrait
void drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color); // @ F0343_INVENTORY_DrawPanel_HorizontalBar
Expand Down
4 changes: 1 addition & 3 deletions engines/dm/loadsave.h
Expand Up @@ -13,13 +13,11 @@ enum LoadgameResponse {
class LoadsaveMan {
DMEngine *_vm;
public:
LoadsaveMan(DMEngine *vm);
explicit LoadsaveMan(DMEngine *vm);

LoadgameResponse loadgame(); // @ F0435_STARTEND_LoadGame_CPSF

};

}

#endif

4 changes: 3 additions & 1 deletion engines/dm/menus.h
Expand Up @@ -9,9 +9,11 @@ namespace DM {
class MenuMan {
DMEngine *_vm;
public:
explicit MenuMan(DMEngine *vm);

bool _shouldRefreshActionArea; // @ G0508_B_RefreshActionArea
bool _actionAreaContainsIcons; // @ G0509_B_ActionAreaContainsIcons
MenuMan(DMEngine *vm);

void clearActingChampion(); // @ F0388_MENUS_ClearActingChampion
void drawActionIcon(ChampionIndex championIndex); // @ F0386_MENUS_DrawActionIcon

Expand Down
3 changes: 2 additions & 1 deletion engines/dm/objectman.h
Expand Up @@ -7,7 +7,8 @@ namespace DM {
class ObjectMan {
DMEngine *_vm;
public:
ObjectMan(DMEngine *vm);
explicit ObjectMan(DMEngine *vm);

IconIndice getObjectType(Thing thing); // @ F0032_OBJECT_GetType
IconIndice getIconIndex(Thing thing); // @ F0033_OBJECT_GetIconIndex
void extractIconFromBitmap(uint16 iconIndex, byte *srcBitmap); // F0036_OBJECT_ExtractIconFromBitmap
Expand Down

0 comments on commit 75f9721

Please sign in to comment.