[Scummvm-cvs-logs] SF.net SVN: scummvm: [21708] scummvm/trunk/engines/kyra

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Apr 8 17:45:03 CEST 2006


Revision: 21708
Author:   fingolfin
Date:     2006-04-08 17:44:08 -0700 (Sat, 08 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21708&view=rev

Log Message:
-----------
Fix const correctness in Kyra's StaticResource::loadStrings and StaticResource::loadPaletteTable (notice the difference between a pointer pointing to a pointer pointing to const memory, vs. a pointer pointing to a *constant* pointer pointing to const memory)

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra.h
    scummvm/trunk/engines/kyra/resource.h
    scummvm/trunk/engines/kyra/staticres.cpp
Modified: scummvm/trunk/engines/kyra/kyra.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra.h	2006-04-09 00:37:20 UTC (rev 21707)
+++ scummvm/trunk/engines/kyra/kyra.h	2006-04-09 00:44:08 UTC (rev 21708)
@@ -275,13 +275,13 @@
 	typedef void (KyraEngine::*IntroProc)();
 	typedef int (KyraEngine::*OpcodeProc)(ScriptState *script);
 
-	const char **seqWSATable() { return _seq_WSATable; }
-	const char **seqCPSTable() { return _seq_CPSTable; }
-	const char **seqCOLTable() { return _seq_COLTable; }
-	const char **seqTextsTable() { return _seq_textsTable; }
+	const char * const*seqWSATable() { return _seq_WSATable; }
+	const char * const*seqCPSTable() { return _seq_CPSTable; }
+	const char * const*seqCOLTable() { return _seq_COLTable; }
+	const char * const*seqTextsTable() { return _seq_textsTable; }
 	
-	const uint8 **palTable1() { return &_specialPalettes[0]; }
-	const uint8 **palTable2() { return &_specialPalettes[29]; }
+	const uint8 * const*palTable1() { return &_specialPalettes[0]; }
+	const uint8 * const*palTable2() { return &_specialPalettes[29]; }
 
 	bool seq_skipSequence() const;
 	void delay(uint32 millis, bool update = false, bool mainLoop = false);
@@ -847,34 +847,34 @@
 	const uint8 *_seq_Demo4;
 	const uint8 *_seq_Reunion;
 	
-	const char **_seq_WSATable;
-	const char **_seq_CPSTable;
-	const char **_seq_COLTable;
-	const char **_seq_textsTable;
+	const char * const*_seq_WSATable;
+	const char * const*_seq_CPSTable;
+	const char * const*_seq_COLTable;
+	const char * const*_seq_textsTable;
 	
 	int _seq_WSATable_Size;
 	int _seq_CPSTable_Size;
 	int _seq_COLTable_Size;
 	int _seq_textsTable_Size;
 	
-	const char **_itemList;
-	const char **_takenList;
-	const char **_placedList;
-	const char **_droppedList;
-	const char **_noDropList;
-	const char **_putDownFirst;
-	const char **_waitForAmulet;
-	const char **_blackJewel;
-	const char **_poisonGone;
-	const char **_healingTip;
-	const char **_thePoison;
-	const char **_fluteString;
-	const char **_wispJewelStrings;
-	const char **_magicJewelString;
-	const char **_flaskFull;
-	const char **_fullFlask;
-	const char **_veryClever;
-	const char **_homeString;
+	const char * const*_itemList;
+	const char * const*_takenList;
+	const char * const*_placedList;
+	const char * const*_droppedList;
+	const char * const*_noDropList;
+	const char * const*_putDownFirst;
+	const char * const*_waitForAmulet;
+	const char * const*_blackJewel;
+	const char * const*_poisonGone;
+	const char * const*_healingTip;
+	const char * const*_thePoison;
+	const char * const*_fluteString;
+	const char * const*_wispJewelStrings;
+	const char * const*_magicJewelString;
+	const char * const*_flaskFull;
+	const char * const*_fullFlask;
+	const char * const*_veryClever;
+	const char * const*_homeString;
 	
 	int _itemList_Size;
 	int _takenList_Size;
@@ -895,7 +895,7 @@
 	int _veryClever_Size;
 	int _homeString_Size;
 	
-	const char **_characterImageTable;
+	const char * const*_characterImageTable;
 	int _characterImageTableSize;
 	
 	Shape *_defaultShapeTable;
@@ -933,12 +933,12 @@
 	
 	Room *_roomTable;
 	int _roomTableSize;
-	const char **_roomFilenameTable;
+	const char * const*_roomFilenameTable;
 	int _roomFilenameTableSize;
 	
 	const uint8 *_amuleteAnim;
 	
-	const uint8 **_specialPalettes;
+	const uint8 * const*_specialPalettes;
 
 	Timer _timers[34];
 	uint32 _timerNextRun;	

Modified: scummvm/trunk/engines/kyra/resource.h
===================================================================
--- scummvm/trunk/engines/kyra/resource.h	2006-04-09 00:37:20 UTC (rev 21707)
+++ scummvm/trunk/engines/kyra/resource.h	2006-04-09 00:44:08 UTC (rev 21708)
@@ -169,11 +169,11 @@
 	bool init();
 	void deinit();
 
-	const char **loadStrings(int id, int &strings);
+	const char * const*loadStrings(int id, int &strings);
 	const uint8 *loadRawData(int id, int &size);
 	const Shape *loadShapeTable(int id, int &entries);
 	const Room *loadRoomTable(int id, int &entries);
-	const uint8 **loadPaletteTable(int id, int &entries);
+	const uint8 * const*loadPaletteTable(int id, int &entries);
 
 	// use '-1' to prefetch/unload all ids
 	// prefetchId retruns false if only on of the resources

Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp	2006-04-09 00:37:20 UTC (rev 21707)
+++ scummvm/trunk/engines/kyra/staticres.cpp	2006-04-09 00:44:08 UTC (rev 21708)
@@ -172,11 +172,11 @@
 	unloadId(-1);
 }
 
-const char **StaticResource::loadStrings(int id, int &strings) {
-	const char **temp = (const char**)getData(id, kStringList, strings);
+const char * const*StaticResource::loadStrings(int id, int &strings) {
+	const char * const*temp = (const char* const*)getData(id, kStringList, strings);
 	if (temp)
 		return temp;
-	return (const char**)getData(id, kLanguageList, strings);
+	return (const char* const*)getData(id, kLanguageList, strings);
 }
 
 const uint8 *StaticResource::loadRawData(int id, int &size) {
@@ -191,8 +191,8 @@
 	return (const Room*)getData(id, StaticResource::kRoomList, entries);
 }
 
-const uint8 **StaticResource::loadPaletteTable(int id, int &entries) {
-	return (const uint8**)getData(id, kPaletteTable, entries);
+const uint8 * const*StaticResource::loadPaletteTable(int id, int &entries) {
+	return (const uint8* const*)getData(id, kPaletteTable, entries);
 }
 
 bool StaticResource::prefetchId(int id) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list