aboutsummaryrefslogtreecommitdiff
path: root/graphics/sjis.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2014-01-17 17:48:16 -0800
committerJohannes Schickel2014-01-17 17:48:16 -0800
commit417064e3116e9fbb5737f7f9f13acc54b914e7be (patch)
treee065882eaab8bf35ad436a9a6273605c78bab450 /graphics/sjis.cpp
parentb23f7640289fc1203d5e8ad3f27a24c403bcc4b3 (diff)
parentac4087856f02725c288e1cef6b089acf7a6121aa (diff)
downloadscummvm-rg350-417064e3116e9fbb5737f7f9f13acc54b914e7be.tar.gz
scummvm-rg350-417064e3116e9fbb5737f7f9f13acc54b914e7be.tar.bz2
scummvm-rg350-417064e3116e9fbb5737f7f9f13acc54b914e7be.zip
Merge pull request #417 from digitall/STACK_fixes
ALL: Fix optimization unstable code on checking for null after new.
Diffstat (limited to 'graphics/sjis.cpp')
-rw-r--r--graphics/sjis.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/graphics/sjis.cpp b/graphics/sjis.cpp
index 33f0e562cb..59ee5af8c4 100644
--- a/graphics/sjis.cpp
+++ b/graphics/sjis.cpp
@@ -40,31 +40,25 @@ FontSJIS *FontSJIS::createFont(const Common::Platform platform) {
// Try the font ROM of the specified platform
if (platform == Common::kPlatformFMTowns) {
ret = new FontTowns();
- if (ret) {
- if (ret->loadData())
- return ret;
- }
+ if (ret->loadData())
+ return ret;
delete ret;
} else if (platform == Common::kPlatformPCEngine) {
ret = new FontPCEngine();
- if (ret) {
- if (ret->loadData())
- return ret;
- }
+ if (ret->loadData())
+ return ret;
delete ret;
} // TODO: PC98 font rom support
/* else if (platform == Common::kPlatformPC98) {
ret = new FontPC98();
- if (ret) {
- if (ret->loadData())
- return ret;
- }
+ if (ret->loadData())
+ return ret;
delete ret;
}*/
// Try ScummVM's font.
ret = new FontSjisSVM(platform);
- if (ret && ret->loadData())
+ if (ret->loadData())
return ret;
delete ret;