mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-31 16:03:24 +00:00
pedantic fixes
svn-id: r7789
This commit is contained in:
parent
72d6179c47
commit
24005adfd0
@ -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 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) {
|
void OSystem_SDL_Common::mk_checksums(const byte *buf) {
|
||||||
uint32 *sums = _dirty_checksums;
|
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) {
|
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(w <= MAX_MOUSE_W);
|
||||||
assert(0 <= h && h <= MAX_MOUSE_H);
|
assert(h <= MAX_MOUSE_H);
|
||||||
_mouseCurState.w = w;
|
_mouseCurState.w = w;
|
||||||
_mouseCurState.h = h;
|
_mouseCurState.h = h;
|
||||||
|
|
||||||
_mouseHotspotX = hotspot_x;
|
_mouseHotspotX = hotspot_x;
|
||||||
_mouseHotspotY = hotspot_y;
|
_mouseHotspotY = hotspot_y;
|
||||||
|
|
||||||
_mouseData = (byte *)buf;
|
_mouseData = buf;
|
||||||
|
|
||||||
undraw_mouse();
|
undraw_mouse();
|
||||||
}
|
}
|
||||||
@ -827,7 +827,7 @@ bool OSystem_SDL_Common::poll_event(Event *event) {
|
|||||||
return false;
|
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;
|
SDL_AudioSpec desired;
|
||||||
|
|
||||||
memset(&desired, 0, sizeof(desired));
|
memset(&desired, 0, sizeof(desired));
|
||||||
@ -897,7 +897,7 @@ void OSystem_SDL_Common::draw_mouse() {
|
|||||||
int w = _mouseCurState.w;
|
int w = _mouseCurState.w;
|
||||||
int h = _mouseCurState.h;
|
int h = _mouseCurState.h;
|
||||||
byte color;
|
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
|
// clip the mouse rect, and addjust the src pointer accordingly
|
||||||
if (x < 0) {
|
if (x < 0) {
|
||||||
|
@ -190,7 +190,7 @@ protected:
|
|||||||
|
|
||||||
bool _mouseVisible;
|
bool _mouseVisible;
|
||||||
bool _mouseDrawn;
|
bool _mouseDrawn;
|
||||||
byte *_mouseData;
|
const byte *_mouseData;
|
||||||
byte *_mouseBackup;
|
byte *_mouseBackup;
|
||||||
MousePos _mouseCurState;
|
MousePos _mouseCurState;
|
||||||
MousePos _mouseOldState;
|
MousePos _mouseOldState;
|
||||||
|
@ -104,7 +104,7 @@ static const struct GraphicsMode gfx_modes[] = {
|
|||||||
{"flipping", "Page Flipping", GFX_FLIPPING},
|
{"flipping", "Page Flipping", GFX_FLIPPING},
|
||||||
{"dbuffer", "Double Buffer", GFX_DOUBLEBUFFER},
|
{"dbuffer", "Double Buffer", GFX_DOUBLEBUFFER},
|
||||||
#endif
|
#endif
|
||||||
{0, 0}
|
{0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct Language languages[] = {
|
static const struct Language languages[] = {
|
||||||
@ -579,18 +579,18 @@ bool GameDetector::parseMusicDriver(const char *s) {
|
|||||||
|
|
||||||
bool GameDetector::detectGame() {
|
bool GameDetector::detectGame() {
|
||||||
const VersionSettings *gnl = version_settings;
|
const VersionSettings *gnl = version_settings;
|
||||||
char *realGame, *basename;
|
const char *realGame, *basename;
|
||||||
_gameId = 0;
|
_gameId = 0;
|
||||||
_gameText.clear();
|
_gameText.clear();
|
||||||
|
|
||||||
if (!(realGame = (char *)g_config->get("gameid")))
|
if (!(realGame = g_config->get("gameid")))
|
||||||
realGame = (char *)_gameFileName.c_str();
|
realGame = _gameFileName.c_str();
|
||||||
printf("Looking for %s\n", realGame);
|
printf("Looking for %s\n", realGame);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (!scumm_stricmp(realGame, gnl->filename)) {
|
if (!scumm_stricmp(realGame, gnl->filename)) {
|
||||||
_gameId = gnl->id;
|
_gameId = gnl->id;
|
||||||
if ((basename = (char *)g_config->get("basename")))
|
if ((basename = g_config->get("basename")))
|
||||||
_gameRealName = basename;
|
_gameRealName = basename;
|
||||||
else
|
else
|
||||||
_gameRealName = gnl->filename;
|
_gameRealName = gnl->filename;
|
||||||
|
@ -62,7 +62,7 @@ extern "C" int main(int argc, char *argv[]);
|
|||||||
|
|
||||||
#ifndef SCUMM_NEED_ALIGNMENT
|
#ifndef SCUMM_NEED_ALIGNMENT
|
||||||
static void handle_errors(int sig_num) {
|
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
|
#endif
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@
|
|||||||
|
|
||||||
#define TO_BE_32(a) SWAP_BYTES(a)
|
#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)
|
#elif defined(SCUMM_BIG_ENDIAN)
|
||||||
|
|
||||||
@ -368,42 +368,42 @@
|
|||||||
#define MKID_BE(a) (a)
|
#define MKID_BE(a) (a)
|
||||||
//#define MKID_BE(a) SWAP_BYTES(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) \
|
return ((a >> 24) & 0xFF) + ((a >> 8) & 0xFF00) + (( a<< 8) & 0xFF0000) \
|
||||||
+ ((a<<24)&0xFF000000);
|
+ ((a<<24)&0xFF000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 FORCEINLINE FROM_LE_16(uint16 a) {
|
FORCEINLINE uint16 FROM_LE_16(uint16 a) {
|
||||||
return ((a >> 8) & 0xFF) + ((a << 8) & 0xFF00);
|
return ((a >> 8) & 0xFF) + ((a << 8) & 0xFF00);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TO_LE_32 FROM_LE_32
|
#define TO_LE_32 FROM_LE_32
|
||||||
#define TO_LE_16 FROM_LE_16
|
#define TO_LE_16 FROM_LE_16
|
||||||
|
|
||||||
uint32 FORCEINLINE READ_LE_UINT32(const void *ptr) {
|
FORCEINLINE uint32 READ_LE_UINT32(const void *ptr) {
|
||||||
byte *b = (byte *)ptr;
|
const byte *b = (const byte *)ptr;
|
||||||
return (b[3] << 24) + (b[2] << 16) + (b[1] << 8) + (b[0]);
|
return (b[3] << 24) + (b[2] << 16) + (b[1] << 8) + (b[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 FORCEINLINE READ_BE_UINT32(const void *ptr) {
|
FORCEINLINE uint32 READ_BE_UINT32(const void *ptr) {
|
||||||
return *(uint32 *)(ptr);
|
return *(const uint32 *)(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint FORCEINLINE READ_LE_UINT16(const void *ptr) {
|
FORCEINLINE uint READ_LE_UINT16(const void *ptr) {
|
||||||
byte *b = (byte *)ptr;
|
const byte *b = (const byte *)ptr;
|
||||||
return (b[1] << 8) + b[0];
|
return (b[1] << 8) + b[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
uint FORCEINLINE READ_BE_UINT16(const void *ptr) {
|
FORCEINLINE uint READ_BE_UINT16(const void *ptr) {
|
||||||
return *(uint16 *)(ptr);
|
return *(const uint16 *)(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint FORCEINLINE READ_BE_UINT16_UNALIGNED(const void *ptr) {
|
FORCEINLINE uint READ_BE_UINT16_UNALIGNED(const void *ptr) {
|
||||||
return (((byte *)ptr)[0] << 8)|((byte *)ptr)[1];
|
return (((const byte *)ptr)[0] << 8)|((const byte *)ptr)[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 FORCEINLINE READ_BE_UINT32_UNALIGNED(const void *ptr) {
|
FORCEINLINE uint32 READ_BE_UINT32_UNALIGNED(const void *ptr) {
|
||||||
byte *b = (byte*)ptr;
|
const byte *b = (const byte*)ptr;
|
||||||
return (b[0] << 24) + (b[1] << 16) + (b[2] << 8) + (b[3]);
|
return (b[0] << 24) + (b[1] << 16) + (b[2] << 8) + (b[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ String::String(const ConstString &str) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String::String(const String &str) {
|
String::String(const String &str) : ConstString() {
|
||||||
++(*str._refCount);
|
++(*str._refCount);
|
||||||
|
|
||||||
_refCount = str._refCount;
|
_refCount = str._refCount;
|
||||||
|
@ -49,7 +49,7 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
ConstString() : _str(0), _len(0) {}
|
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() {}
|
virtual ~ConstString() {}
|
||||||
|
|
||||||
bool operator ==(const ConstString &x) const;
|
bool operator ==(const ConstString &x) const;
|
||||||
|
@ -85,7 +85,7 @@ int Blend(int src, int dst, byte *palette) {
|
|||||||
//
|
//
|
||||||
// Reset the blending cache
|
// Reset the blending cache
|
||||||
//
|
//
|
||||||
void ClearBlendCache(byte *palette, int weight) {
|
void ClearBlendCache() {
|
||||||
#ifndef NEWGUI_256
|
#ifndef NEWGUI_256
|
||||||
for (int i = 0; i < 256; i++)
|
for (int i = 0; i < 256; i++)
|
||||||
for (int j = 0 ; j < 256 ; j++)
|
for (int j = 0 ; j < 256 ; j++)
|
||||||
|
@ -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 RGBMatch(byte *palette, int r, int g, int b);
|
||||||
int Blend(int src, int dst, byte *palette);
|
int Blend(int src, int dst, byte *palette);
|
||||||
void ClearBlendCache(byte *palette, int weight);
|
void ClearBlendCache();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Print hexdump of the data passed in
|
* Print hexdump of the data passed in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user