diff options
author | Einar Johan Trøan Sømåen | 2012-06-26 20:46:39 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-06-26 20:46:39 +0200 |
commit | 88a3d91cbd60a4e31194750cf367f8b50620604b (patch) | |
tree | 4a89e4ad5a261dd2856d30f5e17850c35fb13fa2 | |
parent | eb02d6db23bb340f08a24b6c11a300511eec8d7d (diff) | |
download | scummvm-rg350-88a3d91cbd60a4e31194750cf367f8b50620604b.tar.gz scummvm-rg350-88a3d91cbd60a4e31194750cf367f8b50620604b.tar.bz2 scummvm-rg350-88a3d91cbd60a4e31194750cf367f8b50620604b.zip |
WINTERMUTE: Fix a few warnings pointed out by [md5]
-rw-r--r-- | engines/wintermute/Base/BSoundMgr.cpp | 5 | ||||
-rw-r--r-- | engines/wintermute/Base/BSurfaceSDL.h | 2 | ||||
-rw-r--r-- | engines/wintermute/Base/scriptables/ScEngine.cpp | 4 | ||||
-rw-r--r-- | engines/wintermute/utils/PathUtil.cpp | 8 | ||||
-rw-r--r-- | engines/wintermute/utils/StringUtil.cpp | 7 | ||||
-rw-r--r-- | engines/wintermute/utils/crc.cpp | 4 | ||||
-rw-r--r-- | engines/wintermute/utils/crc.h | 2 | ||||
-rw-r--r-- | engines/wintermute/utils/utils.cpp | 2 |
8 files changed, 17 insertions, 17 deletions
diff --git a/engines/wintermute/Base/BSoundMgr.cpp b/engines/wintermute/Base/BSoundMgr.cpp index d9ef81b315..1702bfb8d1 100644 --- a/engines/wintermute/Base/BSoundMgr.cpp +++ b/engines/wintermute/Base/BSoundMgr.cpp @@ -249,7 +249,7 @@ HRESULT CBSoundMgr::setVolumePercent(TSoundType Type, byte Percent) { //////////////////////////////////////////////////////////////////////////
byte CBSoundMgr::getVolumePercent(TSoundType Type) {
- int Volume;
+ int Volume = 0;
switch (Type) {
case SOUND_SFX:
Volume = _volumeSFX;
@@ -260,6 +260,9 @@ byte CBSoundMgr::getVolumePercent(TSoundType Type) { case SOUND_MUSIC:
Volume = _volumeMusic;
break;
+ default:
+ error("Sound-type not set");
+ break;
}
return (byte)Volume;
diff --git a/engines/wintermute/Base/BSurfaceSDL.h b/engines/wintermute/Base/BSurfaceSDL.h index 1c5c3c3e15..eba8b96af8 100644 --- a/engines/wintermute/Base/BSurfaceSDL.h +++ b/engines/wintermute/Base/BSurfaceSDL.h @@ -33,7 +33,7 @@ #include "engines/wintermute/Base/BSurface.h"
namespace WinterMute {
-class TransparentSurface;
+struct TransparentSurface;
class CBSurfaceSDL : public CBSurface {
public:
CBSurfaceSDL(CBGame *inGame);
diff --git a/engines/wintermute/Base/scriptables/ScEngine.cpp b/engines/wintermute/Base/scriptables/ScEngine.cpp index 0835566d2c..473fb487cc 100644 --- a/engines/wintermute/Base/scriptables/ScEngine.cpp +++ b/engines/wintermute/Base/scriptables/ScEngine.cpp @@ -335,7 +335,7 @@ byte *CScEngine::GetCompiledScript(const char *Filename, uint32 *OutSize, bool I // add script to cache
CScCachedScript *CachedScript = new CScCachedScript(Filename, CompBuffer, CompSize);
if (CachedScript) {
- int index;
+ int index = 0;
uint32 MinTime = CBPlatform::GetTime();
for (i = 0; i < MAX_CACHED_SCRIPTS; i++) {
if (_cachedScripts[i] == NULL) {
@@ -446,7 +446,7 @@ HRESULT CScEngine::Tick() { // normal script
else {
- uint32 StartTime;
+ uint32 StartTime = 0;
bool isProfiling = _isProfiling;
if (isProfiling) StartTime = CBPlatform::GetTime();
diff --git a/engines/wintermute/utils/PathUtil.cpp b/engines/wintermute/utils/PathUtil.cpp index ba432019eb..f975ea6199 100644 --- a/engines/wintermute/utils/PathUtil.cpp +++ b/engines/wintermute/utils/PathUtil.cpp @@ -25,9 +25,9 @@ * http://dead-code.org/redir.php?target=wmelite
* Copyright (c) 2011 Jan Nedoma
*/
-#define FORBIDDEN_SYMBOL_EXCEPTION_ifstream
+
#include "engines/wintermute/dcgf.h"
-#include <fstream>
+#include "common/file.h"
#include "PathUtil.h"
#include "StringUtil.h"
@@ -146,10 +146,10 @@ bool PathUtil::MatchesMask(const AnsiString &fileName, const AnsiString &mask) { bool PathUtil::FileExists(const AnsiString &fileName) {
warning("PathUtil::FileExists(%s)", fileName.c_str());
- std::ifstream stream;
+ Common::File stream;
stream.open(fileName.c_str());
- bool ret = stream.is_open();
+ bool ret = stream.isOpen();
stream.close();
return ret;
diff --git a/engines/wintermute/utils/StringUtil.cpp b/engines/wintermute/utils/StringUtil.cpp index 0e273ea84f..d7cc2fde21 100644 --- a/engines/wintermute/utils/StringUtil.cpp +++ b/engines/wintermute/utils/StringUtil.cpp @@ -27,9 +27,6 @@ */
#include "engines/wintermute/dcgf.h"
-#include <algorithm>
-#include <string>
-#include <sstream>
#include "common/tokenizer.h"
#include "StringUtil.h"
#include "ConvertUTF.h"
@@ -38,7 +35,7 @@ namespace WinterMute { //////////////////////////////////////////////////////////////////////////
void StringUtil::ToLowerCase(AnsiString &str) {
- std::transform(str.begin(), str.end(), str.begin(), ::tolower);
+ return str.toUppercase();
}
//////////////////////////////////////////////////////////////////////////
@@ -48,7 +45,7 @@ void StringUtil::ToLowerCase(AnsiString &str) { //////////////////////////////////////////////////////////////////////////
void StringUtil::ToUpperCase(AnsiString &str) {
- std::transform(str.begin(), str.end(), str.begin(), ::toupper);
+ return str.toUppercase();
}
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/wintermute/utils/crc.cpp b/engines/wintermute/utils/crc.cpp index adfd5da624..0bce1c4c51 100644 --- a/engines/wintermute/utils/crc.cpp +++ b/engines/wintermute/utils/crc.cpp @@ -222,9 +222,9 @@ crc crc_initialize(void) { return INITIAL_REMAINDER;
}
-crc crc_process_byte(unsigned char byte, crc remainder) {
+crc crc_process_byte(unsigned char byteVal, crc remainder) {
unsigned char data;
- data = (unsigned char)(REFLECT_DATA(byte) ^ (remainder >> (WIDTH - 8)));
+ data = (unsigned char)(REFLECT_DATA(byteVal) ^ (remainder >> (WIDTH - 8)));
remainder = crcTable[data] ^ (remainder << 8);
return remainder;
}
diff --git a/engines/wintermute/utils/crc.h b/engines/wintermute/utils/crc.h index 578b423de8..cf7ea1a00c 100644 --- a/engines/wintermute/utils/crc.h +++ b/engines/wintermute/utils/crc.h @@ -74,7 +74,7 @@ crc crcSlow(unsigned char const message[], int nBytes); crc crcFast(unsigned char const message[], int nBytes);
extern "C" crc crc_initialize(void);
-extern "C" crc crc_process_byte(unsigned char byte, crc remainder);
+extern "C" crc crc_process_byte(unsigned char byteVal, crc remainder);
extern "C" crc crc_finalize(crc remainder);
diff --git a/engines/wintermute/utils/utils.cpp b/engines/wintermute/utils/utils.cpp index 29c992f1ac..845c2e21c6 100644 --- a/engines/wintermute/utils/utils.cpp +++ b/engines/wintermute/utils/utils.cpp @@ -271,7 +271,7 @@ void CBUtils::RGBtoHSL(uint32 RGBColor, byte *OutH, byte *OutS, byte *OutL) { //Delta RGB value
float del_Max = var_Max - var_Min;
- float H, S, L;
+ float H = 0.0f, S = 0.0f, L = 0.0f;
L = (var_Max + var_Min) / 2.0f;
|