diff options
| author | Max Horn | 2003-05-21 16:59:51 +0000 |
|---|---|---|
| committer | Max Horn | 2003-05-21 16:59:51 +0000 |
| commit | 24005adfd0aa31373332cdd7d0a45c8a0627e3d7 (patch) | |
| tree | 8204c9d45a603340e426f87738a7cdffc9f2b270 | |
| parent | 72d6179c470fc99a05942110fe5338f7b42181dc (diff) | |
| download | scummvm-rg350-24005adfd0aa31373332cdd7d0a45c8a0627e3d7.tar.gz scummvm-rg350-24005adfd0aa31373332cdd7d0a45c8a0627e3d7.tar.bz2 scummvm-rg350-24005adfd0aa31373332cdd7d0a45c8a0627e3d7.zip | |
pedantic fixes
svn-id: r7789
| -rw-r--r-- | backends/sdl/sdl-common.cpp | 12 | ||||
| -rw-r--r-- | backends/sdl/sdl-common.h | 2 | ||||
| -rw-r--r-- | common/gameDetector.cpp | 10 | ||||
| -rw-r--r-- | common/main.cpp | 2 | ||||
| -rw-r--r-- | common/scummsys.h | 30 | ||||
| -rw-r--r-- | common/str.cpp | 2 | ||||
| -rw-r--r-- | common/str.h | 2 | ||||
| -rw-r--r-- | common/util.cpp | 2 | ||||
| -rw-r--r-- | common/util.h | 2 |
9 files changed, 32 insertions, 32 deletions
diff --git a/backends/sdl/sdl-common.cpp b/backends/sdl/sdl-common.cpp index 2e4748b415..78820dc27b 100644 --- a/backends/sdl/sdl-common.cpp +++ b/backends/sdl/sdl-common.cpp @@ -295,7 +295,7 @@ void OSystem_SDL_Common::add_dirty_rect(int x, int y, int w, int h) { } #define ROL(a,n) a = (a << (n)) | (a >> (32 - (n))) -#define DOLINE(x) a ^= ((uint32*)buf)[0 + (x) * (_screenWidth / 4)]; b ^= ((uint32 *)buf)[1 + (x) * (_screenWidth / 4)] +#define DOLINE(x) a ^= ((const uint32*)buf)[0 + (x) * (_screenWidth / 4)]; b ^= ((const uint32 *)buf)[1 + (x) * (_screenWidth / 4)] void OSystem_SDL_Common::mk_checksums(const byte *buf) { uint32 *sums = _dirty_checksums; @@ -471,15 +471,15 @@ void OSystem_SDL_Common::warp_mouse(int x, int y) { } void OSystem_SDL_Common::set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) { - assert(0 <= w && w <= MAX_MOUSE_W); - assert(0 <= h && h <= MAX_MOUSE_H); + assert(w <= MAX_MOUSE_W); + assert(h <= MAX_MOUSE_H); _mouseCurState.w = w; _mouseCurState.h = h; _mouseHotspotX = hotspot_x; _mouseHotspotY = hotspot_y; - _mouseData = (byte *)buf; + _mouseData = buf; undraw_mouse(); } @@ -827,7 +827,7 @@ bool OSystem_SDL_Common::poll_event(Event *event) { return false; } -bool OSystem_SDL_Common::set_sound_proc(void *param, SoundProc *proc, byte format) { +bool OSystem_SDL_Common::set_sound_proc(void *param, SoundProc *proc, byte /* format */) { SDL_AudioSpec desired; memset(&desired, 0, sizeof(desired)); @@ -897,7 +897,7 @@ void OSystem_SDL_Common::draw_mouse() { int w = _mouseCurState.w; int h = _mouseCurState.h; byte color; - byte *src = _mouseData; // Image representing the mouse + const byte *src = _mouseData; // Image representing the mouse // clip the mouse rect, and addjust the src pointer accordingly if (x < 0) { diff --git a/backends/sdl/sdl-common.h b/backends/sdl/sdl-common.h index 08202869d1..65bf00130b 100644 --- a/backends/sdl/sdl-common.h +++ b/backends/sdl/sdl-common.h @@ -190,7 +190,7 @@ protected: bool _mouseVisible; bool _mouseDrawn; - byte *_mouseData; + const byte *_mouseData; byte *_mouseBackup; MousePos _mouseCurState; MousePos _mouseOldState; 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 |
