diff options
author | Max Horn | 2006-07-23 15:08:48 +0000 |
---|---|---|
committer | Max Horn | 2006-07-23 15:08:48 +0000 |
commit | 4fcdbb93497d30de4c0fc606b3bbddeabdbb4746 (patch) | |
tree | 9c6b98d81c004a191e0c00fa8651e02eab98e593 | |
parent | 602548cea32612c791ba1951e21f0bdc87ae616d (diff) | |
download | scummvm-rg350-4fcdbb93497d30de4c0fc606b3bbddeabdbb4746.tar.gz scummvm-rg350-4fcdbb93497d30de4c0fc606b3bbddeabdbb4746.tar.bz2 scummvm-rg350-4fcdbb93497d30de4c0fc606b3bbddeabdbb4746.zip |
String class usage cleanup
svn-id: r23582
-rw-r--r-- | common/hashmap.cpp | 5 | ||||
-rw-r--r-- | engines/gob/gob.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/resource.cpp | 4 | ||||
-rw-r--r-- | gui/ThemeClassic.cpp | 2 | ||||
-rw-r--r-- | gui/ThemeNew.cpp | 4 | ||||
-rw-r--r-- | gui/newgui.cpp | 2 |
6 files changed, 9 insertions, 12 deletions
diff --git a/common/hashmap.cpp b/common/hashmap.cpp index fe95d4dc45..9e3ca2292a 100644 --- a/common/hashmap.cpp +++ b/common/hashmap.cpp @@ -57,21 +57,16 @@ namespace Common { uint hashit(const char *p) { uint hash = 0; byte c; - - hash = 0; while ((c = *p++)) hash = (hash * 31 + c); - return hash; } uint hashit_lower(const char *p) { uint hash = 0; byte c; - while ((c = *p++)) hash = (hash * 31 + tolower(c)); - return hash; } diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index 2629286b01..6d5841502b 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -47,6 +47,8 @@ #include "gob/util.h" #include "gob/music.h" +#include "sound/mididrv.h" + namespace Gob { enum { @@ -228,7 +230,7 @@ int GobEngine::init() { else error("GobEngine::init(): Unknown version of game engine"); if ((_features & Gob::GF_MAC) || (_features & Gob::GF_GOB1) || (_features & Gob::GF_GOB2)) { - if (ConfMan.get("music_driver") == "null") + if (MidiDriver::parseMusicDriver(ConfMan.get("music_driver")) == MD_NULL) _music = new Music_Dummy(this); else _music = new Music(this); diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index 12f671c770..e9b9e91508 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -373,12 +373,12 @@ uint32 PAKFile::getFileSize(const char* file) { bool PAKFile::openFile(Common::File &filehandle) { filehandle.close(); - if (!filehandle.open(_physfile == "" ? _filename : _physfile)) { + if (!filehandle.open(_physfile.empty() ? _filename : _physfile)) { debug(3, "couldn't open pakfile '%s'\n", _filename.c_str()); return false; } - if (_physfile != "") { + if (!_physfile.empty()) { filehandle.seek(_physOffset, SEEK_CUR); } diff --git a/gui/ThemeClassic.cpp b/gui/ThemeClassic.cpp index 9c36463fd2..babb03b24d 100644 --- a/gui/ThemeClassic.cpp +++ b/gui/ThemeClassic.cpp @@ -296,7 +296,7 @@ void ThemeClassic::drawPopUpWidget(const Common::Rect &r, const Common::String & _screen.drawLine(p0.x, p1.y, p1.x, p1.y, color); } - if (sel != "") { + if (!sel.empty()) { Common::Rect text(r.left + 2, r.top + 3, r.right - 4, r.top + 3 + _font->getFontHeight()); _font->drawString(&_screen, sel, text.left, text.top, text.width(), color, convertAligment(align), deltax, false); } diff --git a/gui/ThemeNew.cpp b/gui/ThemeNew.cpp index e50589f554..b1dd95da72 100644 --- a/gui/ThemeNew.cpp +++ b/gui/ThemeNew.cpp @@ -1309,7 +1309,7 @@ const Graphics::Font *ThemeNew::loadFont(const char *filename) { Common::String cacheFilename = genCacheFilename(filename); Common::File fontFile; - if (cacheFilename != "") { + if (!cacheFilename.empty()) { if (fontFile.open(cacheFilename)) font = Graphics::NewFont::loadFromCache(fontFile); if (font) @@ -1368,7 +1368,7 @@ const Graphics::Font *ThemeNew::loadFont(const char *filename) { #endif if (font) { - if (cacheFilename != "") { + if (!cacheFilename.empty()) { if (!Graphics::NewFont::cacheFontData(*font, cacheFilename)) { warning("Couldn't create cache file for font '%s'", filename); } diff --git a/gui/newgui.cpp b/gui/newgui.cpp index 819b6728f7..14aeff06c1 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -60,7 +60,7 @@ GuiObject::GuiObject(const Common::String &name) : _firstWidget(0) { } void GuiObject::handleScreenChanged() { - if (_name != "") { + if (!_name.empty()) { if ((_x = g_gui.evaluator()->getVar(_name + ".x")) == EVAL_UNDEF_VAR) error("Undefined variable %s.x", _name.c_str()); if ((_y = g_gui.evaluator()->getVar(_name + ".y")) == EVAL_UNDEF_VAR) |