aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2007-05-30 14:38:17 +0000
committerMax Horn2007-05-30 14:38:17 +0000
commit5aeb9d8b3e902eeedaa6a85f1f38afff06f85ac9 (patch)
treea595c84f24e7b8c292240c5e6e05cc49ba61ac47 /engines
parent0504f18e9f2a4d03f4b5ce7cfb60cd7a2a383a42 (diff)
downloadscummvm-rg350-5aeb9d8b3e902eeedaa6a85f1f38afff06f85ac9.tar.gz
scummvm-rg350-5aeb9d8b3e902eeedaa6a85f1f38afff06f85ac9.tar.bz2
scummvm-rg350-5aeb9d8b3e902eeedaa6a85f1f38afff06f85ac9.zip
Several const correctness fixes
svn-id: r27011
Diffstat (limited to 'engines')
-rw-r--r--engines/cruise/cruise_main.cpp2
-rw-r--r--engines/cruise/cruise_main.h2
-rw-r--r--engines/cruise/font.cpp28
-rw-r--r--engines/cruise/font.h4
-rw-r--r--engines/cruise/menu.cpp4
-rw-r--r--engines/cruise/overlay.cpp6
-rw-r--r--engines/cruise/overlay.h4
-rw-r--r--engines/cruise/stringSupport.cpp2
8 files changed, 26 insertions, 26 deletions
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index dcc8777bad..575b91c184 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -477,7 +477,7 @@ int initAllData(void) {
resetActorPtr(&actorHead);
resetBackgroundIncrustList(&backgroundIncrustHead);
- bootOverlayNumber = loadOverlay((uint8 *) "AUTO00");
+ bootOverlayNumber = loadOverlay((const uint8 *) "AUTO00");
#ifdef DUMP_SCRIPT
loadOverlay("TITRE");
diff --git a/engines/cruise/cruise_main.h b/engines/cruise/cruise_main.h
index a36d8a066e..db3bc0574e 100644
--- a/engines/cruise/cruise_main.h
+++ b/engines/cruise/cruise_main.h
@@ -86,7 +86,7 @@ void changeScriptParamInList(int param1, int param2,
scriptInstanceStruct * pScriptInstance, int newValue, int param3);
uint8 *getDataFromData3(ovlData3Struct * ptr, int param);
int32 prepareWordRender(int32 param, int32 var1, int16 * out2, uint8 * ptr3,
- uint8 * string);
+ const uint8 * string);
void removeExtention(const char *name, char *buffer);
void resetRaster(uint8 * rasterPtr, int32 rasterSize);
void changeCursor(uint16 cursorType);
diff --git a/engines/cruise/font.cpp b/engines/cruise/font.cpp
index 22f358033e..efd0cbc12d 100644
--- a/engines/cruise/font.cpp
+++ b/engines/cruise/font.cpp
@@ -50,15 +50,15 @@ int32 getLineHeight(int16 charCount, uint8 * fontPtr, uint8 * fontPrt_Desc) {
// this function determins how many lines the text will have (old: fontProc2(int32 param1, int32 param2, uint8* ptr, uint8* string))
int32 getTextLineCount(int32 rightBorder_X, int32 wordSpacingWidth,
- uint8 *ptr, uint8 *textString) {
- uint8 *localString = textString;
- uint8 *currentStringPtr;
+ uint8 *ptr, const uint8 *textString) {
+ const uint8 *localString = textString;
+ const uint8 *currentStringPtr;
uint8 character;
int32 var_6 = 0;
int32 lineLength = 0;
- uint8 *tempPtr = 0;
+ const uint8 *tempPtr = 0;
if (!*localString) {
return (0);
@@ -111,16 +111,16 @@ void loadFNT(const void *fileNameChar) {
int32 fontSize;
int32 data2;
uint8 data3[6];
- uint8 *fileName = (uint8 *) fileNameChar;
+ const uint8 *fileName = (const uint8 *)fileNameChar;
_systemFNT = NULL;
Common::File fontFileHandle;
- if (!fontFileHandle.exists((char *)fileName)) {
+ if (!fontFileHandle.exists((const char *)fileName)) {
return;
}
- fontFileHandle.open((char *)fileName);
+ fontFileHandle.open((const char *)fileName);
fontFileHandle.read(header, 4);
@@ -134,7 +134,7 @@ void loadFNT(const void *fileNameChar) {
fontFileHandle.read(data3, 6); // may need an endian flip ?
flipGen(&data3, 6);
- _systemFNT = (uint8 *) mallocAndZero(fontSize);
+ _systemFNT = (uint8 *)mallocAndZero(fontSize);
if (_systemFNT != NULL) {
int32 i;
@@ -151,8 +151,8 @@ void loadFNT(const void *fileNameChar) {
currentPtr = _systemFNT + 14;
- for (i = 0; i < *(int16 *) (_systemFNT + 8); i++) {
- flipLong((int32 *) currentPtr);
+ for (i = 0; i < *(int16 *)(_systemFNT + 8); i++) {
+ flipLong((int32 *)currentPtr);
currentPtr += 4;
flipGen(currentPtr, 8);
@@ -277,8 +277,8 @@ void renderWord(uint8 * fontPtr_Data, uint8 * outBufferPtr,
// returns character count and pixel size (via pointer) per line of the string (old: prepareWordRender(int32 param, int32 var1, int16* out2, uint8* ptr3, uint8* string))
int32 prepareWordRender(int32 inRightBorder_X, int32 wordSpacingWidth,
- int16 * strPixelLength, uint8 * ptr3, uint8 * textString) {
- uint8 *localString = textString;
+ int16 * strPixelLength, uint8 * ptr3, const uint8 * textString) {
+ const uint8 *localString = textString;
int32 counter = 0;
int32 finish = 0;
@@ -518,7 +518,7 @@ void drawString(int32 x, int32 y, uint8 *string, uint8 *buffer, uint8 color,
}
// calculates all necessary datas and renders text
-gfxEntryStruct *renderText(int inRightBorder_X, uint8 *string) {
+gfxEntryStruct *renderText(int inRightBorder_X, const uint8 *string) {
uint8 *fontPtr;
uint8 *fontPtr_Data; // pt2
uint8 *fontPtr_Desc; // ptr3
@@ -600,7 +600,7 @@ gfxEntryStruct *renderText(int inRightBorder_X, uint8 *string) {
int spacesCount = 0; // si
unsigned char character = *string;
short int strPixelLength; // var_16
- uint8 *ptrStringEnd; // var_4 //ok
+ const uint8 *ptrStringEnd; // var_4 //ok
int drawPosPixel_X; // di
// find first letter in string, skip all spaces
diff --git a/engines/cruise/font.h b/engines/cruise/font.h
index b4533f2e43..de3040bf00 100644
--- a/engines/cruise/font.h
+++ b/engines/cruise/font.h
@@ -38,12 +38,12 @@ void flipLong(uint32 * var); // TODO: move away
void flipGen(void *var, int32 length);
int32 getLineHeight(int16 charCount, uint8 * fontPtr, uint8 * fontPrt_Desc); // fontProc1
-int32 getTextLineCount(int32 rightBorder_X, int32 wordSpacingWidth, uint8 * ptr, uint8 * textString); // fontProc2
+int32 getTextLineCount(int32 rightBorder_X, int32 wordSpacingWidth, uint8 * ptr, const uint8 *textString); // fontProc2
void renderWord(uint8 * fontPtr_Data, uint8 * outBufferPtr,
int32 drawPosPixel_X, int32 heightOff, int32 height, int32 param4,
int32 stringRenderBufferSize, int32 width, int32 charWidth);
-gfxEntryStruct *renderText(int inRightBorder_X, uint8 * string);
+gfxEntryStruct *renderText(int inRightBorder_X, const uint8 *string);
void drawString(int32 x, int32 y, uint8 * string, uint8 * buffer, uint8 color,
int32 inRightBorder_X);
diff --git a/engines/cruise/menu.cpp b/engines/cruise/menu.cpp
index d76934439b..7352b2f63e 100644
--- a/engines/cruise/menu.cpp
+++ b/engines/cruise/menu.cpp
@@ -39,7 +39,7 @@ menuStruct *createMenu(int X, int Y, const char *menuName) {
entry->stringPtr = menuName;
entry->numElements = 0;
entry->ptrNextElement = NULL;
- entry->gfx = renderText(160, (uint8 *) menuName);
+ entry->gfx = renderText(160, (const uint8 *)menuName);
return entry;
}
@@ -117,7 +117,7 @@ void addSelectableMenuEntry(int param0, int param1, menuStruct *pMenu,
pNewElement->next = NULL;
pNewElement->varC = 0;
pNewElement->color = color;
- pNewElement->gfx = renderText(160, (uint8 *) menuText);
+ pNewElement->gfx = renderText(160, (const uint8 *)menuText);
if (var_6 == NULL) {
pMenu->ptrNextElement = pNewElement;
diff --git a/engines/cruise/overlay.cpp b/engines/cruise/overlay.cpp
index 10e807380a..092c86fb86 100644
--- a/engines/cruise/overlay.cpp
+++ b/engines/cruise/overlay.cpp
@@ -42,7 +42,7 @@ void initOverlayTable(void) {
numOfLoadedOverlay = 1;
}
-int loadOverlay(uint8 *scriptName) {
+int loadOverlay(const uint8 *scriptName) {
int newNumberOfScript;
bool scriptNotLoadedBefore;
int scriptIdx;
@@ -59,7 +59,7 @@ int loadOverlay(uint8 *scriptName) {
scriptNotLoadedBefore = false;
- scriptIdx = findOverlayByName((char *)scriptName);
+ scriptIdx = findOverlayByName((const char *)scriptName);
if (scriptIdx == -4) {
scriptIdx = numOfLoadedOverlay;
@@ -723,7 +723,7 @@ int releaseOverlay(const char *name) {
return 0;
}
-int32 findOverlayByName2(uint8 *name) {
+int32 findOverlayByName2(const uint8 *name) {
int i;
for (i = 1; i < numOfLoadedOverlay; i++) {
diff --git a/engines/cruise/overlay.h b/engines/cruise/overlay.h
index 07f814701c..65c48c3c6e 100644
--- a/engines/cruise/overlay.h
+++ b/engines/cruise/overlay.h
@@ -181,8 +181,8 @@ extern overlayStruct overlayTable[90];
extern int numOfLoadedOverlay;
void initOverlayTable(void);
-int loadOverlay(uint8 * scriptName);
-int32 findOverlayByName2(uint8 * name);
+int loadOverlay(const uint8 * scriptName);
+int32 findOverlayByName2(const uint8 * name);
int findOverlayByName(const char *overlayName);
int releaseOverlay(const char *name);
diff --git a/engines/cruise/stringSupport.cpp b/engines/cruise/stringSupport.cpp
index 1343ba146d..f8b453c2c6 100644
--- a/engines/cruise/stringSupport.cpp
+++ b/engines/cruise/stringSupport.cpp
@@ -35,7 +35,7 @@ void strcatuint8(void *dest, const void *source) {
}
uint8 strcmpuint8(const void *string1, const void *string2) {
- return strcmp((char *)string1, (char *)string2);
+ return strcmp((const char *)string1, (const char *)string2);
}
} // End of namespace Cruise