[Scummvm-cvs-logs] scummvm master -> 3a15c10241421beaa8a3fe84f3b0567bb2215573

lordhoto lordhoto at gmail.com
Thu Sep 8 00:12:17 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
3a15c10241 SWORD1: Made some static data const.


Commit: 3a15c10241421beaa8a3fe84f3b0567bb2215573
    https://github.com/scummvm/scummvm/commit/3a15c10241421beaa8a3fe84f3b0567bb2215573
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-09-07T15:05:09-07:00

Commit Message:
SWORD1: Made some static data const.

Changed paths:
    engines/sword1/animation.cpp
    engines/sword1/detection.cpp
    engines/sword1/logic.h
    engines/sword1/objectman.cpp
    engines/sword1/objectman.h
    engines/sword1/staticres.cpp
    engines/sword1/sword1.cpp



diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp
index f19efd2..324154f 100644
--- a/engines/sword1/animation.cpp
+++ b/engines/sword1/animation.cpp
@@ -38,7 +38,7 @@
 
 namespace Sword1 {
 
-static const char *sequenceList[20] = {
+static const char *const sequenceList[20] = {
 	"ferrari",  // 0  CD2   ferrari running down fitz in sc19
 	"ladder",   // 1  CD2   george walking down ladder to dig sc24->sc$
 	"steps",    // 2  CD2   george walking down steps sc23->sc24
diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp
index c2c03de..e4c068e 100644
--- a/engines/sword1/detection.cpp
+++ b/engines/sword1/detection.cpp
@@ -48,7 +48,7 @@ static const PlainGameDescriptor sword1PSXDemoSettings =
 
 
 // check these subdirectories (if present)
-static const char *g_dirNames[] = { "clusters", "speech", "english", "italian"};
+static const char *const g_dirNames[] = { "clusters", "speech", "english", "italian"};
 
 #define NUM_COMMON_FILES_TO_CHECK 1
 #define NUM_PC_FILES_TO_CHECK 3
@@ -59,7 +59,7 @@ static const char *g_dirNames[] = { "clusters", "speech", "english", "italian"};
 #define NUM_MAC_DEMO_FILES_TO_CHECK 1
 
 #define NUM_FILES_TO_CHECK NUM_COMMON_FILES_TO_CHECK + NUM_PC_FILES_TO_CHECK + NUM_MAC_FILES_TO_CHECK + NUM_PSX_FILES_TO_CHECK + NUM_DEMO_FILES_TO_CHECK + NUM_MAC_DEMO_FILES_TO_CHECK + NUM_PSX_DEMO_FILES_TO_CHECK
-static const char *g_filesToCheck[NUM_FILES_TO_CHECK] = { // these files have to be found
+static const char *const g_filesToCheck[NUM_FILES_TO_CHECK] = { // these files have to be found
 	"swordres.rif", // Mac, PC and PSX version
 	"general.clu", // PC and PSX version
 	"compacts.clu", // PC and PSX version
diff --git a/engines/sword1/logic.h b/engines/sword1/logic.h
index b6686f6..d4b297e 100644
--- a/engines/sword1/logic.h
+++ b/engines/sword1/logic.h
@@ -207,8 +207,8 @@ private:
 	int fnPurple(Object *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
 	int fnBlack(Object *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
 	static const uint32 _scriptVarInit[NON_ZERO_SCRIPT_VARS][2];
-	static const uint8 *_startData[];
-	static const uint8 *_helperData[];
+	static const uint8 *const _startData[];
+	static const uint8 *const _helperData[];
 	void startPosCallFn(uint8 fnId, uint32 param1, uint32 param2, uint32 param3);
 	void runStartScript(const uint8 *data);
 };
diff --git a/engines/sword1/objectman.cpp b/engines/sword1/objectman.cpp
index 52b5ea2..ed994a9 100644
--- a/engines/sword1/objectman.cpp
+++ b/engines/sword1/objectman.cpp
@@ -179,7 +179,7 @@ char ObjectMan::_missingSubTitleStr[] = " ";
 // is not needed. The English version of the game does not include Portuguese
 // so I cannot check.)
 
-const char *ObjectMan::_translationId2950145[7] = {
+const char *const ObjectMan::_translationId2950145[7] = {
 	"Oh?",     // English (not needed)
 	"Quoi?",   // French
 	"Oh?",     // German
diff --git a/engines/sword1/objectman.h b/engines/sword1/objectman.h
index 7bc31b0..ca3c7c1 100644
--- a/engines/sword1/objectman.h
+++ b/engines/sword1/objectman.h
@@ -59,7 +59,7 @@ private:
 	uint16  _liveList[TOTAL_SECTIONS];                  //which sections are active
 	uint8 *_cptData[TOTAL_SECTIONS];
 	static char _missingSubTitleStr[];
-	static const char *_translationId2950145[7];        //translation for textId 2950145 (missing from cluster file for some langages)
+	static const char *const _translationId2950145[7];        //translation for textId 2950145 (missing from cluster file for some langages)
 };
 
 } // End of namespace Sword1
diff --git a/engines/sword1/staticres.cpp b/engines/sword1/staticres.cpp
index 402e349..60c6877 100644
--- a/engines/sword1/staticres.cpp
+++ b/engines/sword1/staticres.cpp
@@ -7055,7 +7055,7 @@ const uint8 g_genWhiteCoat[] = {
 	INIT_SEQ_END
 };
 
-const uint8 *Logic::_startData[] = {
+const uint8 *const Logic::_startData[] = {
 	g_startPos0,
 	g_startPos1,
 	g_startPos2,
@@ -7139,7 +7139,7 @@ const uint8 *Logic::_startData[] = {
 	g_startPos80
 };
 
-const uint8 *Logic::_helperData[] = {
+const uint8 *const Logic::_helperData[] = {
 	g_genIreland,
 	g_genSyria,
 	g_genSpain,
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp
index 6a3f215..865e025 100644
--- a/engines/sword1/sword1.cpp
+++ b/engines/sword1/sword1.cpp
@@ -240,7 +240,7 @@ void SwordEngine::flagsToBool(bool *dest, uint8 flags) {
 	}
 }
 
-static const char *errorMsgs[] = {
+static const char *const errorMsgs[] = {
 	"The file \"%s\" is missing and the game doesn't work without it.\n"
 	"Please copy it from CD %d and try starting the game again.\n"
 	"The Readme file also contains further information.",






More information about the Scummvm-git-logs mailing list