From ba8bc2e40b94aa6055222550651452c3645c2515 Mon Sep 17 00:00:00 2001 From: uruk Date: Sun, 8 Jun 2014 12:55:19 +0200 Subject: CGE2: Rework empty-checks of strings. --- engines/cge2/cge2_main.cpp | 4 ++-- engines/cge2/hero.cpp | 2 +- engines/cge2/map.cpp | 2 +- engines/cge2/talk.cpp | 2 +- engines/cge2/vga13h.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index e256d72db6..20b16fa227 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -168,7 +168,7 @@ void CGE2Engine::loadSprite(const char *fname, int ref, int scene, V3D &pos) { Common::String line; for (line = sprf.readLine(); !sprf.eos(); line = sprf.readLine()){ - if (line.size() == 0) + if (line.empty()) continue; Common::strlcpy(tmpStr, line.c_str(), sizeof(tmpStr)); @@ -313,7 +313,7 @@ void CGE2Engine::loadScript(const char *fname) { Common::String line; for (line = scrf.readLine(); !scrf.eos(); line = scrf.readLine()) { - if (line.size() == 0) + if (line.empty()) continue; char *p; diff --git a/engines/cge2/hero.cpp b/engines/cge2/hero.cpp index 62568aecaa..de0dc2688a 100644 --- a/engines/cge2/hero.cpp +++ b/engines/cge2/hero.cpp @@ -92,7 +92,7 @@ Sprite *Hero::expand() { // It's very similar to Sprite's expand, but doesn't bo int maxnxt = 0; for (line = sprf.readLine(); !sprf.eos(); line = sprf.readLine()) { - if (line.size() == 0) + if (line.empty()) continue; Common::strlcpy(tmpStr, line.c_str(), sizeof(tmpStr)); diff --git a/engines/cge2/map.cpp b/engines/cge2/map.cpp index 579f44b681..6dbf57f08d 100644 --- a/engines/cge2/map.cpp +++ b/engines/cge2/map.cpp @@ -52,7 +52,7 @@ void Map::load(int scene) { Common::String line; for (line = file.readLine(); !file.eos(); line = file.readLine()) { - if (line.size() == 0) + if (line.empty()) continue; char tmpStr[kLineMax + 1]; diff --git a/engines/cge2/talk.cpp b/engines/cge2/talk.cpp index ee4a675fc3..acadd2e001 100644 --- a/engines/cge2/talk.cpp +++ b/engines/cge2/talk.cpp @@ -81,7 +81,7 @@ void Font::load() { int n = 0; for (line = colorFile.readLine(); !colorFile.eos(); line = colorFile.readLine()){ - if (line.size() == 0) + if (line.empty()) continue; Common::strlcpy(tmpStr, line.c_str(), sizeof(tmpStr)); diff --git a/engines/cge2/vga13h.cpp b/engines/cge2/vga13h.cpp index 60323913a8..7da9535030 100644 --- a/engines/cge2/vga13h.cpp +++ b/engines/cge2/vga13h.cpp @@ -246,7 +246,7 @@ Sprite *Sprite::expand() { char tmpStr[kLineMax + 1]; for (line = sprf.readLine(); !sprf.eos(); line = sprf.readLine()) { - if (line.size() == 0) + if (line.empty()) continue; Common::strlcpy(tmpStr, line.c_str(), sizeof(tmpStr)); -- cgit v1.2.3