GLK: TADS2: Fix uninitialized variable warnings

This commit is contained in:
Paul Gilbert 2019-05-22 21:39:41 -07:00
parent 8f9fcec16c
commit 0d0dbf601e
3 changed files with 14 additions and 11 deletions

View File

@ -2448,7 +2448,7 @@ static int outformatlen_stream(out_stream_info *stream,
|| !scumm_stricmp(tagbuf, "em") || !scumm_stricmp(tagbuf, "em")
|| !scumm_stricmp(tagbuf, "strong")) || !scumm_stricmp(tagbuf, "strong"))
{ {
int attr; int attr = 0;
/* choose the attribute flag */ /* choose the attribute flag */
switch (tagbuf[0]) switch (tagbuf[0])

View File

@ -1096,15 +1096,19 @@ void runexe(runcxdef *ctx, uchar *p0, objnum self, objnum target,
runsdef val; /* stack element (for pushing) */ runsdef val; /* stack element (for pushing) */
runsdef val2; /* another one (for popping in two-op instructions) */ runsdef val2; /* another one (for popping in two-op instructions) */
uint ofs; /* offset in code of current execution */ uint ofs; /* offset in code of current execution */
prpnum prop; /* property number, when needed */ prpnum prop = 0; /* property number, when needed */
objnum obj; /* object number, when needed */ objnum obj = 0; /* object number, when needed */
runsdef *noreg rstsp; /* sp to reset to on DISCARD instructions */ runsdef *noreg rstsp; /* sp to reset to on DISCARD instructions */
uchar *lstp; /* list pointer */ uchar *lstp = nullptr; /* list pointer */
int nargc; /* argument count of called function */ int nargc; /* argument count of called function */
runsdef *valp; runsdef *valp;
runsdef *stkval; runsdef *stkval;
int i; int i = 0;
int brkchk; int brkchk;
runsdef val3;
int asityp;
int asiext = 0;
int lclnum = 0;
#ifndef DBG_OFF #ifndef DBG_OFF
int err; int err;
@ -1954,11 +1958,6 @@ resume_from_error:
default: default:
if ((opc & OPCASI_MASK) == OPCASI_MASK) if ((opc & OPCASI_MASK) == OPCASI_MASK)
{ {
runsdef val3;
int asityp;
int asiext;
int lclnum;
valp = &val; valp = &val;
stkval = &val; stkval = &val;

View File

@ -57,7 +57,11 @@ struct runsdef {
objnum runsvobj; /* object value */ objnum runsvobj; /* object value */
prpnum runsvprp; /* property number value */ prpnum runsvprp; /* property number value */
uchar *runsvstr; /* string/list value */ uchar *runsvstr; /* string/list value */
} runsv; } runsv;
runsdef() : runstyp(0) {
runsv.runsvnum = 0;
}
}; };
/* external function control structure */ /* external function control structure */