Skip to content

Commit

Permalink
XEEN: Fix Coverity warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Jul 27, 2018
1 parent 877b4e5 commit 560f10c
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 15 deletions.
7 changes: 3 additions & 4 deletions engines/xeen/combat.cpp
Expand Up @@ -1612,10 +1612,6 @@ bool Combat::hitMonster(Character &c, RangeType rangeType) {
int divisor = 0;

switch (c._class) {
case CLASS_KNIGHT:
case CLASS_BARBARIAN:
divisor = 1;
break;
case CLASS_PALADIN :
case CLASS_ARCHER:
case CLASS_ROBBER:
Expand All @@ -1630,7 +1626,10 @@ bool Combat::hitMonster(Character &c, RangeType rangeType) {
case CLASS_SORCERER:
divisor = 4;
break;
case CLASS_KNIGHT:
case CLASS_BARBARIAN:
default:
divisor = 1;
break;
}

Expand Down
2 changes: 1 addition & 1 deletion engines/xeen/detection.cpp
Expand Up @@ -164,7 +164,7 @@ bool XeenMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGame
error("Invalid game");
}

return gd != 0;
return true;
}

SaveStateList XeenMetaEngine::listSaves(const char *target) const {
Expand Down
3 changes: 1 addition & 2 deletions engines/xeen/files.cpp
Expand Up @@ -444,8 +444,7 @@ void StringArray::load(const Common::String &name, int ccMode) {

/*------------------------------------------------------------------------*/

SaveArchive::SaveArchive(Party *party) : BaseCCArchive(), _party(party) {
_data = nullptr;
SaveArchive::SaveArchive(Party *party) : BaseCCArchive(), _party(party), _data(nullptr), _dataSize(0) {
}

SaveArchive::~SaveArchive() {
Expand Down
1 change: 0 additions & 1 deletion engines/xeen/files.h
Expand Up @@ -212,7 +212,6 @@ class SubWriteStream : virtual public Common::WriteStream {
protected:
Common::WriteStream *_parentStream;
uint32 _begin;
DisposeAfterUse::Flag _disposeAfterUse;
public:
SubWriteStream(Common::WriteStream *parentStream) :
_parentStream(parentStream), _begin(parentStream->pos()) {
Expand Down
1 change: 1 addition & 0 deletions engines/xeen/interface.cpp
Expand Up @@ -162,6 +162,7 @@ Interface::Interface(XeenEngine *vm) : ButtonContainer(vm), InterfaceScene(vm),
_face1State = _face2State = 0;
_upDoorText = false;
_tillMove = 0;
_iconsMode = ICONS_STANDARD;
Common::fill(&_charFX[0], &_charFX[MAX_ACTIVE_PARTY], 0);
setWaitBounds();
}
Expand Down
2 changes: 1 addition & 1 deletion engines/xeen/item.cpp
Expand Up @@ -113,7 +113,7 @@ const char *XeenItem::getItemName(ItemCategory category, uint id) {
case CATEGORY_ACCESSORY:
return questItems[id - QUEST_OFFSET + 35 + 14];
default:
assert(g_vm->getGameID() != GType_Swords);
assert(g_vm->getGameID() != GType_Swords && (id - QUEST_OFFSET + 35 + 14 + 11) < 85);
return questItems[id - QUEST_OFFSET + 35 + 14 + 11];
}
}
Expand Down
2 changes: 1 addition & 1 deletion engines/xeen/worldofxeen/clouds_cutscenes.h
Expand Up @@ -81,7 +81,7 @@ class CloudsCutscenes : public Cutscenes {
*/
bool showCloudsEnding5();
public:
CloudsCutscenes(XeenEngine *vm) : Cutscenes(vm) {}
CloudsCutscenes(XeenEngine *vm) : Cutscenes(vm), _mergeX(0) {}

/**
* Shows the Clouds of Xeen intro sequence
Expand Down
5 changes: 0 additions & 5 deletions engines/xeen/worldofxeen/darkside_cutscenes.cpp
Expand Up @@ -627,11 +627,6 @@ bool DarkSideCutscenes::showDarkSideIntro2() {
wizard.draw(0, 0, Common::Point(9, 57));
fizzle.draw(0, idx, Common::Point(9, 57));

if (!sound.isSoundPlaying() && !vocIndex) {
sound.playVoice("pharoh7t.voc");
vocIndex = 1;
}

_subtitles.show();
WAIT(3);
}
Expand Down

0 comments on commit 560f10c

Please sign in to comment.