aboutsummaryrefslogtreecommitdiff
path: root/engines/glk
diff options
context:
space:
mode:
authorPaul Gilbert2019-06-22 09:59:51 -0700
committerPaul Gilbert2019-06-22 14:40:50 -0700
commit8b509bbfee6d9c82d8f05e569f61f5781917cbda (patch)
tree260dfab4a663b342aa0e4c02168faaf4142e12e0 /engines/glk
parent1249c335392d7cc2d5492a5bc8718b9a034fbb11 (diff)
downloadscummvm-rg350-8b509bbfee6d9c82d8f05e569f61f5781917cbda.tar.gz
scummvm-rg350-8b509bbfee6d9c82d8f05e569f61f5781917cbda.tar.bz2
scummvm-rg350-8b509bbfee6d9c82d8f05e569f61f5781917cbda.zip
GLK: ALAN2: Warning fixes
Diffstat (limited to 'engines/glk')
-rw-r--r--engines/glk/alan2/debug.cpp20
-rw-r--r--engines/glk/alan2/exe.cpp62
-rw-r--r--engines/glk/alan2/inter.cpp10
-rw-r--r--engines/glk/alan2/main.cpp72
-rw-r--r--engines/glk/alan2/main.h4
-rw-r--r--engines/glk/alan2/parse.cpp58
-rw-r--r--engines/glk/alan2/sysdep.cpp8
-rw-r--r--engines/glk/glulxe/serial.cpp2
-rw-r--r--engines/glk/quetzal.cpp2
9 files changed, 118 insertions, 120 deletions
diff --git a/engines/glk/alan2/debug.cpp b/engines/glk/alan2/debug.cpp
index f7075ca5c8..96ce46cf13 100644
--- a/engines/glk/alan2/debug.cpp
+++ b/engines/glk/alan2/debug.cpp
@@ -51,7 +51,7 @@ static void showatrs(Aword atradr) {
static void showobjs() {
char str[80];
- int obj;
+ uint obj;
output("OBJECTS:");
for (obj = OBJMIN; obj <= OBJMAX; obj++) {
@@ -103,7 +103,7 @@ static void showobj(int obj) {
static void showcnts() {
char str[80];
- int cnt;
+ uint cnt;
#define CNT (cnt-CNTMIN)
output("CONTAINERS:");
@@ -121,11 +121,11 @@ static void showcnts() {
static void showcnt(int cnt) {
char str[80];
- int i;
+ uint i;
Abool found = FALSE;
-#define CNT (cnt-CNTMIN)
+#define CNT (int)(cnt - CNTMIN)
- if (cnt < CNTMIN || cnt > CNTMAX) {
+ if (cnt < (int)CNTMIN || cnt >(int)CNTMAX) {
sprintf(str, "Container number out of range. Between %ld and %ld, please.", (unsigned long) CNTMIN, (unsigned long) CNTMAX);
output(str);
return;
@@ -161,7 +161,7 @@ static void showcnt(int cnt) {
static void showlocs() {
char str[80];
- int loc;
+ uint loc;
output("LOCATIONS:");
for (loc = LOCMIN; loc <= LOCMAX; loc++) {
@@ -191,7 +191,7 @@ static void showloc(int loc) {
static void showacts() {
char str[80];
- int act;
+ uint act;
output("ACTORS:");
for (act = ACTMIN; act <= ACTMAX; act++) {
@@ -238,17 +238,17 @@ static void showact(int act) {
}
static void showevts() {
- int evt, i;
+ int i;
char str[80];
Boolean scheduled;
output("EVENTS:");
- for (evt = EVTMIN; evt <= EVTMAX; evt++) {
+ for (uint evt = EVTMIN; evt <= EVTMAX; evt++) {
sprintf(str, "$i%d (%s):", evt, (char *)addrTo(evts[evt - EVTMIN].stradr));
output(str);
scheduled = FALSE;
for (i = 0; i < etop; i++)
- if ((scheduled = (eventq[i].event == evt)))
+ if ((scheduled = (eventq[i].event == (int)evt)))
break;
if (scheduled) {
sprintf(str, "Scheduled for +%d, at ", eventq[i].time - cur.tick);
diff --git a/engines/glk/alan2/exe.cpp b/engines/glk/alan2/exe.cpp
index 6072f5ebc3..fd5e36cea8 100644
--- a/engines/glk/alan2/exe.cpp
+++ b/engines/glk/alan2/exe.cpp
@@ -54,14 +54,14 @@ void dscracts();
void print(Aword fpos, Aword len) {
- char str[2 * WIDTH]; /* String buffer */
- int outlen = 0; /* Current output length */
- int ch;
+ char str[2 * WIDTH]; // String buffer
+ int outlen = 0; // Current output length
+ int ch = 0;
int i;
- long savfp; /* Temporary saved text file position */
- static Boolean printFlag = FALSE; /* Printing already? */
+ long savfp = 0; // Temporary saved text file position
+ static Boolean printFlag = FALSE; // Printing already?
Boolean savedPrintFlag = printFlag;
- void *info; /* Saved decoding info */
+ void *info = nullptr; // Saved decoding info
if (len == 0) return;
@@ -168,7 +168,6 @@ Boolean confirm(MsgKind msgno) {
void quit() {
char buf[80];
- char choices[10];
para();
while (!g_vm->shouldQuit()) {
@@ -203,7 +202,7 @@ void cancl(Aword evt) {
int i;
for (i = etop - 1; i >= 0; i--)
- if (eventq[i].event == evt) {
+ if (eventq[i].event == (int)evt) {
while (i < etop - 1) {
eventq[i].event = eventq[i + 1].event;
eventq[i].time = eventq[i + 1].time;
@@ -406,12 +405,14 @@ void incr(Aword id, Aword atr, Aword step) {
void decr(Aword id, Aword atr, Aword step) {
char str[80];
+ // TODO: Original did explicit negation on an unsigned value. Make sure that the
+ // casts added to ignore the warnings are okay
if (isObj(id))
- incrobj(id, atr, -step);
+ incrobj(id, atr, static_cast<uint>(-(int)step));
else if (isLoc(id))
- incrloc(id, atr, -step);
+ incrloc(id, atr, static_cast<uint>(-(int)step));
else if (isAct(id))
- incract(id, atr, -step);
+ incract(id, atr, static_cast<uint>(-(int)step));
else {
sprintf(str, "Can't DECR item (%ld).", (unsigned long) id);
syserr(str);
@@ -519,9 +520,9 @@ Aint agrmax(Aword atr, Aword whr) {
for (i = OBJMIN; i <= OBJMAX; i++) {
if (isLoc(whr)) {
- if (where(i) == whr && attribute(i, atr) > max)
+ if (where(i) == whr && (int)attribute(i, atr) > max)
max = attribute(i, atr);
- } else if (objs[i - OBJMIN].loc == whr && attribute(i, atr) > max)
+ } else if (objs[i - OBJMIN].loc == whr && (int)attribute(i, atr) > max)
max = attribute(i, atr);
}
return (max);
@@ -605,7 +606,7 @@ static void locact(Aword act, Aword whr) {
cur.act = prevact;
}
- if (cur.act != act)
+ if (cur.act != (int)act)
cur.loc = prevloc;
}
@@ -634,13 +635,14 @@ static Abool objhere(Aword obj) {
if (isObj(objs[obj - OBJMIN].loc) || isAct(objs[obj - OBJMIN].loc))
return (isHere(objs[obj - OBJMIN].loc));
else /* If the container wasn't anywhere, assume where HERO is! */
- return (where(HERO) == cur.loc);
- } else
- return (objs[obj - OBJMIN].loc == cur.loc);
+ return ((int)where(HERO) == cur.loc);
+ } else {
+ return (int)(objs[obj - OBJMIN].loc) == cur.loc;
+ }
}
static Aword acthere(Aword act) {
- return (acts[act - ACTMIN].loc == cur.loc);
+ return (int)(acts[act - ACTMIN].loc) == cur.loc;
}
Abool isHere(Aword id) {
@@ -879,9 +881,9 @@ void use(Aword act, Aword scr) {
*/
void list(Aword cnt) {
- int i;
+ uint i;
Aword props;
- Aword prevobj;
+ Aword prevobj = 0;
Boolean found = FALSE;
Boolean multiple = FALSE;
@@ -949,9 +951,7 @@ void list(Aword cnt) {
*/
void empty(Aword cnt, Aword whr) {
- int i;
-
- for (i = OBJMIN; i <= OBJMAX; i++)
+ for (uint i = OBJMIN; i <= OBJMAX; i++)
if (in(i, cnt))
locate(i, whr);
}
@@ -968,22 +968,21 @@ void empty(Aword cnt, Aword whr) {
\*----------------------------------------------------------------------*/
void dscrobjs() {
- int i;
- int prevobj;
+ uint i;
+ int prevobj = 0;
Boolean found = FALSE;
Boolean multiple = FALSE;
/* First describe everything here with its own description */
for (i = OBJMIN; i <= OBJMAX; i++)
- if (objs[i - OBJMIN].loc == cur.loc &&
+ if ((int)objs[i - OBJMIN].loc == cur.loc &&
objs[i - OBJMIN].describe &&
objs[i - OBJMIN].dscr1)
describe(i);
/* Then list everything else here */
for (i = OBJMIN; i <= OBJMAX; i++)
- if (objs[i - OBJMIN].loc == cur.loc &&
- objs[i - OBJMIN].describe) {
+ if ((int)objs[i - OBJMIN].loc == cur.loc && objs[i - OBJMIN].describe) {
if (!found) {
prmsg(M_SEEOBJ1);
sayarticle(i);
@@ -1016,11 +1015,10 @@ void dscrobjs() {
}
void dscracts() {
- int i;
+ uint i;
for (i = HERO + 1; i <= ACTMAX; i++)
- if (acts[i - ACTMIN].loc == cur.loc &&
- acts[i - ACTMIN].describe)
+ if ((int)acts[i - ACTMIN].loc == cur.loc && acts[i - ACTMIN].describe)
describe(i);
/* Set describe flag for all actors */
@@ -1029,7 +1027,7 @@ void dscracts() {
}
void look() {
- int i;
+ uint i;
if (looking)
syserr("Recursive LOOK.");
diff --git a/engines/glk/alan2/inter.cpp b/engines/glk/alan2/inter.cpp
index 82486ee854..0c7d51d67e 100644
--- a/engines/glk/alan2/inter.cpp
+++ b/engines/glk/alan2/inter.cpp
@@ -156,7 +156,7 @@ void interpret(Aaddr adr) {
pc = adr;
while (TRUE) {
if (stpflg) printf("\n%4x: ", pc);
- if (pc > memTop)
+ if (pc > (int)memTop)
syserr("Interpreting outside program.");
i = memory[pc++];
@@ -484,11 +484,11 @@ void interpret(Aaddr adr) {
break;
}
case I_SAYSTR: {
- Aptr adr;
- adr = pop();
+ Aptr sayAdr;
+ sayAdr = pop();
if (stpflg)
- printf("SAYSTR\t%5ld\t\t\"", adr);
- saystr((char *)adr);
+ printf("SAYSTR\t%5ld\t\t\"", sayAdr);
+ saystr((char *)sayAdr);
if (stpflg)
printf("\"");
break;
diff --git a/engines/glk/alan2/main.cpp b/engines/glk/alan2/main.cpp
index 8f9752dab0..56e5f72dc8 100644
--- a/engines/glk/alan2/main.cpp
+++ b/engines/glk/alan2/main.cpp
@@ -46,12 +46,12 @@ namespace Alan2 {
/* The Amachine memory */
Aword *memory;
-//static AcdHdr dummyHeader; /* Dummy to use until memory allocated */
+//static AcdHdr dummyHeader; // Dummy to use until memory allocated
AcdHdr *header;
-int memTop; /* Top of load memory */
+Aaddr memTop; // Top of load memory
-int conjWord; /* First conjunction in dictonary, for ',' */
+int conjWord; // First conjunction in dictonary, for ','
/* Amachine variables */
@@ -327,20 +327,22 @@ static void space() {
*/
static void sayparam(int p) {
- int i;
-
- for (i = 0; i <= p; i++)
+ for (int i = 0; i <= p; i++) {
if (params[i].code == EOD)
syserr("Nonexistent parameter referenced.");
+ }
- if (params[p].firstWord == EOD) /* Any words he used? */
+ // Any words he used?
+ if (params[p].firstWord == EOD) {
say(params[p].code);
- else /* Yes, so use them... */
- for (i = params[p].firstWord; i <= params[p].lastWord; i++) {
+ } else {
+ // Yes, so use them...
+ for (uint i = params[p].firstWord; i <= params[p].lastWord; i++) {
just((char *)addrTo(dict[wrds[i]].wrd));
if (i < params[p].lastWord)
just(" ");
}
+ }
}
@@ -539,7 +541,7 @@ Boolean exitto(int to, int from) {
return (FALSE); /* No exits */
for (ext = (ExtElem *) addrTo(locs[from - LOCMIN].exts); !endOfTable(ext); ext++)
- if (ext->next == to)
+ if ((int)ext->next == to)
return (TRUE);
return (FALSE);
@@ -553,13 +555,13 @@ Boolean exitto(int to, int from) {
*/
static int count(int cnt /* IN - the container to count */) {
- int i, j = 0;
+ int j = 0;
- for (i = OBJMIN; i <= OBJMAX; i++)
+ for (uint i = OBJMIN; i <= OBJMAX; i++)
if (in(i, cnt))
/* Then it's in this container also */
j++;
- return (j);
+ return j;
}
@@ -573,7 +575,7 @@ static int sumatr(
Aword atr, /* IN - the attribute to sum over */
Aword cnt /* IN - the container to sum */
) {
- int i;
+ uint i;
int sum = 0;
for (i = OBJMIN; i <= OBJMAX; i++)
@@ -614,7 +616,7 @@ Boolean checklim(
if (cnts[props - CNTMIN].lims != 0) { /* Any limits at all? */
for (lim = (LimElem *) addrTo(cnts[props - CNTMIN].lims); !endOfTable(lim); lim++)
if (lim->atr == 0) {
- if (count(cnt) >= lim->val) {
+ if (count(cnt) >= (int)lim->val) {
interpret(lim->stms);
return (TRUE); /* Limit check failed */
}
@@ -683,7 +685,7 @@ void go(int dir) {
ext = (ExtElem *) addrTo(locs[cur.loc - LOCMIN].exts);
if (locs[cur.loc - LOCMIN].exts != 0)
while (!endOfTable(ext)) {
- if (ext->code == dir) {
+ if ((int)ext->code == dir) {
ok = TRUE;
if (ext->checks != 0) {
if (trcflg) {
@@ -743,7 +745,7 @@ static AltElem *findalt(
return (NULL);
for (vrb = (VrbElem *) addrTo(vrbsadr); !endOfTable(vrb); vrb++)
- if (vrb->code == cur.vrb) {
+ if ((int)vrb->code == cur.vrb) {
for (alt = (AltElem *) addrTo(vrb->alts); !endOfTable(alt); alt++)
if (alt->param == param || alt->param == 0)
return alt;
@@ -1026,7 +1028,7 @@ static char logfnm[256];
checkvers()
*/
-static void checkvers(AcdHdr *header) {
+static void checkvers(AcdHdr *hdr) {
char vers[4];
char state[2];
@@ -1036,34 +1038,34 @@ static void checkvers(AcdHdr *header) {
/* Check version of .ACD file */
if (dbgflg) {
- state[0] = header->vers[3];
+ state[0] = hdr->vers[3];
state[1] = '\0';
printf("<Version of '%s' is %d.%d(%d)%s>",
advnam,
- (int)(header->vers[0]),
- (int)(header->vers[1]),
- (int)(header->vers[2]),
- (header->vers[3]) == 0 ? "" : state);
+ (int)(hdr->vers[0]),
+ (int)(hdr->vers[1]),
+ (int)(hdr->vers[2]),
+ (hdr->vers[3]) == 0 ? "" : state);
newline();
}
/* Compatible if version and revision match... */
- if (strncmp(header->vers, vers, 2) != 0) {
+ if (strncmp(hdr->vers, vers, 2) != 0) {
#ifdef V25COMPATIBLE
- if (header->vers[0] == 2 && header->vers[1] == 5) /* Check for 2.5 version */
+ if (hdr->vers[0] == 2 && hdr->vers[1] == 5) /* Check for 2.5 version */
/* This we can convert later if needed... */;
else
#endif
#ifdef V27COMPATIBLE
- if (header->vers[0] == 2 && header->vers[1] == 7) /* Check for 2.7 version */
+ if (hdr->vers[0] == 2 && hdr->vers[1] == 7) /* Check for 2.7 version */
/* This we can convert later if needed... */;
else
#endif
if (errflg) {
char str[80];
sprintf(str, "Incompatible version of ACODE program. Game is %ld.%ld, interpreter %ld.%ld.",
- (long)(header->vers[0]),
- (long)(header->vers[1]),
+ (long)(hdr->vers[0]),
+ (long)(hdr->vers[1]),
(long) alan.version.version,
(long) alan.version.revision);
syserr(str);
@@ -1081,7 +1083,7 @@ static void checkvers(AcdHdr *header) {
static void load() {
AcdHdr tmphdr;
Aword crc = 0;
- int i;
+ uint i;
char err[100];
Aword *ptr = (Aword *)&tmphdr + 1;
@@ -1106,7 +1108,7 @@ static void load() {
memTop = tmphdr.size;
header = (AcdHdr *) addrTo(0);
- if ((tmphdr.size * sizeof(Aword)) > codfil->size())
+ if ((int)(tmphdr.size * sizeof(Aword)) > codfil->size())
::error("Header size is greater than filesize");
codfil->seek(0);
@@ -1286,7 +1288,7 @@ static void movactor() {
ActElem *act = (ActElem *) &acts[cur.act - ACTMIN];
cur.loc = where(cur.act);
- if (cur.act == HERO) {
+ if (cur.act == (int)HERO) {
parse();
if (g_vm->shouldQuit())
return;
@@ -1370,17 +1372,13 @@ static void movactor() {
*/
static void openFiles() {
- char str[256];
- char *usr = "";
- time_t tick;
-
{
char *s = strrchr(codfnm, '\\');
if (!s) s = strrchr(codfnm, '/');
g_vm->garglk_set_story_name(s ? s + 1 : codfnm);
}
- /* Open Text file */
+ // Open Text file
strcpy(txtfnm, advnam);
strcat(txtfnm, ".dat");
@@ -1427,7 +1425,7 @@ void run() {
// (void) setjmp(jmpbuf);
// Move all characters
- for (cur.act = ACTMIN; cur.act <= ACTMAX; cur.act++) {
+ for (cur.act = ACTMIN; cur.act <= (int)ACTMAX; cur.act++) {
movactor();
if (g_vm->shouldQuit())
return;
diff --git a/engines/glk/alan2/main.h b/engines/glk/alan2/main.h
index 3d0f308540..9dffbc343a 100644
--- a/engines/glk/alan2/main.h
+++ b/engines/glk/alan2/main.h
@@ -35,9 +35,9 @@ namespace Alan2 {
#define MEMORYSIZE 1000L
-extern int memTop; /* Top of memory */
+extern Aaddr memTop; // Top of memory
-extern int conjWord; /* First conjunction in dictionary */
+extern int conjWord; // First conjunction in dictionary
/* The Amachine memory */
extern Aword *memory;
diff --git a/engines/glk/alan2/parse.cpp b/engines/glk/alan2/parse.cpp
index a12a655870..a977546de0 100644
--- a/engines/glk/alan2/parse.cpp
+++ b/engines/glk/alan2/parse.cpp
@@ -116,23 +116,24 @@ static int lookup(char wrd[]) {
return (EOD);
}
-static int number(char token[] /* IN - The string to convert to a number */) {
+/* IN - The string to convert to a number */
+static int number(char tok[]) {
int i;
- sscanf(token, "%d", &i);
+ sscanf(tok, "%d", &i);
return i;
}
-static char *gettoken(char *buf) {
+static char *gettoken(char *tokBuf) {
static char *marker;
static char oldch;
- if (buf == NULL)
+ if (tokBuf == NULL)
*marker = oldch;
else
- marker = buf;
+ marker = tokBuf;
while (*marker != '\0' && isSpace(*marker) && *marker != '\n') marker++;
- buf = marker;
+ tokBuf = marker;
if (isISOLetter(*marker))
while (*marker && (isISOLetter(*marker) || isdigit(*marker) || *marker == '\'')) marker++;
else if (isdigit(*marker))
@@ -147,7 +148,7 @@ static char *gettoken(char *buf) {
marker++;
oldch = *marker;
*marker = '\0';
- return buf;
+ return tokBuf;
}
static void agetline() {
@@ -263,10 +264,10 @@ static void nonverb() {
}
static void buildall(ParamElem list[]) {
- int o, i = 0;
+ int i = 0;
Boolean found = FALSE;
- for (o = OBJMIN; o <= OBJMAX; o++)
+ for (uint o = OBJMIN; o <= OBJMAX; o++)
if (isHere(o)) {
found = TRUE;
list[i].code = o;
@@ -508,7 +509,7 @@ static void resolve(ParamElem plst[]) {
}
}
-static void tryMatch(ParamElem mlst[] /* OUT - List of params allowed by multiple */) {
+static void tryMatch(ParamElem matchLst[] /* OUT - List of params allowed by multiple */) {
ElmElem *elms; /* Pointer to element list */
StxElem *stx; /* Pointer to syntax list */
ClaElem *cla; /* Pointer to class definitions */
@@ -523,7 +524,7 @@ static void tryMatch(ParamElem mlst[] /* OUT - List of params allowed by multipl
}
for (stx = stxs; !endOfTable(stx); stx++)
- if (stx->code == vrbcode)
+ if ((int)stx->code == vrbcode)
break;
if (endOfTable(stx))
error(M_WHAT);
@@ -571,7 +572,7 @@ static void tryMatch(ParamElem mlst[] /* OUT - List of params allowed by multipl
actual parameter values later
*/
params[paramidx++].code = 0;
- lstcpy(mlst, tlst);
+ lstcpy(matchLst, tlst);
anyPlural = TRUE;
}
} else
@@ -591,8 +592,8 @@ static void tryMatch(ParamElem mlst[] /* OUT - List of params allowed by multipl
for (cla = (ClaElem *) addrTo(elms->next); !endOfTable(cla); cla++) {
if (params[cla->code - 1].code == 0) {
/* This was a multiple parameter, so check all and remove failing */
- for (i = 0; mlst[i].code != EOD; i++) {
- params[cla->code - 1] = mlst[i];
+ for (i = 0; matchLst[i].code != EOD; i++) {
+ params[cla->code - 1] = matchLst[i];
if (!claCheck(cla)) {
/* Multiple could be both an explicit list of params and an ALL */
if (allLength == 0) {
@@ -606,7 +607,7 @@ static void tryMatch(ParamElem mlst[] /* OUT - List of params allowed by multipl
interpret(cla->stms);
para();
}
- mlst[i].code = 0; /* In any case remove it from the list */
+ matchLst[i].code = 0; /* In any case remove it from the list */
}
}
params[cla->code - 1].code = 0;
@@ -623,10 +624,10 @@ static void tryMatch(ParamElem mlst[] /* OUT - List of params allowed by multipl
if (!checked[p]) {
if (params[p].code == 0) {
/* This was a multiple parameter, check all and remove failing */
- for (i = 0; mlst[i].code != EOD; i++)
- if (mlst[i].code != 0) /* Skip any empty slots */
- if (!isObj(mlst[i].code))
- mlst[i].code = 0;
+ for (i = 0; matchLst[i].code != EOD; i++)
+ if (matchLst[i].code != 0) /* Skip any empty slots */
+ if (!isObj(matchLst[i].code))
+ matchLst[i].code = 0;
} else if (!isObj(params[p].code))
error(M_CANT0);
}
@@ -638,21 +639,21 @@ static void tryMatch(ParamElem mlst[] /* OUT - List of params allowed by multipl
if (allLength > 0) {
for (p = 0; params[p].code != 0; p++); /* Find multiple marker */
for (i = 0; i < allLength; i++) {
- if (mlst[i].code != 0) { /* Already empty? */
- params[p] = mlst[i];
+ if (matchLst[i].code != 0) { /* Already empty? */
+ params[p] = matchLst[i];
if (!possible())
- mlst[i].code = 0; /* Remove this from list */
+ matchLst[i].code = 0; /* Remove this from list */
}
}
params[p].code = 0; /* Restore multiple marker */
- compact(mlst);
- if (lstlen(mlst) == 0) {
+ compact(matchLst);
+ if (lstlen(matchLst) == 0) {
params[0].code = EOD;
error(M_WHAT_ALL);
}
} else if (anyPlural) {
- compact(mlst);
- if (lstlen(mlst) == 0)
+ compact(matchLst);
+ if (lstlen(matchLst) == 0)
/* If there where multiple parameters but non left, exit without a */
/* word, assuming we have already said enough */
error(MSGMAX);
@@ -660,8 +661,9 @@ static void tryMatch(ParamElem mlst[] /* OUT - List of params allowed by multipl
plural = anyPlural; /* Remember that we found plural objects */
}
-static void match(ParamElem *mlst /* OUT - List of params allowed by multiple */) {
- tryMatch(mlst); /* ... to understand what he said */
+/* OUT - List of params allowed by multiple */
+static void match(ParamElem *matchLst) {
+ tryMatch(matchLst); /* ... to understand what he said */
if (wrds[wrdidx] != EOD && !isConj(wrds[wrdidx]))
error(M_WHAT);
if (wrds[wrdidx] != EOD) /* More on this line? */
diff --git a/engines/glk/alan2/sysdep.cpp b/engines/glk/alan2/sysdep.cpp
index dc6e0b6f95..98b8ca6d68 100644
--- a/engines/glk/alan2/sysdep.cpp
+++ b/engines/glk/alan2/sysdep.cpp
@@ -158,14 +158,14 @@ char *strupp(char str[]) { /* INOUT - Native string to convert */
/* The following work on ISO characters */
int isLowerCase(int c) { /* IN - ISO character to test */
- static char lowChrs[] = "abcdefghijklmnopqrstuvwxyz\340\341\342\343\344\345\346\347\351\352\353\354\355\356\357\360\361\362\363\364\365\366\370\371\372\373\374\375\376\377";
- return (c != '\0' && strchr(lowChrs, c) != 0);
+ static char lowChars[] = "abcdefghijklmnopqrstuvwxyz\340\341\342\343\344\345\346\347\351\352\353\354\355\356\357\360\361\362\363\364\365\366\370\371\372\373\374\375\376\377";
+ return (c != '\0' && strchr(lowChars, c) != 0);
}
int isUpperCase(int c) { /* IN - ISO character to test */
- static char uppChrs[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337";
- return (c != '\0' && strchr(uppChrs, c) != 0);
+ static char upperChars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337";
+ return (c != '\0' && strchr(upperChars, c) != 0);
}
diff --git a/engines/glk/glulxe/serial.cpp b/engines/glk/glulxe/serial.cpp
index 81cfa9e41b..983053aae0 100644
--- a/engines/glk/glulxe/serial.cpp
+++ b/engines/glk/glulxe/serial.cpp
@@ -364,7 +364,7 @@ Common::Error Glulxe::writeGameData(Common::WriteStream *ws) {
Common::Error Glulxe::readSaveData(Common::SeekableReadStream *rs) {
dest_t dest;
int ix;
- uint lx, res, val;
+ uint lx = 0, res, val;
uint filestart, filelen = 0;
uint heapsumlen = 0;
uint *heapsumarr = nullptr;
diff --git a/engines/glk/quetzal.cpp b/engines/glk/quetzal.cpp
index 68c11d0996..b83d855f57 100644
--- a/engines/glk/quetzal.cpp
+++ b/engines/glk/quetzal.cpp
@@ -203,7 +203,7 @@ void QuetzalWriter::addCommonChunks(const Common::String &saveName) {
ws.write(saveName.c_str(), saveName.size());
ws.writeByte(0);
}
- Common::Language l;
+
// Write 'SCVM' chunk with game version & gameplay statistics
{
Common::WriteStream &ws = add(ID_SCVM);