diff options
author | Einar Johan Trøan Sømåen | 2012-07-28 23:10:33 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-07-28 23:10:33 +0200 |
commit | e841bf16d6b955f779e5e30535848bd650d22352 (patch) | |
tree | 843b29df10e35a22304faec81fab929251509d45 /engines/wintermute/base | |
parent | e08a0d84a2dd4ebb312fc72b9757c303e351dbb1 (diff) | |
download | scummvm-rg350-e841bf16d6b955f779e5e30535848bd650d22352.tar.gz scummvm-rg350-e841bf16d6b955f779e5e30535848bd650d22352.tar.bz2 scummvm-rg350-e841bf16d6b955f779e5e30535848bd650d22352.zip |
WINTERMUTE: Fix a few warnings pointed out by fuzzie.
Diffstat (limited to 'engines/wintermute/base')
-rw-r--r-- | engines/wintermute/base/base_file_manager.cpp | 3 | ||||
-rw-r--r-- | engines/wintermute/base/base_region.h | 3 | ||||
-rw-r--r-- | engines/wintermute/base/base_registry.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/base/base_surface_storage.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/base/file/base_package.cpp | 6 | ||||
-rw-r--r-- | engines/wintermute/base/font/base_font_bitmap.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp | 5 |
7 files changed, 13 insertions, 10 deletions
diff --git a/engines/wintermute/base/base_file_manager.cpp b/engines/wintermute/base/base_file_manager.cpp index 5bad96d65e..7fe7b3ab98 100644 --- a/engines/wintermute/base/base_file_manager.cpp +++ b/engines/wintermute/base/base_file_manager.cpp @@ -269,8 +269,9 @@ Common::SeekableReadStream *BaseFileManager::openPkgFile(const Common::String &f bool BaseFileManager::hasFile(const Common::String &filename) {
if (scumm_strnicmp(filename.c_str(), "savegame:", 9) == 0) {
BasePersistenceManager pm(_gameRef);
- if (filename.size() < 9)
+ if (filename.size() <= 9) {
return false;
+ }
int slot = atoi(filename.c_str() + 9);
return pm.getSaveExists(slot);
}
diff --git a/engines/wintermute/base/base_region.h b/engines/wintermute/base/base_region.h index 3b4b28030d..7770d345f7 100644 --- a/engines/wintermute/base/base_region.h +++ b/engines/wintermute/base/base_region.h @@ -54,7 +54,8 @@ public: bool loadBuffer(byte *buffer, bool complete = true);
Rect32 _rect;
BaseArray<BasePoint *> _points;
- virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent, const char *nameOverride = NULL);
+ virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent) { return saveAsText(buffer, indent, NULL); }
+ virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent, const char *nameOverride);
// scripting interface
virtual ScValue *scGetProperty(const char *name);
diff --git a/engines/wintermute/base/base_registry.cpp b/engines/wintermute/base/base_registry.cpp index 2b6127bd09..afaa01f06d 100644 --- a/engines/wintermute/base/base_registry.cpp +++ b/engines/wintermute/base/base_registry.cpp @@ -220,7 +220,7 @@ void BaseRegistry::loadXml(const AnsiString fileName, PathValueMap &values) { stream->read(data, stream->size());
TiXmlDocument doc;
doc.Parse(data);
- delete data;
+ delete[] data;
TiXmlElement *rootElem = doc.RootElement();
if (!rootElem || Common::String(rootElem->Value()) != "Settings") { // TODO: Avoid this strcmp-use. (Hack for now, since we might drop TinyXML all together)
diff --git a/engines/wintermute/base/base_surface_storage.cpp b/engines/wintermute/base/base_surface_storage.cpp index 63e14aa543..c01c86c009 100644 --- a/engines/wintermute/base/base_surface_storage.cpp +++ b/engines/wintermute/base/base_surface_storage.cpp @@ -73,7 +73,7 @@ bool BaseSurfaceStorage::initLoop() { break;
}
- if (_surfaces[i]->_lifeTime > 0 && (int)(_surfaces[i]->_valid && _gameRef->_liveTimer - _surfaces[i]->_lastUsedTime) >= _surfaces[i]->_lifeTime) {
+ if (_surfaces[i]->_lifeTime > 0 && _surfaces[i]->_valid && (int)(_gameRef->_liveTimer - _surfaces[i]->_lastUsedTime) >= _surfaces[i]->_lifeTime) {
//_gameRef->QuickMessageForm("Invalidating: %s", _surfaces[i]->_filename);
_surfaces[i]->invalidate();
}
diff --git a/engines/wintermute/base/file/base_package.cpp b/engines/wintermute/base/file/base_package.cpp index 80d3b4a515..ab74810d1d 100644 --- a/engines/wintermute/base/file/base_package.cpp +++ b/engines/wintermute/base/file/base_package.cpp @@ -169,7 +169,7 @@ PackageSet::PackageSet(Common::FSNode file, const Common::String &filename, bool for (uint32 j = 0; j < numFiles; j++) {
char *name;
- uint32 offset, length, compLength, flags, timeDate1, timeDate2;
+ uint32 offset, length, compLength, flags;/*, timeDate1, timeDate2;*/
nameLength = stream->readByte();
name = new char[nameLength];
@@ -195,8 +195,8 @@ PackageSet::PackageSet(Common::FSNode file, const Common::String &filename, bool flags = stream->readUint32LE();
if (hdr._packageVersion == PACKAGE_VERSION) {
- timeDate1 = stream->readUint32LE();
- timeDate2 = stream->readUint32LE();
+ /* timeDate1 = */ stream->readUint32LE();
+ /* timeDate2 = */ stream->readUint32LE();
}
_filesIter = _files.find(upcName);
if (_filesIter == _files.end()) {
diff --git a/engines/wintermute/base/font/base_font_bitmap.cpp b/engines/wintermute/base/font/base_font_bitmap.cpp index 046ab77333..e2c5fa881c 100644 --- a/engines/wintermute/base/font/base_font_bitmap.cpp +++ b/engines/wintermute/base/font/base_font_bitmap.cpp @@ -371,7 +371,7 @@ bool BaseFontBitmap::loadBuffer(byte *buffer) { case TOKEN_WIDTHS:
parser.scanStr(params, "%D", widths, &num);
- for (i = 0; lastWidth < NUM_CHARACTERS, num > 0; lastWidth++, num--, i++) {
+ for (i = 0; lastWidth < NUM_CHARACTERS && num > 0; lastWidth++, num--, i++) {
_widths[lastWidth] = (byte)widths[i];
}
break;
diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp index 5102d182f9..d3209cb1c0 100644 --- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp @@ -394,12 +394,13 @@ bool BaseSurfaceOSystem::drawSprite(int x, int y, Rect32 *rect, float zoomX, flo // TODO: This actually requires us to have the SAME source-offsets every time,
// But no checking is in place for that yet.
- bool hasAlpha;
+ // TODO: Optimize by not doing alpha-blits if we lack or disable alpha
+/* bool hasAlpha;
if (_hasAlpha && !alphaDisable) {
hasAlpha = true;
} else {
hasAlpha = false;
- }
+ }*/
if (alphaDisable) {
warning("BaseSurfaceOSystem::drawSprite - AlphaDisable ignored");
}
|