diff options
author | Paul Gilbert | 2019-07-24 20:32:14 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-07-24 20:32:14 -0700 |
commit | 58498cf5f21375c3ab89a8486175ff8de087bdf7 (patch) | |
tree | 62f72f4033f6369ae492131d3c5b52e2e6620d90 | |
parent | a1414f9ad6739cd411ca79ad77359ae4858d1379 (diff) | |
download | scummvm-rg350-58498cf5f21375c3ab89a8486175ff8de087bdf7.tar.gz scummvm-rg350-58498cf5f21375c3ab89a8486175ff8de087bdf7.tar.bz2 scummvm-rg350-58498cf5f21375c3ab89a8486175ff8de087bdf7.zip |
GLK: Fixing some gcc 8 warnings
-rw-r--r-- | engines/glk/alan3/main.cpp | 11 | ||||
-rw-r--r-- | engines/glk/detection.h | 2 | ||||
-rw-r--r-- | engines/glk/glulxe/glulxe.h | 2 | ||||
-rw-r--r-- | engines/glk/hugo/hemisc.cpp | 6 | ||||
-rw-r--r-- | engines/glk/tads/tads2/memory_cache.cpp | 10 | ||||
-rw-r--r-- | engines/glk/window_text_buffer.cpp | 4 |
6 files changed, 17 insertions, 18 deletions
diff --git a/engines/glk/alan3/main.cpp b/engines/glk/alan3/main.cpp index 7b09840ce1..d20ec4469c 100644 --- a/engines/glk/alan3/main.cpp +++ b/engines/glk/alan3/main.cpp @@ -228,8 +228,8 @@ char *decodedGameVersion(const byte version[]) { /*----------------------------------------------------------------------*/ static void incompatibleDevelopmentVersion(ACodeHeader *hdr) { - char str[80]; - sprintf(str, "Incompatible version of ACODE program. Development versions always require exact match. Game is %ld.%ld%s%ld, interpreter %ld.%ld%s%ld!", + Common::String msg = Common::String::format("Incompatible version of ACODE program. " + "Development versions always require exact match. Game is %ld.%ld%s%ld, interpreter %ld.%ld%s%ld!", (long)(hdr->version[0]), (long)(hdr->version[1]), decodeState(hdr->version[3]), @@ -238,19 +238,18 @@ static void incompatibleDevelopmentVersion(ACodeHeader *hdr) { (long)alan.version.revision, alan.version.state, (long)alan.version.correction); - apperr(str); + apperr(msg.c_str()); } /*----------------------------------------------------------------------*/ static void incompatibleVersion(ACodeHeader *hdr) { - char str[80]; - sprintf(str, "Incompatible version of ACODE program. Game is %ld.%ld, interpreter %ld.%ld.", + Common::String msg = Common::String::format("Incompatible version of ACODE program. Game is %ld.%ld, interpreter %ld.%ld.", (long)(hdr->version[0]), (long)(hdr->version[1]), (long)alan.version.version, (long)alan.version.revision); - apperr(str); + apperr(msg.c_str()); } diff --git a/engines/glk/detection.h b/engines/glk/detection.h index 96f2970f16..f3ed374106 100644 --- a/engines/glk/detection.h +++ b/engines/glk/detection.h @@ -130,7 +130,7 @@ struct GlkDetectionEntry { #define DT_ENTRYL0(ID, LANG, MD5, FILESIZE) { ID, "", MD5, FILESIZE, LANG } #define DT_ENTRYL1(ID, LANG, EXTRA, MD5, FILESIZE) { ID, EXTRA, MD5, FILESIZE, LANG } -#define DT_END_MARKER { nullptr, nullptr, nullptr, Common::EN_ANY } +#define DT_END_MARKER { nullptr, nullptr, nullptr, 0, Common::EN_ANY } } // End of namespace Glk diff --git a/engines/glk/glulxe/glulxe.h b/engines/glk/glulxe/glulxe.h index 150decd748..ab7a3d3046 100644 --- a/engines/glk/glulxe/glulxe.h +++ b/engines/glk/glulxe/glulxe.h @@ -426,7 +426,7 @@ public: /** * Display an error in the error window, and then exit. */ - void fatal_error_handler(const char *str, const char *arg, bool useVal, int val); + void NORETURN_PRE fatal_error_handler(const char *str, const char *arg, bool useVal, int val); /** * Display a warning in the error window, and then continue. diff --git a/engines/glk/hugo/hemisc.cpp b/engines/glk/hugo/hemisc.cpp index 880305076d..50ff4f7891 100644 --- a/engines/glk/hugo/hemisc.cpp +++ b/engines/glk/hugo/hemisc.cpp @@ -635,8 +635,6 @@ unsigned int Hugo::Dict() { } void Hugo::FatalError(int n) { - char fatalerrorline[64]; - #if defined (DEBUGGER) hugo_stopmusic(); hugo_stopsample(); @@ -732,8 +730,8 @@ if (n==UNKNOWN_OP_E || n==ILLEGAL_OP_E || n==EXPECT_VAL_E || n==OVERFLOW_E) fprintf(stderr, "\n"); } */ - sprintf(fatalerrorline, "\nFatal Error: %s", line); - PRINTFATALERROR(fatalerrorline); + Common::String msg = Common::String::format("\nFatal Error: %s", line); + PRINTFATALERROR(msg.c_str()); hugo_closefiles(); hugo_blockfree(mem); diff --git a/engines/glk/tads/tads2/memory_cache.cpp b/engines/glk/tads/tads2/memory_cache.cpp index 359f1b3a4c..d6f2e3cbcc 100644 --- a/engines/glk/tads/tads2/memory_cache.cpp +++ b/engines/glk/tads/tads2/memory_cache.cpp @@ -807,9 +807,7 @@ static uchar *mcmhalo(mcmcx1def *ctx) { uchar *chunk; int err; -# define size (MCMCHUNK + sizeof(mcmhdef) + 2*osrndsz(sizeof(mcmon))) - - VARUSED(err); +#define size (MCMCHUNK + sizeof(mcmhdef) + 2*osrndsz(sizeof(mcmon))) MCMGLBCTX(ctx); @@ -829,9 +827,11 @@ static uchar *mcmhalo(mcmcx1def *ctx) ctx->mcmcxhpch = (mcmhdef *)chunk; /*@@@@*/ *(mcmon *)(chunk + osrndsz(sizeof(mcmhdef) + MCMCHUNK)) = MCMONINV; - return(chunk + sizeof(mcmhdef)); + VARUSED(err); + + return(chunk + sizeof(mcmhdef)); -# undef size +#undef size } /* "use" an object - move to most-recent position in LRU chain */ diff --git a/engines/glk/window_text_buffer.cpp b/engines/glk/window_text_buffer.cpp index 2638302e62..b182643644 100644 --- a/engines/glk/window_text_buffer.cpp +++ b/engines/glk/window_text_buffer.cpp @@ -1566,7 +1566,9 @@ void TextBufferWindow::scrollOneLine(bool forced) { _lines[0]._rHyper = 0; Common::fill(_chars, _chars + TBLINELEN, ' '); - memset(_attrs, 0, TBLINELEN * sizeof(Attributes)); + Attributes *a = _attrs; + for (int i = 0; i < TBLINELEN; ++i, ++a) + a->clear(); _numChars = 0; |