diff options
author | dreammaster | 2019-06-22 04:15:20 +0100 |
---|---|---|
committer | Paul Gilbert | 2019-06-22 14:40:50 -0700 |
commit | 2cf0320569c80c8e389e44d1b0463792ddf8e7cd (patch) | |
tree | f71d988b3b8dc6948d004551fd2a4e02697f2aea /engines | |
parent | 2450df501c152249fe1002a7dee70642563d40a3 (diff) | |
download | scummvm-rg350-2cf0320569c80c8e389e44d1b0463792ddf8e7cd.tar.gz scummvm-rg350-2cf0320569c80c8e389e44d1b0463792ddf8e7cd.tar.bz2 scummvm-rg350-2cf0320569c80c8e389e44d1b0463792ddf8e7cd.zip |
GLK: ALAN2: Fixing gcc warnings
Diffstat (limited to 'engines')
-rw-r--r-- | engines/glk/alan2/acode.h | 8 | ||||
-rw-r--r-- | engines/glk/alan2/alan2.cpp | 6 | ||||
-rw-r--r-- | engines/glk/alan2/glkio.cpp | 3 | ||||
-rw-r--r-- | engines/glk/alan2/glkio.h | 3 | ||||
-rw-r--r-- | engines/glk/alan2/main.cpp | 2 | ||||
-rw-r--r-- | engines/glk/alan2/main.h | 2 | ||||
-rw-r--r-- | engines/glk/alan2/reverse.cpp | 9 | ||||
-rw-r--r-- | engines/glk/alan2/version.h | 24 |
8 files changed, 31 insertions, 26 deletions
diff --git a/engines/glk/alan2/acode.h b/engines/glk/alan2/acode.h index 35153ceb7b..dcc292b16b 100644 --- a/engines/glk/alan2/acode.h +++ b/engines/glk/alan2/acode.h @@ -72,7 +72,13 @@ typedef int WrdKind; /* Syntax element classifications */ -#define EOS (-2) /* End Of Syntax */ +// End of file +#ifdef EOF +#undef EOF +#endif +#define EOF ((uint32)-1) +// End of syntax +#define EOS ((uint32)-2) /* Syntax element flag bits */ #define MULTIPLEBIT 0x1 diff --git a/engines/glk/alan2/alan2.cpp b/engines/glk/alan2/alan2.cpp index 6f65ddfc42..4e6babc4c1 100644 --- a/engines/glk/alan2/alan2.cpp +++ b/engines/glk/alan2/alan2.cpp @@ -99,7 +99,7 @@ void syncVal(Common::Serializer &s, uint32 *fld) { void Alan2::synchronizeSave(Common::Serializer &s) { AtrElem *atr; - int i; + Aword i; // Sync current values cur.synchronize(s); @@ -136,7 +136,7 @@ void Alan2::synchronizeSave(Common::Serializer &s) { // Sync the event queue if (s.isSaving()) { eventq[etop].time = 0; // Mark the top - for (i = 0; i <= etop; ++i) + for (i = 0; i <= (Aword)etop; ++i) eventq[i].synchronize(s); } else { for (etop = 0; eventq[etop - 1].time; ++etop) @@ -145,7 +145,7 @@ void Alan2::synchronizeSave(Common::Serializer &s) { } // Sync scores - for (i = 0; scores[i] != EOF; i++) + for (i = 0; (int)scores[i] != EOF; i++) syncVal(s, &scores[i]); } diff --git a/engines/glk/alan2/glkio.cpp b/engines/glk/alan2/glkio.cpp index 29c4875a4a..fda54deec8 100644 --- a/engines/glk/alan2/glkio.cpp +++ b/engines/glk/alan2/glkio.cpp @@ -30,7 +30,7 @@ namespace Alan2 { winid_t glkMainWin; winid_t glkStatusWin; -void glkio_printf(char *fmt, ...) { +void glkio_printf(const char *fmt, ...) { va_list argp; va_start(argp, fmt); if (glkMainWin) { @@ -48,3 +48,4 @@ void glkio_printf(char *fmt, ...) { } // End of namespace Alan2 } // End of namespace Glk + diff --git a/engines/glk/alan2/glkio.h b/engines/glk/alan2/glkio.h index 8c1dee2ff5..2dff66f6ea 100644 --- a/engines/glk/alan2/glkio.h +++ b/engines/glk/alan2/glkio.h @@ -39,9 +39,10 @@ extern winid_t glkStatusWin; #undef printf #define printf glkio_printf -void glkio_printf(char *, ...); +void glkio_printf(const char *, ...); } // End of namespace Alan2 } // End of namespace Glk #endif + diff --git a/engines/glk/alan2/main.cpp b/engines/glk/alan2/main.cpp index 7dadbea171..f585e7d584 100644 --- a/engines/glk/alan2/main.cpp +++ b/engines/glk/alan2/main.cpp @@ -434,7 +434,7 @@ static void prsym( recogniced and performed. */ -void output(char original[]) { +void output(const char original[]) { char ch; char *str, *copy; char *symptr; diff --git a/engines/glk/alan2/main.h b/engines/glk/alan2/main.h index 1c21dc83b5..10b0015a44 100644 --- a/engines/glk/alan2/main.h +++ b/engines/glk/alan2/main.h @@ -103,7 +103,7 @@ extern void usage(void); extern void error(MsgKind msg); extern void syserr(const char *msg); extern void statusline(void); -extern void output(char string[]); +extern void output(const char string[]); extern void prmsg(MsgKind msg); extern void para(void); extern void newline(void); diff --git a/engines/glk/alan2/reverse.cpp b/engines/glk/alan2/reverse.cpp index a79ae02a47..34d50d9d5e 100644 --- a/engines/glk/alan2/reverse.cpp +++ b/engines/glk/alan2/reverse.cpp @@ -37,12 +37,11 @@ namespace Alan2 { Aword reversed(Aword w /* IN - The ACODE word to swap bytes of */) { Aword s; /* The swapped ACODE word */ char *wp, *sp; - int i; wp = (char *) &w; sp = (char *) &s; - for (i = 0; i < sizeof(Aword); i++) + for (uint i = 0; i < sizeof(Aword); i++) sp[sizeof(Aword) - 1 - i] = wp[i]; return s; @@ -346,10 +345,8 @@ static void reverseRuls(Aword adr) { */ void reverseHdr(AcdHdr *hdr) { - int i; - - /* Reverse all words in the header except the first (version marking) */ - for (i = 1; i < sizeof(AcdHdr) / sizeof(Aword); i++) + // Reverse all words in the header except the first (version marking) + for (uint i = 1; i < sizeof(AcdHdr) / sizeof(Aword); i++) reverse(&((Aword *)hdr)[i]); } diff --git a/engines/glk/alan2/version.h b/engines/glk/alan2/version.h index 7efee9797b..3268259cae 100644 --- a/engines/glk/alan2/version.h +++ b/engines/glk/alan2/version.h @@ -31,25 +31,25 @@ namespace Alan2 { typedef int64 Time; struct Version { - char *string; + const char *string; int version; int revision; int correction; Time time; - char *state; + const char *state; }; struct Product { - char *name; - char *slogan; - char *shortHeader; - char *longHeader; - char *date; - char *time; - char *user; - char *host; - char *ostype; - Version version; + 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 Version version; }; |