aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2019-06-26 18:36:34 -0700
committerPaul Gilbert2019-07-06 15:27:07 -0700
commit305330bda7e755f141805a4e0e45f74820e980e1 (patch)
treedce4cb9da47a334b5942b582497ea249e7659bda
parent822cd6f16564a4fbb3436600894c144bf9e160d6 (diff)
downloadscummvm-rg350-305330bda7e755f141805a4e0e45f74820e980e1.tar.gz
scummvm-rg350-305330bda7e755f141805a4e0e45f74820e980e1.tar.bz2
scummvm-rg350-305330bda7e755f141805a4e0e45f74820e980e1.zip
GLK: ALAN3: Change EOF to a uint32 EOD to fix compiler warnings
-rw-r--r--engines/glk/alan3/acode.h5
-rw-r--r--engines/glk/alan3/act.cpp2
-rw-r--r--engines/glk/alan3/alt_info.cpp2
-rw-r--r--engines/glk/alan3/debug.cpp6
-rw-r--r--engines/glk/alan3/decode.cpp6
-rw-r--r--engines/glk/alan3/instance.cpp8
-rw-r--r--engines/glk/alan3/lists.cpp6
-rw-r--r--engines/glk/alan3/main.cpp12
-rw-r--r--engines/glk/alan3/output.cpp2
-rw-r--r--engines/glk/alan3/params.cpp2
-rw-r--r--engines/glk/alan3/parse.cpp4
-rw-r--r--engines/glk/alan3/rules.cpp2
-rw-r--r--engines/glk/alan3/scan.cpp2
-rw-r--r--engines/glk/alan3/state.cpp8
14 files changed, 35 insertions, 32 deletions
diff --git a/engines/glk/alan3/acode.h b/engines/glk/alan3/acode.h
index a399d3ce43..0c404607b7 100644
--- a/engines/glk/alan3/acode.h
+++ b/engines/glk/alan3/acode.h
@@ -118,7 +118,10 @@ typedef int WordKind;
/* Syntax element classifications */
-#define EOS (-2) /* End Of Syntax */
+// End of file/data
+#define EOD (uint32)-1
+// End Of Syntax
+#define EOS (uint32)-2
/* Syntax element flag bits */
#define MULTIPLEBIT 0x1
diff --git a/engines/glk/alan3/act.cpp b/engines/glk/alan3/act.cpp
index 1c89e354d1..cc1fe92fc3 100644
--- a/engines/glk/alan3/act.cpp
+++ b/engines/glk/alan3/act.cpp
@@ -107,7 +107,7 @@ void action(int verb, Parameter parameters[], Parameter multipleMatches[])
// TODO: if execution for one parameter aborts we should return here, not to top level
if (setjmp(returnLabel) == NO_JUMP_RETURN)
executeCommand(verb, parameters);
- if (multipleMatches[i+1].instance != EOF)
+ if (multipleMatches[i+1].instance != EOD)
para();
}
memcpy(returnLabel, savedReturnLabel, sizeof(returnLabel));
diff --git a/engines/glk/alan3/alt_info.cpp b/engines/glk/alan3/alt_info.cpp
index b9e2dc0aba..5a87cbb122 100644
--- a/engines/glk/alan3/alt_info.cpp
+++ b/engines/glk/alan3/alt_info.cpp
@@ -285,7 +285,7 @@ static VerbEntry *findVerbEntry(int verbCode, VerbEntry *entries) {
VerbEntry *verbEntry;
for (verbEntry = entries; !isEndOfArray(verbEntry); verbEntry++) {
if (verbEntry->code < 0) {
- /* Verb codes are negative for Meta verbs, if so they are also 1 off to avoid EOF */
+ /* Verb codes are negative for Meta verbs, if so they are also 1 off to avoid EOD */
if (abs(verbEntry->code)-1 == verbCode)
return verbEntry;
} else {
diff --git a/engines/glk/alan3/debug.cpp b/engines/glk/alan3/debug.cpp
index 7e017ab9cf..c196897531 100644
--- a/engines/glk/alan3/debug.cpp
+++ b/engines/glk/alan3/debug.cpp
@@ -284,7 +284,7 @@ static int sourceFileNumber(char *fileName) {
SourceFileEntry *entries = (SourceFileEntry *)pointerTo(header->sourceFileTable);
int n;
- for (n = 0; *(Aword*)&entries[n] != EOF; n++) {
+ for (n = 0; *(Aword*)&entries[n] != EOD; n++) {
char *entryName;
entryName = getStringFromFile(entries[n].fpos, entries[n].len);
if (strcmp(entryName, fileName) == 0) return n;
@@ -522,7 +522,7 @@ void showSourceLine(int fileNumber, int line) {
static void listFiles() {
SourceFileEntry *entry;
int i = 0;
- for (entry = (SourceFileEntry *)pointerTo(header->sourceFileTable); *((Aword*)entry) != EOF; entry++) {
+ for (entry = (SourceFileEntry *)pointerTo(header->sourceFileTable); *((Aword*)entry) != EOD; entry++) {
printf(" %2d : %s\n", i, sourceFileName(i));
i++;
}
@@ -598,7 +598,7 @@ static void setBreakpoint(int file, int line) {
int lineIndex = findSourceLineIndex((SourceLineEntry *)pointerTo(header->sourceLineTable), file, line);
SourceLineEntry *entry = (SourceLineEntry *)pointerTo(header->sourceLineTable);
char leadingText[100] = "Breakpoint";
- if (entry[lineIndex].file == EOF) {
+ if (entry[lineIndex].file == EOD) {
printf("Line %d not available\n", line);
} else {
if (entry[lineIndex].line != line)
diff --git a/engines/glk/alan3/decode.cpp b/engines/glk/alan3/decode.cpp
index 233228bab2..4fe2af7df1 100644
--- a/engines/glk/alan3/decode.cpp
+++ b/engines/glk/alan3/decode.cpp
@@ -37,7 +37,7 @@ Aword *freq; /* Cumulative character frequencies */
/* Bit output */
static int decodeBuffer; /* Bits to be input */
static int bitsToGo; /* Bits still in buffer */
-static int garbageBits; /* Bits past EOF */
+static int garbageBits; /* Bits past EOD */
static int inputBit(void)
@@ -47,8 +47,8 @@ static int inputBit(void)
/* More bits available ? */
if (!bitsToGo) {
/* No, so get more */
- decodeBuffer = (textFile->pos() >= textFile->size()) ? EOF : textFile->readByte();
- if (decodeBuffer == EOF) {
+ decodeBuffer = (textFile->pos() >= textFile->size()) ? EOD : textFile->readByte();
+ if (decodeBuffer == EOD) {
garbageBits++;
if (garbageBits > VALUEBITS-2)
syserr("Error in encoded data file.");
diff --git a/engines/glk/alan3/instance.cpp b/engines/glk/alan3/instance.cpp
index 761c74a4b4..a761b5603d 100644
--- a/engines/glk/alan3/instance.cpp
+++ b/engines/glk/alan3/instance.cpp
@@ -161,7 +161,7 @@ static Aptr literalAttribute(int literal, int attribute)
else
return getAttribute(admin[header->instanceMax].attributes, attribute);
}
- return(EOF);
+ return(EOD);
}
@@ -183,7 +183,7 @@ Aptr getInstanceAttribute(int instance, int attribute)
syserr(str);
}
}
- return(EOF);
+ return(EOD);
}
@@ -462,10 +462,10 @@ void sayInstance(int instance)
/* Find the id in the parameters... */
if (params != NULL)
- for (p = 0; params[p].code != EOF; p++)
+ for (p = 0; params[p].code != EOD; p++)
if (params[p].code == instance) {
/* Found it so.. */
- if (params[p].firstWord == EOF) /* Any words he used? */
+ if (params[p].firstWord == EOD) /* Any words he used? */
break; /* No... */
else { /* Yes, so use them... */
char *capitalized;
diff --git a/engines/glk/alan3/lists.cpp b/engines/glk/alan3/lists.cpp
index bb330c3301..c42e90e84d 100644
--- a/engines/glk/alan3/lists.cpp
+++ b/engines/glk/alan3/lists.cpp
@@ -30,16 +30,16 @@ void initArray(void *array) {
implementationOfSetEndOfArray((Aword *)array);
}
-/* How to know we are at end of a table or array, first Aword == EOF */
+/* How to know we are at end of a table or array, first Aword == EOD */
void implementationOfSetEndOfArray(Aword *adr)
{
- *adr = EOF;
+ *adr = EOD;
}
bool implementationOfIsEndOfList(Aword *adr)
{
- return *adr == EOF;
+ return *adr == EOD;
}
int lengthOfArrayImplementation(void *array_of_any_type, int element_size_in_bytes) {
diff --git a/engines/glk/alan3/main.cpp b/engines/glk/alan3/main.cpp
index 3697ac6009..a3be710c7d 100644
--- a/engines/glk/alan3/main.cpp
+++ b/engines/glk/alan3/main.cpp
@@ -82,20 +82,20 @@ VerbEntry *vrbs; /* Verb table pointer */
void checkobj(Aword *obj) {
Aword oldobj;
- if (*obj != EOF)
+ if (*obj != EOD)
return;
- oldobj = EOF;
+ oldobj = EOD;
for (cur.obj = OBJMIN; cur.obj <= OBJMAX; cur.obj++) {
/* If an object is present and it is possible to perform his action */
if (isHere(cur.obj) && possible())
- if (oldobj == EOF)
+ if (oldobj == EOD)
oldobj = cur.obj;
else
error(WANT); /* And we didn't find multiple objects */
}
- if (oldobj == EOF)
+ if (oldobj == EOD)
error(WANT); /* But we found ONE */
*obj = cur.obj = oldobj;
@@ -526,7 +526,7 @@ static Aint sizeOfAttributeData(void)
size += AwordSizeOf(AttributeEntry);
attribute++;
}
- size += 1; /* For EOF */
+ size += 1; /* For EOD */
}
if (size != header->attributesAreaSize
@@ -553,7 +553,7 @@ static AttributeEntry *initializeAttributes(int awordSize)
currentAttributeArea += AwordSizeOf(AttributeEntry);
originalAttribute++;
}
- *((Aword*)currentAttributeArea) = EOF;
+ *((Aword*)currentAttributeArea) = EOD;
currentAttributeArea += 1;
}
diff --git a/engines/glk/alan3/output.cpp b/engines/glk/alan3/output.cpp
index efe4e31d3b..e6f921ec2e 100644
--- a/engines/glk/alan3/output.cpp
+++ b/engines/glk/alan3/output.cpp
@@ -271,7 +271,7 @@ static void sayParameter(int p, int form)
apperr("Nonexistent parameter referenced.");
#ifdef ALWAYS_SAY_PARAMETERS_USING_PLAYER_WORDS
- if (params[p].firstWord != EOF) /* Any words he used? */
+ if (params[p].firstWord != EOD) /* Any words he used? */
/* Yes, so use them... */
sayPlayerWordsForParameter(p);
else
diff --git a/engines/glk/alan3/params.cpp b/engines/glk/alan3/params.cpp
index 4b940099f8..d1d97a7ba7 100644
--- a/engines/glk/alan3/params.cpp
+++ b/engines/glk/alan3/params.cpp
@@ -280,7 +280,7 @@ void copyReferencesToParameterArray(Aint references[], Parameter parameterArray[
for (i = 0; !isEndOfArray(&references[i]); i++) {
parameterArray[i].instance = references[i];
- parameterArray[i].firstWord = EOF; /* Ensure that there is no word that can be used */
+ parameterArray[i].firstWord = EOD; /* Ensure that there is no word that can be used */
}
setEndOfArray(&parameterArray[i]);
}
diff --git a/engines/glk/alan3/parse.cpp b/engines/glk/alan3/parse.cpp
index fe42bc9ae0..5faa50ca1f 100644
--- a/engines/glk/alan3/parse.cpp
+++ b/engines/glk/alan3/parse.cpp
@@ -214,7 +214,7 @@ static void errorButAfterAll(int butWordIndex) {
/*----------------------------------------------------------------------*/
static Aint findInstanceForNoun(int wordIndex) {
DictionaryEntry *d = &dictionary[wordIndex];
- if (d->nounRefs == 0 || d->nounRefs == EOF)
+ if (d->nounRefs == 0 || d->nounRefs == EOD)
syserr("No references for noun");
return *(Aint*) pointerTo(d->nounRefs);
}
@@ -1351,7 +1351,7 @@ static int pronounWordForInstance(int instance) {
for (w = 0; w < dictionarySize; w++)
if (isPronoun(w)) {
Aword *reference = (Aword *)pointerTo(dictionary[w].pronounRefs);
- while (*reference != EOF) {
+ while (*reference != EOD) {
if (*reference == (Aword)instance)
return dictionary[w].code;
reference++;
diff --git a/engines/glk/alan3/rules.cpp b/engines/glk/alan3/rules.cpp
index 29c98c8ec4..96dd33daf0 100644
--- a/engines/glk/alan3/rules.cpp
+++ b/engines/glk/alan3/rules.cpp
@@ -65,7 +65,7 @@ static void clearRulesAdmin(int numRules) {
static void initRulesAdmin(int numRules) {
int r;
- rulesAdmin = (RulesAdmin *)allocate(numRules*sizeof(RulesAdmin)+sizeof(EOF));
+ rulesAdmin = (RulesAdmin *)allocate(numRules*sizeof(RulesAdmin)+sizeof(EOD));
for (r = 0; r < numRules; r++)
;
setEndOfArray(&rulesAdmin[r]);
diff --git a/engines/glk/alan3/scan.cpp b/engines/glk/alan3/scan.cpp
index 9c632023f7..4f3855abc8 100644
--- a/engines/glk/alan3/scan.cpp
+++ b/engines/glk/alan3/scan.cpp
@@ -93,7 +93,7 @@ static int lookup(char wrd[]) {
}
}
unknown(wrd);
- return (EOF);
+ return (int)EOD;
}
diff --git a/engines/glk/alan3/state.cpp b/engines/glk/alan3/state.cpp
index 3b8acffec8..f7fc2eb0ee 100644
--- a/engines/glk/alan3/state.cpp
+++ b/engines/glk/alan3/state.cpp
@@ -70,7 +70,7 @@ static int countStrings(void) {
int count = 0;
if (header->stringInitTable != 0)
- for (entry = (StringInitEntry *)pointerTo(header->stringInitTable); *(Aword *)entry != EOF; entry++)
+ for (entry = (StringInitEntry *)pointerTo(header->stringInitTable); *(Aword *)entry != EOD; entry++)
count++;
return(count);
}
@@ -92,7 +92,7 @@ static int countSets(void) {
int count = 0;
if (header->setInitTable != 0)
- for (entry = (SetInitEntry *)pointerTo(header->setInitTable); *(Aword *)entry != EOF; entry++)
+ for (entry = (SetInitEntry *)pointerTo(header->setInitTable); *(Aword *)entry != EOD; entry++)
count++;
return(count);
}
@@ -251,7 +251,7 @@ static void freeCurrentSetAttributes(void) {
SetInitEntry *entry;
if (header->setInitTable == 0) return;
- for (entry = (SetInitEntry *)pointerTo(header->setInitTable); *(Aword *)entry != EOF; entry++) {
+ for (entry = (SetInitEntry *)pointerTo(header->setInitTable); *(Aword *)entry != EOD; entry++) {
Aptr attributeValue = getAttribute(admin[entry->instanceCode].attributes, entry->attributeCode);
freeSet((Set*)fromAptr(attributeValue));
}
@@ -279,7 +279,7 @@ static void freeCurrentStringAttributes(void) {
StringInitEntry *entry;
if (header->stringInitTable == 0) return;
- for (entry = (StringInitEntry *)pointerTo(header->stringInitTable); *(Aword *)entry != EOF; entry++) {
+ for (entry = (StringInitEntry *)pointerTo(header->stringInitTable); *(Aword *)entry != EOD; entry++) {
Aptr attributeValue = getAttribute(admin[entry->instanceCode].attributes, entry->attributeCode);
deallocate(fromAptr(attributeValue));
}