AGI: Constify stuff

This commit is contained in:
Max Horn 2011-05-18 13:06:33 +02:00
parent f830d68130
commit 39ab4a2dc4
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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);