From f282fbb49bf941c5b8ac1a2dd0b26a4a63978060 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 6 Jul 2019 16:14:54 -0700 Subject: GLK: ALAN3: Fix gcc errors --- engines/glk/alan3/glkio.cpp | 2 +- engines/glk/alan3/instance.cpp | 9 ++++++--- engines/glk/alan3/inter.cpp | 2 ++ engines/glk/alan3/version.h | 28 ++++++++++++++-------------- 4 files changed, 23 insertions(+), 18 deletions(-) (limited to 'engines') diff --git a/engines/glk/alan3/glkio.cpp b/engines/glk/alan3/glkio.cpp index c88e9fa74b..3f0da03333 100644 --- a/engines/glk/alan3/glkio.cpp +++ b/engines/glk/alan3/glkio.cpp @@ -125,7 +125,7 @@ void GlkIO::setStyle(int style) { } void GlkIO::statusLine(CONTEXT) { - uint32 glkWidth; + uint glkWidth; char line[100]; int pcol = col; diff --git a/engines/glk/alan3/instance.cpp b/engines/glk/alan3/instance.cpp index b738fd6a83..e1fab8d78a 100644 --- a/engines/glk/alan3/instance.cpp +++ b/engines/glk/alan3/instance.cpp @@ -289,10 +289,13 @@ bool isAt(int instance, int other, ATrans trans) { switch (trans) { case DIRECT: return admin[instance].location == other; + case INDIRECT: if (curr == other) return FALSE; curr = admin[curr].location; + // fall through + case TRANSITIVE: while (curr != 0) { if (curr == other) @@ -302,6 +305,7 @@ bool isAt(int instance, int other, ATrans trans) { } return FALSE; } + syserr("Unexpected value in switch in isAt() for location"); return FALSE; } else if (isALocation(other)) { @@ -309,11 +313,10 @@ bool isAt(int instance, int other, ATrans trans) { switch (trans) { case DIRECT: return admin[instance].location == other; - case INDIRECT: { + case INDIRECT: if (admin[instance].location == other) return FALSE; /* Directly, so not Indirectly */ - /* Fall through to transitive handling of the location */ - } + // fall through case TRANSITIVE: { int location = locationOf(instance); int curr = other; diff --git a/engines/glk/alan3/inter.cpp b/engines/glk/alan3/inter.cpp index 4708cf8bd3..5d70b393f2 100644 --- a/engines/glk/alan3/inter.cpp +++ b/engines/glk/alan3/inter.cpp @@ -254,6 +254,8 @@ static void depexec(Aword v) { break; case I_DEPCASE: instructionString = "DEPCASE"; + // fall through + case I_DEPELSE: if (lev == 1) { if (traceInstructionOption) diff --git a/engines/glk/alan3/version.h b/engines/glk/alan3/version.h index e2056ab52a..56c4098a5c 100644 --- a/engines/glk/alan3/version.h +++ b/engines/glk/alan3/version.h @@ -31,24 +31,24 @@ namespace Alan3 { typedef int64 Time; struct Version { - char *string; - int version; - int revision; - int correction; + const char *string; + int version; + int revision; + int correction; Time time; - const char *state; + const char *state; }; struct Product { - const char *name; - const char *slogan; - const char *shortHeader; - const char *longHeader; - const char *date; - const char *time; - const char *user; - const char *host; - const char *ostype; + const char *name; + const char *slogan; + const char *shortHeader; + const char *longHeader; + const char *date; + const char *time; + const char *user; + const char *host; + const char *ostype; Version version; }; -- cgit v1.2.3