[Scummvm-cvs-logs] CVS: scummvm/common gameDetector.cpp,1.96,1.97 main.cpp,1.27,1.28 scummsys.h,1.23,1.24 str.cpp,1.15,1.16 str.h,1.10,1.11 util.cpp,1.13,1.14 util.h,1.16,1.17

Max Horn fingolfin at users.sourceforge.net
Wed May 21 09:57:09 CEST 2003


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv7699

Modified Files:
	gameDetector.cpp main.cpp scummsys.h str.cpp str.h util.cpp 
	util.h 
Log Message:
pedantic fixes

Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- gameDetector.cpp	19 May 2003 20:34:41 -0000	1.96
+++ gameDetector.cpp	21 May 2003 16:56:45 -0000	1.97
@@ -104,7 +104,7 @@
 	{"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::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;

Index: main.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/main.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- main.cpp	20 May 2003 12:25:11 -0000	1.27
+++ main.cpp	21 May 2003 16:56:45 -0000	1.28
@@ -62,7 +62,7 @@
 
 #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
 

Index: scummsys.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scummsys.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- scummsys.h	20 May 2003 12:25:11 -0000	1.23
+++ scummsys.h	21 May 2003 16:56:45 -0000	1.24
@@ -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]);
 	}
 

Index: str.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/str.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- str.cpp	6 Mar 2003 21:45:29 -0000	1.15
+++ str.cpp	21 May 2003 16:56:45 -0000	1.16
@@ -59,7 +59,7 @@
 	}
 }
 
-String::String(const String &str) {
+String::String(const String &str) : ConstString() {
 	++(*str._refCount);
 
 	_refCount = str._refCount;

Index: str.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/str.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- str.h	6 Mar 2003 21:45:29 -0000	1.10
+++ str.h	21 May 2003 16:56:45 -0000	1.11
@@ -49,7 +49,7 @@
 
 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;

Index: util.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/util.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- util.cpp	4 May 2003 13:46:06 -0000	1.13
+++ util.cpp	21 May 2003 16:56:45 -0000	1.14
@@ -85,7 +85,7 @@
 //
 // 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++)

Index: util.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/util.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- util.h	17 May 2003 23:36:47 -0000	1.16
+++ util.h	21 May 2003 16:56:45 -0000	1.17
@@ -42,7 +42,7 @@
 
 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





More information about the Scummvm-git-logs mailing list