aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2011-05-18 13:06:33 +0200
committerMax Horn2011-05-18 13:06:33 +0200
commit39ab4a2dc481ee794cafb5e2548404a7121eb96d (patch)
tree79d53bec56bfabe22005ada06aaed1e0a9b1eafc
parentf830d68130e2a30cd1a68b06558a8eaa9bc05c25 (diff)
downloadscummvm-rg350-39ab4a2dc481ee794cafb5e2548404a7121eb96d.tar.gz
scummvm-rg350-39ab4a2dc481ee794cafb5e2548404a7121eb96d.tar.bz2
scummvm-rg350-39ab4a2dc481ee794cafb5e2548404a7121eb96d.zip
AGI: Constify stuff
-rw-r--r--engines/agi/agi.h2
-rw-r--r--engines/agi/words.cpp8
2 files changed, 5 insertions, 5 deletions
diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index 19343873ec..a42148b1ef 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -969,7 +969,7 @@ public:
int showWords();
int loadWords(const char *);
void unloadWords();
- int findWord(char *word, int *flen);
+ int findWord(const char *word, int *flen);
void dictionaryWords(char *);
// Motion
diff --git a/engines/agi/words.cpp b/engines/agi/words.cpp
index e18b18394e..4b96fdf711 100644
--- a/engines/agi/words.cpp
+++ b/engines/agi/words.cpp
@@ -37,7 +37,7 @@ static uint32 wordsFlen; // length of word memory
// Local implementation to avoid problems with strndup() used by
// gcc 3.2 Cygwin (see #635984)
//
-static char *myStrndup(char *src, int n) {
+static char *myStrndup(const char *src, int n) {
char *tmp = strncpy((char *)malloc(n + 1), src, n);
tmp[n] = 0;
return tmp;
@@ -86,11 +86,11 @@ void AgiEngine::unloadWords() {
*
* Thomas Akesson, November 2001
*/
-int AgiEngine::findWord(char *word, int *flen) {
+int AgiEngine::findWord(const char *word, int *flen) {
int mchr = 0; // matched chars
int len, fchr, id = -1;
- uint8 *p = words;
- uint8 *q = words + wordsFlen;
+ const uint8 *p = words;
+ const uint8 *q = words + wordsFlen;
*flen = 0;
debugC(2, kDebugLevelScripts, "find_word(%s)", word);