From 39ab4a2dc481ee794cafb5e2548404a7121eb96d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 18 May 2011 13:06:33 +0200 Subject: AGI: Constify stuff --- engines/agi/agi.h | 2 +- engines/agi/words.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/agi') 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); -- cgit v1.2.3