Reverted parts of revisions #44298, #44299 and #44300, to prevent warnings and issues in compilers which don't support NORETURN

svn-id: r44314
This commit is contained in:
Filippos Karapetis 2009-09-24 17:52:53 +00:00
parent 0ea3cde160
commit b4f1960318
19 changed files with 23 additions and 27 deletions

View File

@ -225,7 +225,7 @@ Item *AGOSEngine::actor() {
error("actor: is this code ever used?");
//if (_actorPlayer)
// return _actorPlayer;
//return _dummyItem1;
return _dummyItem1; // for compilers that don't support NORETURN
}
Item *AGOSEngine::getNextItemPtr() {
@ -455,7 +455,7 @@ uint AGOSEngine::itemPtrToID(Item *id) {
if (_itemArrayPtr[i] == id)
return i;
error("itemPtrToID: not found");
//return 0;
return 0; // for compilers that don't support NORETURN
}
} // End of namespace AGOS

View File

@ -1657,7 +1657,7 @@ int AGOSEngine_PN::saveFile(char *name) {
delete f;
restartAnimation();
error("Couldn't save ");
//return 0;
return 0; // for compilers that don't support NORETURN
}
f->finalize();
delete f;

View File

@ -180,7 +180,7 @@ TextLocation *AGOSEngine::getTextLocation(uint a) {
default:
error("getTextLocation: Invalid text location %d", a);
}
//return NULL;
return NULL; // for compilers that don't support NORETURN
}
void AGOSEngine::allocateStringTable(int num) {

View File

@ -42,7 +42,7 @@ uint AGOSEngine::getWindowNum(WindowBlock *window) {
return i;
error("getWindowNum: not found");
//return 0;
return 0; // for compilers that don't support NORETURN
}
WindowBlock *AGOSEngine::openWindow(uint x, uint y, uint w, uint h, uint flags, uint fillColor, uint textColor) {

View File

@ -89,7 +89,7 @@ Common::Error CruiseEngine::run() {
if (!loadLanguageStrings()) {
error("Could not setup language data for your version");
//return Common::kUnknownError;
return Common::kUnknownError; // for compilers that don't support NORETURN
}
initialize();

View File

@ -263,7 +263,7 @@ uint16 Hotspots::add(const Hotspot &hotspot) {
}
error("Hotspots::add(): Hotspot array full");
//return 0xFFFF;
return 0xFFFF; // for compilers that don't support NORETURN
}
void Hotspots::remove(uint16 id) {

View File

@ -132,7 +132,7 @@ bool Resource::reset() {
}
} else {
error("Unknown game id: %d", _vm->game());
//return false;
return false; // for compilers that don't support NORETURN
}
return true;
@ -191,7 +191,7 @@ bool Resource::loadFileList(const Common::String &filedata) {
} else if (!loadPakFile(filename)) {
delete f;
error("couldn't load file '%s'", filename.c_str());
//return false;
return false; // for compilers that don't support NORETURN
}
}
}
@ -207,7 +207,7 @@ bool Resource::loadFileList(const char * const *filelist, uint32 numFiles) {
while (numFiles--) {
if (!loadPakFile(filelist[numFiles])) {
error("couldn't load file '%s'", filelist[numFiles]);
//return false;
return false; // for compilers that don't support NORETURN
}
}

View File

@ -340,7 +340,7 @@ void Screen_LoK_16::getFadeParams(const Palette &pal, int delay, int &delayInc,
int Screen_LoK_16::fadePalStep(const Palette &pal, int diff) {
error("Screen_LoK_16::fadePalStep called");
//return 0;
return 0; // for compilers that don't support NORETURN
}
void Screen_LoK_16::paletteMap(uint8 idx, int r, int g, int b) {

View File

@ -106,7 +106,7 @@ bool EMCInterpreter::load(const char *filename, EMCData *scriptData, const Commo
Common::SeekableReadStream *stream = _vm->resource()->createReadStream(filename);
if (!stream) {
error("Couldn't open script file '%s'", filename);
//return false;
return false; // for compilers that don't support NORETURN
}
memset(scriptData, 0, sizeof(EMCData));

View File

@ -178,7 +178,7 @@ char StringData::readCharacter() {
error("Unknown bit sequence encountered when decoding string");
//return 0;
return 0; // for compilers that don't support NORETURN
}
void StringData::getString(uint16 stringId, char *dest, const char *hotspotName,

View File

@ -782,8 +782,6 @@ bool ScriptInterpreter::execOpcode(byte opcode) {
}
//return false;
}
// Kernel functions

View File

@ -60,8 +60,7 @@ SndHandle *Sound::getHandle() {
}
error("Sound::getHandle(): Too many sound handles");
//return NULL;
return NULL; // for compilers that don't support NORETURN
}
bool Sound::isHandleActive(SndHandle *handle) {

View File

@ -620,7 +620,7 @@ private:
uint16 getCrunchType(uint32 signature) {
byte eff;
byte eff = 0;
switch (signature) {
case 0x50503230: /* PP20 */

View File

@ -303,8 +303,7 @@ int16 ScriptVar::getValue() {
}
error("Parameter is not an r-value");
//return 0;
return 0; // for compilers that don't support NORETURN
}
void ScriptVar::setValue(int16 value) {

View File

@ -778,7 +778,7 @@ int Actor::getFrameType(ActorFrameTypes frameType) {
case kFramePickUp:
case kFrameLook:
error("Actor::getFrameType() unknown frame type %d", frameType);
//return kFrameIHNMStand;
return kFrameIHNMStand; // for compilers that don't support NORETURN
}
#endif
}

View File

@ -338,7 +338,7 @@ const GameDisplayInfo &SagaEngine::getDisplayInfo() {
#endif
default:
error("getDisplayInfo: Unknown game ID");
//return ITE_DisplayInfo; // unreachable
return ITE_DisplayInfo; // for compilers that don't support NORETURN
}
}

View File

@ -60,7 +60,7 @@ SndHandle *Sound::getHandle() {
error("Sound::getHandle(): Too many sound handles");
//return NULL;
return NULL; // for compilers that don't support NORETURN
}
void Sound::playSoundBuffer(Audio::SoundHandle *handle, SoundBuffer &buffer, int volume,

View File

@ -690,7 +690,7 @@ int Logic::interpretScript(Object *compact, int id, Header *scriptModule, int sc
break;
default:
error("Invalid operator %d",scriptCode[pc-1]);
//return 0;
return 0; // for compilers that don't support NORETURN
}
}
}
@ -1252,7 +1252,7 @@ int Logic::fnChangeSpeechText(Object *cpt, int32 id, int32 tar, int32 width, int
//The game is halted for debugging. Maybe we'll remove this later.
int Logic::fnTalkError(Object *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x) {
error("fnTalkError for id %d, instruction %d", id, cpt->o_down_flag);
//return SCRIPT_STOP;
return SCRIPT_STOP; // for compilers that don't support NORETURN
}
int Logic::fnStartTalk(Object *cpt, int32 id, int32 target, int32 d, int32 e, int32 f, int32 z, int32 x) {
@ -1607,7 +1607,7 @@ int Logic::fnStopMusic(Object *cpt, int32 id, int32 a, int32 b, int32 c, int32 d
int Logic::fnInnerSpace(Object *cpt, int32 id, int32 a, int32 b, int32 c, int32 d, int32 z, int32 x) {
error("fnInnerSpace() not working.");
//return SCRIPT_STOP;
return SCRIPT_STOP; // for compilers that don't support NORETURN
}
int Logic::fnSetScreen(Object *cpt, int32 id, int32 target, int32 screen, int32 c, int32 d, int32 z, int32 x) {

View File

@ -754,7 +754,7 @@ int Logic::runScript2(byte *scriptData, byte *objectData, byte *offsetPtr) {
break;
default:
error("Invalid script command %d", curCommand);
//return 3;
return 3; // for compilers that don't support NORETURN
}
}