aboutsummaryrefslogtreecommitdiff
path: root/scumm/string.cpp
diff options
context:
space:
mode:
authorMax Horn2003-05-21 18:09:49 +0000
committerMax Horn2003-05-21 18:09:49 +0000
commit86d57f3c7af8fd0d4c6a4d1751ccdaac77c3b2e8 (patch)
treeaa7c2126baa9dd2ca7dd80910f5835b6aa861294 /scumm/string.cpp
parent11d29b71ab4400e6e732ba7cd49a343150360eaf (diff)
downloadscummvm-rg350-86d57f3c7af8fd0d4c6a4d1751ccdaac77c3b2e8.tar.gz
scummvm-rg350-86d57f3c7af8fd0d4c6a4d1751ccdaac77c3b2e8.tar.bz2
scummvm-rg350-86d57f3c7af8fd0d4c6a4d1751ccdaac77c3b2e8.zip
many pedantic warning fixes (and some actual potential buglets fixed, too)
svn-id: r7795
Diffstat (limited to 'scumm/string.cpp')
-rw-r--r--scumm/string.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/scumm/string.cpp b/scumm/string.cpp
index 0f09ab197f..ffce2e0097 100644
--- a/scumm/string.cpp
+++ b/scumm/string.cpp
@@ -677,17 +677,19 @@ void Scumm::addVerbToStack(int var)
}
}
} else {
- addMessageToStack((byte *)"");
+ addMessageToStack((const byte *)"");
}
}
void Scumm::addNameToStack(int var)
{
int num;
+ byte *ptr = 0;
num = readVar(var);
- if (num) {
- byte *ptr = getObjOrActorName(num);
+ if (num)
+ ptr = getObjOrActorName(num);
+ if (ptr) {
if ((_features & GF_AFTER_V8) && (ptr[0] == '/')) {
char pointer[20];
int i, j;
@@ -704,7 +706,7 @@ void Scumm::addNameToStack(int var)
addMessageToStack(ptr);
}
} else {
- addMessageToStack((byte *)"");
+ addMessageToStack((const byte *)"");
}
}
@@ -735,7 +737,7 @@ void Scumm::addStringToStack(int var) {
}
}
} else
- addMessageToStack((byte *)"");
+ addMessageToStack((const byte *)"");
}
void Scumm::initCharset(int charsetno) {
@@ -752,8 +754,8 @@ void Scumm::initCharset(int charsetno) {
}
int indexCompare(const void *p1, const void *p2) {
- struct langIndexNode *i1 = (struct langIndexNode *) p1;
- struct langIndexNode *i2 = (struct langIndexNode *) p2;
+ const struct langIndexNode *i1 = (const struct langIndexNode *) p1;
+ const struct langIndexNode *i2 = (const struct langIndexNode *) p2;
return strcmp(i1->tag, i2->tag);
}
@@ -885,7 +887,7 @@ void Scumm::translateText(const byte *text, byte *trans_buff) {
}
}
}
- byte *pointer = (byte *)strchr((char *)text + 1, '/');
+ byte *pointer = (byte *)strchr((const char *)text + 1, '/');
if (pointer != NULL) {
pointer++;
memcpy(trans_buff, pointer, resStrLen(pointer) + 1);
@@ -918,7 +920,7 @@ void Scumm::translateText(const byte *text, byte *trans_buff) {
// skip translation if flag 'h' exist
if (buf[pos] == 'h') {
pos += 3;
- byte *pointer = (byte *)strchr((char *)text + 1, '/');
+ byte *pointer = (byte *)strchr((const char *)text + 1, '/');
if (pointer != NULL)
memcpy(trans_buff, pointer + 1, resStrLen(pointer + 1) + 1);
else
@@ -976,7 +978,7 @@ void Scumm::translateText(const byte *text, byte *trans_buff) {
}
}
}
- byte *pointer = (byte *)strchr((char *)text + 1, '/');
+ byte *pointer = (byte *)strchr((const char *)text + 1, '/');
if (pointer != NULL) {
pointer++;
l = 0;