pedantic fixes

svn-id: r7789
This commit is contained in:
Max Horn 2003-05-21 16:59:51 +00:00
parent 72d6179c47
commit 24005adfd0
9 changed files with 32 additions and 32 deletions

View File

@ -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) {

View File

@ -190,7 +190,7 @@ protected:
bool _mouseVisible;
bool _mouseDrawn;
byte *_mouseData;
const byte *_mouseData;
byte *_mouseBackup;
MousePos _mouseCurState;
MousePos _mouseOldState;

View File

@ -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;

View File

@ -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

View File

@ -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]);
}

View File

@ -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;

View File

@ -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;

View File

@ -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++)

View File

@ -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