From 24005adfd0aa31373332cdd7d0a45c8a0627e3d7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 21 May 2003 16:59:51 +0000 Subject: pedantic fixes svn-id: r7789 --- common/gameDetector.cpp | 10 +++++----- common/main.cpp | 2 +- common/scummsys.h | 30 +++++++++++++++--------------- common/str.cpp | 2 +- common/str.h | 2 +- common/util.cpp | 2 +- common/util.h | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-) (limited to 'common') diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp index 1815f83043..3257b9885e 100644 --- a/common/gameDetector.cpp +++ b/common/gameDetector.cpp @@ -104,7 +104,7 @@ static const struct GraphicsMode gfx_modes[] = { {"flipping", "Page Flipping", GFX_FLIPPING}, {"dbuffer", "Double Buffer", GFX_DOUBLEBUFFER}, #endif - {0, 0} + {0, 0, 0} }; static const struct Language languages[] = { @@ -579,18 +579,18 @@ bool GameDetector::parseMusicDriver(const char *s) { bool GameDetector::detectGame() { const VersionSettings *gnl = version_settings; - char *realGame, *basename; + const char *realGame, *basename; _gameId = 0; _gameText.clear(); - if (!(realGame = (char *)g_config->get("gameid"))) - realGame = (char *)_gameFileName.c_str(); + if (!(realGame = g_config->get("gameid"))) + realGame = _gameFileName.c_str(); printf("Looking for %s\n", realGame); do { if (!scumm_stricmp(realGame, gnl->filename)) { _gameId = gnl->id; - if ((basename = (char *)g_config->get("basename"))) + if ((basename = g_config->get("basename"))) _gameRealName = basename; else _gameRealName = gnl->filename; diff --git a/common/main.cpp b/common/main.cpp index 58b7b258fe..22236f43d6 100644 --- a/common/main.cpp +++ b/common/main.cpp @@ -62,7 +62,7 @@ extern "C" int main(int argc, char *argv[]); #ifndef SCUMM_NEED_ALIGNMENT static void handle_errors(int sig_num) { - error("Your system does not support unaligned memory accesses. Please rebuild with SCUMM_NEED_ALIGNMENT "); + error("Your system does not support unaligned memory accesses. Please rebuild with SCUMM_NEED_ALIGNMENT (signal %d)", sig_num); } #endif diff --git a/common/scummsys.h b/common/scummsys.h index 1ee3c00452..a7ca0b6b48 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -360,7 +360,7 @@ #define TO_BE_32(a) SWAP_BYTES(a) - uint16 FORCEINLINE TO_BE_16(uint16 a) { return (a >> 8) | (a << 8); } + FORCEINLINE uint16 TO_BE_16(uint16 a) { return (a >> 8) | (a << 8); } #elif defined(SCUMM_BIG_ENDIAN) @@ -368,42 +368,42 @@ #define MKID_BE(a) (a) //#define MKID_BE(a) SWAP_BYTES(a) - uint32 FORCEINLINE FROM_LE_32(uint32 a) { + FORCEINLINE uint32 FROM_LE_32(uint32 a) { return ((a >> 24) & 0xFF) + ((a >> 8) & 0xFF00) + (( a<< 8) & 0xFF0000) \ + ((a<<24)&0xFF000000); } - uint16 FORCEINLINE FROM_LE_16(uint16 a) { + FORCEINLINE uint16 FROM_LE_16(uint16 a) { return ((a >> 8) & 0xFF) + ((a << 8) & 0xFF00); } #define TO_LE_32 FROM_LE_32 #define TO_LE_16 FROM_LE_16 - uint32 FORCEINLINE READ_LE_UINT32(const void *ptr) { - byte *b = (byte *)ptr; + FORCEINLINE uint32 READ_LE_UINT32(const void *ptr) { + const byte *b = (const byte *)ptr; return (b[3] << 24) + (b[2] << 16) + (b[1] << 8) + (b[0]); } - uint32 FORCEINLINE READ_BE_UINT32(const void *ptr) { - return *(uint32 *)(ptr); + FORCEINLINE uint32 READ_BE_UINT32(const void *ptr) { + return *(const uint32 *)(ptr); } - uint FORCEINLINE READ_LE_UINT16(const void *ptr) { - byte *b = (byte *)ptr; + FORCEINLINE uint READ_LE_UINT16(const void *ptr) { + const byte *b = (const byte *)ptr; return (b[1] << 8) + b[0]; } - uint FORCEINLINE READ_BE_UINT16(const void *ptr) { - return *(uint16 *)(ptr); + FORCEINLINE uint READ_BE_UINT16(const void *ptr) { + return *(const uint16 *)(ptr); } - uint FORCEINLINE READ_BE_UINT16_UNALIGNED(const void *ptr) { - return (((byte *)ptr)[0] << 8)|((byte *)ptr)[1]; + FORCEINLINE uint READ_BE_UINT16_UNALIGNED(const void *ptr) { + return (((const byte *)ptr)[0] << 8)|((const byte *)ptr)[1]; } - uint32 FORCEINLINE READ_BE_UINT32_UNALIGNED(const void *ptr) { - byte *b = (byte*)ptr; + FORCEINLINE uint32 READ_BE_UINT32_UNALIGNED(const void *ptr) { + const byte *b = (const byte*)ptr; return (b[0] << 24) + (b[1] << 16) + (b[2] << 8) + (b[3]); } diff --git a/common/str.cpp b/common/str.cpp index 475e5e242d..ea1240adf1 100644 --- a/common/str.cpp +++ b/common/str.cpp @@ -59,7 +59,7 @@ String::String(const ConstString &str) { } } -String::String(const String &str) { +String::String(const String &str) : ConstString() { ++(*str._refCount); _refCount = str._refCount; diff --git a/common/str.h b/common/str.h index 61c89618af..2e95c86e4b 100644 --- a/common/str.h +++ b/common/str.h @@ -49,7 +49,7 @@ protected: public: ConstString() : _str(0), _len(0) {} - ConstString(const char *str, int len = -1) : _str((char *)str) { _len = str ? (len >= 0 ? len : strlen(str)) : 0; } +// ConstString(const char *str, int len = -1) : _str((char *)str) { _len = str ? (len >= 0 ? len : strlen(str)) : 0; } virtual ~ConstString() {} bool operator ==(const ConstString &x) const; diff --git a/common/util.cpp b/common/util.cpp index 1dc9855c6c..a8be442248 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -85,7 +85,7 @@ int Blend(int src, int dst, byte *palette) { // // Reset the blending cache // -void ClearBlendCache(byte *palette, int weight) { +void ClearBlendCache() { #ifndef NEWGUI_256 for (int i = 0; i < 256; i++) for (int j = 0 ; j < 256 ; j++) diff --git a/common/util.h b/common/util.h index f240c534be..4d085734b2 100644 --- a/common/util.h +++ b/common/util.h @@ -42,7 +42,7 @@ static inline void SWAP(T &a, T &b) { T tmp = a; a = b; b = tmp; } int RGBMatch(byte *palette, int r, int g, int b); int Blend(int src, int dst, byte *palette); -void ClearBlendCache(byte *palette, int weight); +void ClearBlendCache(); /* * Print hexdump of the data passed in -- cgit v1.2.3