[Scummvm-git-logs] scummvm master -> cf823c0733a3a6c74545f912c4d0a438a35f785d
digitall
dgturner at iee.org
Tue Sep 3 11:05:00 CEST 2019
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
cf823c0733 GLK: TADS: Fix GCC Compiler Warnings
Commit: cf823c0733a3a6c74545f912c4d0a438a35f785d
https://github.com/scummvm/scummvm/commit/cf823c0733a3a6c74545f912c4d0a438a35f785d
Author: D G Turner (digitall at scummvm.org)
Date: 2019-09-03T10:01:50+01:00
Commit Message:
GLK: TADS: Fix GCC Compiler Warnings
These were several undeclared fallthrough warnings i.e. after error
handler cases which will not return and another case of usage of
memset on a non-trivial structure which was fixed by using structure
constructor methods instead.
Changed paths:
engines/glk/tads/tads2/built_in.h
engines/glk/tads/tads2/regex.h
engines/glk/tads/tads2/run.cpp
engines/glk/tads/tads2/runtime_driver.cpp
diff --git a/engines/glk/tads/tads2/built_in.h b/engines/glk/tads/tads2/built_in.h
index 5078eda..c735d56 100644
--- a/engines/glk/tads/tads2/built_in.h
+++ b/engines/glk/tads/tads2/built_in.h
@@ -52,6 +52,8 @@ struct biffildef {
osfildef *fp; /* underyling system file handle */
uint flags; /* flags */
#define BIFFIL_F_BINARY 0x01 /* file is binary */
+
+ biffildef() : fp(nullptr), flags(0) {}
};
/* built-in execution context */
diff --git a/engines/glk/tads/tads2/regex.h b/engines/glk/tads/tads2/regex.h
index 48c2dd0..0f3acfc 100644
--- a/engines/glk/tads/tads2/regex.h
+++ b/engines/glk/tads/tads2/regex.h
@@ -46,10 +46,12 @@ typedef int re_state_id;
* Group register structure. Each register keeps track of the starting
* and ending offset of the group's text.
*/
-typedef struct
+typedef struct _re_group_register
{
const char *start_ofs;
const char *end_ofs;
+
+ _re_group_register() : start_ofs(nullptr), end_ofs(nullptr) {}
} re_group_register;
/* number of group registers we keep */
@@ -98,7 +100,7 @@ typedef struct
* state of the compilation and stores the resources associated with the
* compiled expression.
*/
-typedef struct
+typedef struct _re_context
{
/* error context */
errcxdef *errctx;
@@ -135,6 +137,8 @@ typedef struct
/* size of the buffer allocated to strbuf */
size_t strbufsiz;
+
+ _re_context() : errctx(nullptr), next_state(0), tuple_arr(nullptr), tuples_alloc(0), cur_group(0), strbuf(nullptr), curlen(0), strbufsiz(0) {}
} re_context;
diff --git a/engines/glk/tads/tads2/run.cpp b/engines/glk/tads/tads2/run.cpp
index 0def6a7..03fd80a 100644
--- a/engines/glk/tads/tads2/run.cpp
+++ b/engines/glk/tads/tads2/run.cpp
@@ -1397,8 +1397,8 @@ resume_from_error:
runrepush(ctx, otherbp + runrp2s(p + 4) - 1);
p += 6;
}
- break;
#endif
+ break;
case OPCGETLCL:
runrepush(ctx, ctx->runcxbp + runrp2s(p) - 1);
@@ -1659,19 +1659,19 @@ resume_from_error:
case OPCEXIT:
errsig(ctx->runcxerr, ERR_RUNEXIT);
- /* NOTREACHED */
+ break;
case OPCABORT:
errsig(ctx->runcxerr, ERR_RUNABRT);
- /* NOTREACHED */
+ break;
case OPCASKDO:
errsig(ctx->runcxerr, ERR_RUNASKD);
- /* NOTREACHED */
+ break;
case OPCASKIO:
errsig1(ctx->runcxerr, ERR_RUNASKI, ERRTINT, osrp2(p));
- /* NOTREACHED */
+ break;
case OPCJE:
p += (runeq(ctx) ? runrp2s(p) : 2);
diff --git a/engines/glk/tads/tads2/runtime_driver.cpp b/engines/glk/tads/tads2/runtime_driver.cpp
index 6f1674d..2eb6602 100644
--- a/engines/glk/tads/tads2/runtime_driver.cpp
+++ b/engines/glk/tads/tads2/runtime_driver.cpp
@@ -675,7 +675,6 @@ static void trdmain1(errcxdef *ec, int argc, char *argv[],
dbg.dbgcxlin = (lindef *)0; /* no line sources yet */
/* set up built-in function context */
- CLRSTRUCT(bifctx);
bifctx.bifcxerr = ec;
bifctx.bifcxrun = &runctx;
bifctx.bifcxtio = (tiocxdef *)0;
More information about the Scummvm-git-logs
mailing list