From 9f6e1a8f293b1b525c79437e002d7848bc952ce4 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 12 May 2019 10:38:03 +1000 Subject: GLK: HUGO: Compilation fixes --- engines/glk/hugo/hemedia.cpp | 2 +- engines/glk/hugo/heparse.cpp | 2 +- engines/glk/hugo/hugo.h | 4 ++-- engines/glk/hugo/stringfn.cpp | 6 ++++++ engines/glk/hugo/stringfn.h | 2 ++ 5 files changed, 12 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/glk/hugo/hemedia.cpp b/engines/glk/hugo/hemedia.cpp index 19c9874ed4..a7ddbf6d00 100644 --- a/engines/glk/hugo/hemedia.cpp +++ b/engines/glk/hugo/hemedia.cpp @@ -63,7 +63,7 @@ int Hugo::loadres(HUGO_FILE infile, int reslen, int type) { while (reslen > 0) { - n = hugo_fread(buf, 1, reslen < sizeof buf ? reslen : sizeof buf, infile); + n = hugo_fread(buf, 1, reslen < (int)sizeof(buf) ? reslen : sizeof(buf), infile); if (n <= 0) break; glk_put_buffer_stream(stream, buf, n); diff --git a/engines/glk/hugo/heparse.cpp b/engines/glk/hugo/heparse.cpp index da01810a8e..c837b465fd 100644 --- a/engines/glk/hugo/heparse.cpp +++ b/engines/glk/hugo/heparse.cpp @@ -284,7 +284,7 @@ int Hugo::DomainObj(int obj) { return yes; } -unsigned int Hugo::FindWord(char *a) { +unsigned int Hugo::FindWord(const char *a) { unsigned int ptr = 0; int i, p, alen; diff --git a/engines/glk/hugo/hugo.h b/engines/glk/hugo/hugo.h index 8d2d18b749..e49e313dd2 100644 --- a/engines/glk/hugo/hugo.h +++ b/engines/glk/hugo/hugo.h @@ -197,7 +197,7 @@ private: int extra_param; char loaded_filename[MAX_RES_PATH]; char loaded_resname[MAX_RES_PATH]; - char resource_type = 0; + char resource_type; // herun int passlocal[MAXLOCALS]; ///< locals passed to routine @@ -760,7 +760,7 @@ private: /** * Returns the dictionary address of . */ - unsigned int FindWord(char *a); + unsigned int FindWord(const char *a); /** * Checks to see if is in objlist[]. diff --git a/engines/glk/hugo/stringfn.cpp b/engines/glk/hugo/stringfn.cpp index 4e94b3e495..0b194cf853 100644 --- a/engines/glk/hugo/stringfn.cpp +++ b/engines/glk/hugo/stringfn.cpp @@ -112,5 +112,11 @@ char *StringFunctions::strlwr(char *s) { return s; } +char *StringFunctions::strupr(char *s) { + for (char *sp = s; *sp; ++sp) + *sp = toupper(*sp); + return s; +} + } // End of namespace Hugo } // End of namespace Glk diff --git a/engines/glk/hugo/stringfn.h b/engines/glk/hugo/stringfn.h index 2ee6e3ed74..f5f29b12a4 100644 --- a/engines/glk/hugo/stringfn.h +++ b/engines/glk/hugo/stringfn.h @@ -58,6 +58,8 @@ public: char *hugo_strcpy(char *s, const char *t); char *strlwr(char *s); + + char *strupr(char *s); }; -- cgit v1.2.3