aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/hugo
diff options
context:
space:
mode:
authorPaul Gilbert2019-05-11 13:04:00 +1000
committerPaul Gilbert2019-05-11 13:04:00 +1000
commit84c47349a9f06057640ddc35c015fdd97b30d839 (patch)
tree1e1b38464f1cafaa3c022e71bc80512f0324514a /engines/glk/hugo
parentc1f8bd88232c026af207923a4f53bbfca439de13 (diff)
downloadscummvm-rg350-84c47349a9f06057640ddc35c015fdd97b30d839.tar.gz
scummvm-rg350-84c47349a9f06057640ddc35c015fdd97b30d839.tar.bz2
scummvm-rg350-84c47349a9f06057640ddc35c015fdd97b30d839.zip
GLK: HUGO: Compilation fixes
Diffstat (limited to 'engines/glk/hugo')
-rw-r--r--engines/glk/hugo/heglk.cpp10
-rw-r--r--engines/glk/hugo/hemisc.cpp4
-rw-r--r--engines/glk/hugo/heobject.cpp4
-rw-r--r--engines/glk/hugo/htokens.cpp2
-rw-r--r--engines/glk/hugo/hugo.cpp2
-rw-r--r--engines/glk/hugo/hugo.h10
-rw-r--r--engines/glk/hugo/hugo_defines.h2
7 files changed, 18 insertions, 16 deletions
diff --git a/engines/glk/hugo/heglk.cpp b/engines/glk/hugo/heglk.cpp
index 1d4586c9ab..4884d0f8cf 100644
--- a/engines/glk/hugo/heglk.cpp
+++ b/engines/glk/hugo/heglk.cpp
@@ -74,6 +74,8 @@ void Hugo::hugo_getline(const char *prmpt) {
gotline = true;
}
break;
+ default:
+ break;
}
}
@@ -82,7 +84,7 @@ void Hugo::hugo_getline(const char *prmpt) {
/* Copy the input to the script file (if open) */
if (script) {
- Common::String text = Common::String::format("%s%s\n", prompt, buffer);
+ Common::String text = Common::String::format("%s%s\n", prmpt, buffer);
script->putBuffer(text.c_str(), text.size());
}
}
@@ -122,6 +124,8 @@ int Hugo::hugo_waitforkey() {
gotchar = true;
}
break;
+ default:
+ break;
}
}
@@ -278,9 +282,7 @@ void Hugo::hugo_settextwindow(int left, int top, int right, int bottom) {
glk_stylehint_set(wintype_TextGrid, style_Subheader, stylehint_ReverseColor, 1);
glk_stylehint_set(wintype_TextGrid, style_Emphasized, stylehint_ReverseColor, 1);
- winid_t p;
-
- p = glk_window_get_parent(mainwin);
+ //winid_t p = glk_window_get_parent(mainwin);
secondwin = glk_window_open(mainwin,//p,
winmethod_Above | winmethod_Fixed,
bottom,
diff --git a/engines/glk/hugo/hemisc.cpp b/engines/glk/hugo/hemisc.cpp
index c5a77803f7..696b7a2666 100644
--- a/engines/glk/hugo/hemisc.cpp
+++ b/engines/glk/hugo/hemisc.cpp
@@ -550,7 +550,7 @@ ContextCommandLoop:
}
else if (context_commands < MAX_CONTEXT_COMMANDS)
{
- char *cc;
+ const char *cc;
strncpy(context_command[context_commands], cc = GetWord(n), 64);
context_command[context_commands][63] = '\0';
@@ -977,7 +977,7 @@ char *Hugo::GetText(long textaddr) {
return g;
}
-char *Hugo::GetWord(unsigned int w) {
+const char *Hugo::GetWord(unsigned int w) {
static char *b;
unsigned short a;
diff --git a/engines/glk/hugo/heobject.cpp b/engines/glk/hugo/heobject.cpp
index cc1416d98d..931f9a3abd 100644
--- a/engines/glk/hugo/heobject.cpp
+++ b/engines/glk/hugo/heobject.cpp
@@ -504,7 +504,7 @@ void Hugo::MoveObj(int obj, int p) {
}
}
-char *Hugo::Name(int obj) {
+const char *Hugo::Name(int obj) {
int p;
p = GetProp(obj, 0, 1, 0);
@@ -512,7 +512,7 @@ char *Hugo::Name(int obj) {
if (p)
return GetWord((unsigned int)p);
else
- return 0;
+ return nullptr;
}
int Hugo::Parent(int obj) {
diff --git a/engines/glk/hugo/htokens.cpp b/engines/glk/hugo/htokens.cpp
index fd913b260e..172c36a160 100644
--- a/engines/glk/hugo/htokens.cpp
+++ b/engines/glk/hugo/htokens.cpp
@@ -21,7 +21,7 @@
*/
#include "glk/hugo/htokens.h"
-#include "Common/algorithm.h"
+#include "common/algorithm.h"
namespace Glk {
namespace Hugo {
diff --git a/engines/glk/hugo/hugo.cpp b/engines/glk/hugo/hugo.cpp
index 0fca43222a..dccf978882 100644
--- a/engines/glk/hugo/hugo.cpp
+++ b/engines/glk/hugo/hugo.cpp
@@ -86,7 +86,7 @@ Hugo::Hugo(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(syst, gam
Common::fill(&buffer[0], &buffer[MAXBUFFER + MAXWORDS], '\0');
Common::fill(&errbuf[0], &errbuf[MAXBUFFER + 1], 0);
Common::fill(&line[0], &line[1025], 0);
- Common::fill(&word[0], &word[MAXWORDS + 1], nullptr);
+ Common::fill(&word[0], &word[MAXWORDS + 1], (const char *)nullptr);
Common::fill(&wd[0], &wd[MAXWORDS + 1], 0);
Common::fill(&parseerr[0], &parseerr[MAXBUFFER + 1], '\0');
Common::fill(&parsestr[0], &parsestr[MAXBUFFER + 1], '\0');
diff --git a/engines/glk/hugo/hugo.h b/engines/glk/hugo/hugo.h
index 1f5aaffa3e..a1e2c29494 100644
--- a/engines/glk/hugo/hugo.h
+++ b/engines/glk/hugo/hugo.h
@@ -144,7 +144,7 @@ private:
char line[1025]; ///< line buffer
int words; ///< parsed word count
- char *word[MAXWORDS + 1]; ///< breakdown into words
+ const char *word[MAXWORDS + 1]; ///< breakdown into words
unsigned int wd[MAXWORDS + 1]; ///< " " dict. entries
unsigned int parsed_number; ///< needed for numbers in input
@@ -433,7 +433,7 @@ private:
/**
* From the dictionary table.
*/
- char *GetWord(unsigned int w);
+ const char *GetWord(unsigned int w);
void HandleTailRecursion(long addr);
@@ -597,7 +597,7 @@ private:
void MoveObj(int obj, int p);
- char *Name(int obj);
+ const char *Name(int obj);
int Parent(int obj);
@@ -665,9 +665,9 @@ private:
/**
* Allocate memory block
*/
- void *hugo_blockalloc(size_t num) { return new byte[num]; }
+ void *hugo_blockalloc(size_t num) { return malloc(num); }
- void hugo_blockfree(void *block) { delete[] block; }
+ void hugo_blockfree(void *block) { free(block); }
public:
/**
* Constructor
diff --git a/engines/glk/hugo/hugo_defines.h b/engines/glk/hugo/hugo_defines.h
index 7809ea19b8..5609601ca8 100644
--- a/engines/glk/hugo/hugo_defines.h
+++ b/engines/glk/hugo/hugo_defines.h
@@ -153,7 +153,7 @@ browsing.
#define CODE_WINDOW 2
#endif
-#define PRINTFATALERROR(a) error(a)
+#define PRINTFATALERROR(a) error("%s", a)
} // End of namespace Hugo
} // End of namespace Glk