Skip to content

Commit

Permalink
AURORA: Rethrow the caught exception instead of a copy
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Mar 19, 2013
1 parent d466a36 commit b7b2c3e
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/aurora/2dafile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void TwoDAFile::load(Common::SeekableReadStream &twoda) {

} catch (Common::Exception &e) {
e.add("Failed reading 2DA file");
throw e;
throw;
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/aurora/2dareg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ TwoDAFile *TwoDARegistry::load(const Common::UString &name) {
delete twoda;

e.add("Failed loading 2DA \"%s\"", name.c_str());
throw e;
throw;

} catch (...) {
delete twodaFile;
Expand Down
2 changes: 1 addition & 1 deletion src/aurora/biffile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void BIFFile::load() {

} catch (Common::Exception &e) {
e.add("Failed reading BIF file");
throw e;
throw;
}

}
Expand Down
8 changes: 4 additions & 4 deletions src/aurora/erffile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void ERFFile::load() {
readResources(erf, erfHeader);
} catch (Common::Exception &e) {
delete[] erfHeader.stringTable;
throw e;
throw;
}

delete[] erfHeader.stringTable;
Expand All @@ -99,7 +99,7 @@ void ERFFile::load() {

} catch (Common::Exception &e) {
e.add("Failed reading ERF file");
throw e;
throw;
}

}
Expand Down Expand Up @@ -415,7 +415,7 @@ Common::SeekableReadStream *ERFFile::decompressBiowareZlib(byte *compressedData,
return stream;
} catch (Common::Exception &e) {
delete[] compressedData;
throw e;
throw;
}
}

Expand All @@ -426,7 +426,7 @@ Common::SeekableReadStream *ERFFile::decompressHeaderlessZlib(byte *compressedDa
return stream;
} catch (Common::Exception &e) {
delete[] compressedData;
throw e;
throw;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/aurora/gfffile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void GFFFile::load(uint32 id) {

} catch (Common::Exception &e) {
e.add("Failed reading GFF file");
throw e;
throw;
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/aurora/herffile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void HERFFile::load() {
} catch (Common::Exception &e) {
delete herf;
e.add("Failed reading HERF file");
throw e;
throw;
}

delete herf;
Expand Down
2 changes: 1 addition & 1 deletion src/aurora/keyfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void KEYFile::load(Common::SeekableReadStream &key) {

} catch (Common::Exception &e) {
e.add("Failed reading KEY file");
throw e;
throw;
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/aurora/ndsrom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void NDSFile::load() {

} catch (Common::Exception &e) {
e.add("Failed reading NDS file");
throw e;
throw;
}

}
Expand Down
42 changes: 21 additions & 21 deletions src/aurora/nwscript/ncsfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ void NCSFile::executeStep() {
try {
(this->*(_opcodes[opcode].proc))(type);
} catch (Common::Exception &e) {
throw e;
throw;
}

_stack.print();
Expand Down Expand Up @@ -584,7 +584,7 @@ void NCSFile::o_logand(InstructionType type) {
int32 arg2 = _stack.pop().getInt();
_stack.push(arg1 && arg2);
} catch (Common::Exception &e) {
throw e;
throw;
}
}

Expand All @@ -597,7 +597,7 @@ void NCSFile::o_logor(InstructionType type) {
int32 arg2 = _stack.pop().getInt();
_stack.push(arg1 || arg2);
} catch (Common::Exception &e) {
throw e;
throw;
}
}

Expand All @@ -610,7 +610,7 @@ void NCSFile::o_incor(InstructionType type) {
int32 arg2 = _stack.pop().getInt();
_stack.push(arg1 | arg2);
} catch (Common::Exception &e) {
throw e;
throw;
}
}

Expand All @@ -623,7 +623,7 @@ void NCSFile::o_excor(InstructionType type) {
int32 arg2 = _stack.pop().getInt();
_stack.push(arg1 ^ arg2);
} catch (Common::Exception &e) {
throw e;
throw;
}
}

Expand All @@ -636,7 +636,7 @@ void NCSFile::o_booland(InstructionType type) {
int32 arg2 = _stack.pop().getInt();
_stack.push(arg1 && arg2);
} catch (Common::Exception &e) {
throw e;
throw;
}
}

Expand Down Expand Up @@ -668,7 +668,7 @@ void NCSFile::o_geq(InstructionType type) {
int32 arg2 = _stack.pop().getInt();
_stack.push(arg2 >= arg1);
} catch (Common::Exception &e) {
throw e;
throw;
}
break;

Expand All @@ -678,7 +678,7 @@ void NCSFile::o_geq(InstructionType type) {
float arg2 = _stack.pop().getFloat();
_stack.push(arg2 >= arg1);
} catch (Common::Exception &e) {
throw e;
throw;
}
break;

Expand All @@ -695,7 +695,7 @@ void NCSFile::o_gt(InstructionType type) {
int32 arg2 = _stack.pop().getInt();
_stack.push(arg2 > arg1);
} catch (Common::Exception &e) {
throw e;
throw;
}
break;

Expand All @@ -705,7 +705,7 @@ void NCSFile::o_gt(InstructionType type) {
float arg2 = _stack.pop().getFloat();
_stack.push(arg2 > arg1);
} catch (Common::Exception &e) {
throw e;
throw;
}
break;

Expand All @@ -722,7 +722,7 @@ void NCSFile::o_lt(InstructionType type) {
int32 arg2 = _stack.pop().getInt();
_stack.push(arg2 < arg1);
} catch (Common::Exception &e) {
throw e;
throw;
}
break;

Expand All @@ -732,7 +732,7 @@ void NCSFile::o_lt(InstructionType type) {
float arg2 = _stack.pop().getFloat();
_stack.push(arg2 < arg1);
} catch (Common::Exception &e) {
throw e;
throw;
}
break;

Expand All @@ -749,7 +749,7 @@ void NCSFile::o_leq(InstructionType type) {
int32 arg2 = _stack.pop().getInt();
_stack.push(arg2 <= arg1);
} catch (Common::Exception &e) {
throw e;
throw;
}
break;

Expand All @@ -759,7 +759,7 @@ void NCSFile::o_leq(InstructionType type) {
float arg2 = _stack.pop().getFloat();
_stack.push(arg2 <= arg1);
} catch (Common::Exception &e) {
throw e;
throw;
}
break;

Expand All @@ -777,7 +777,7 @@ void NCSFile::o_shleft(InstructionType type) {
int32 arg2 = _stack.pop().getInt();
_stack.push(arg2 << arg1);
} catch (Common::Exception &e) {
throw e;
throw;
}
}

Expand All @@ -790,7 +790,7 @@ void NCSFile::o_shright(InstructionType type) {
int32 arg2 = _stack.pop().getInt();
_stack.push(arg2 >> arg1);
} catch (Common::Exception &e) {
throw e;
throw;
}
}

Expand All @@ -805,7 +805,7 @@ void NCSFile::o_ushright(InstructionType type) {
int32 arg2 = _stack.pop().getInt();
_stack.push(arg2 >> arg1);
} catch (Common::Exception &e) {
throw e;
throw;
}
}

Expand All @@ -824,7 +824,7 @@ void NCSFile::o_mod(InstructionType type) {

_stack.push(arg2 % arg1);
} catch (Common::Exception &e) {
throw e;
throw;
}
}

Expand All @@ -834,15 +834,15 @@ void NCSFile::o_neg(InstructionType type) {
try {
_stack.push(-_stack.pop().getInt());
} catch (Common::Exception &e) {
throw e;
throw;
}
break;

case kInstTypeFloat:
try {
_stack.push(-_stack.pop().getFloat());
} catch (Common::Exception &e) {
throw e;
throw;
}
break;

Expand All @@ -858,7 +858,7 @@ void NCSFile::o_comp(InstructionType type) {
try {
_stack.push(~_stack.pop().getInt());
} catch (Common::Exception &e) {
throw e;
throw;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/aurora/resman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ void ResourceManager::mergeKEYBIF(const KEYFile &key, std::vector<Common::UStrin
delete curBIF;

e.add("Failed opening needed BIFs");
throw e;
throw;
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/aurora/rimfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void RIMFile::load() {

} catch (Common::Exception &e) {
e.add("Failed reading RIM file");
throw e;
throw;
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/aurora/ssffile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void SSFFile::load(Common::SeekableReadStream &ssf) {

} catch (Common::Exception &e) {
e.add("Failed reading SSF file");
throw e;
throw;
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/aurora/talktable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void TalkTable::load() {

} catch (Common::Exception &e) {
e.add("Failed reading TLK file");
throw e;
throw;
}

}
Expand Down

0 comments on commit b7b2c3e

Please sign in to comment.