aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2006-04-09 00:44:08 +0000
committerMax Horn2006-04-09 00:44:08 +0000
commit94e647235f6978578dffccba0e1f2aa09cfc0aad (patch)
treebdbd23c1148dd5f0b8f351606168b560d76be6a7
parentdcfad9426fb7e3bce7b455402f385e55497fcf2c (diff)
downloadscummvm-rg350-94e647235f6978578dffccba0e1f2aa09cfc0aad.tar.gz
scummvm-rg350-94e647235f6978578dffccba0e1f2aa09cfc0aad.tar.bz2
scummvm-rg350-94e647235f6978578dffccba0e1f2aa09cfc0aad.zip
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)
svn-id: r21708
-rw-r--r--engines/kyra/kyra.h62
-rw-r--r--engines/kyra/resource.h4
-rw-r--r--engines/kyra/staticres.cpp10
3 files changed, 38 insertions, 38 deletions
diff --git a/engines/kyra/kyra.h b/engines/kyra/kyra.h
index 96c3468da1..13f51c3111 100644
--- a/engines/kyra/kyra.h
+++ b/engines/kyra/kyra.h
@@ -275,13 +275,13 @@ public:
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 @@ protected:
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 @@ protected:
int _veryClever_Size;
int _homeString_Size;
- const char **_characterImageTable;
+ const char * const*_characterImageTable;
int _characterImageTableSize;
Shape *_defaultShapeTable;
@@ -933,12 +933,12 @@ protected:
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;
diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h
index 46482b7cba..e608b26d70 100644
--- a/engines/kyra/resource.h
+++ b/engines/kyra/resource.h
@@ -169,11 +169,11 @@ public:
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
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 0dc9fec636..fdca8567b3 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -172,11 +172,11 @@ void StaticResource::deinit() {
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 @@ const Room *StaticResource::loadRoomTable(int id, int &entries) {
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) {