[Scummvm-git-logs] scummvm master -> 84c47349a9f06057640ddc35c015fdd97b30d839

dreammaster paulfgilbert at gmail.com
Sat May 11 05:04:20 CEST 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
84c47349a9 GLK: HUGO: Compilation fixes


Commit: 84c47349a9f06057640ddc35c015fdd97b30d839
    https://github.com/scummvm/scummvm/commit/84c47349a9f06057640ddc35c015fdd97b30d839
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-05-11T13:04:00+10:00

Commit Message:
GLK: HUGO: Compilation fixes

Changed paths:
    engines/glk/hugo/heglk.cpp
    engines/glk/hugo/hemisc.cpp
    engines/glk/hugo/heobject.cpp
    engines/glk/hugo/htokens.cpp
    engines/glk/hugo/hugo.cpp
    engines/glk/hugo/hugo.h
    engines/glk/hugo/hugo_defines.h


diff --git a/engines/glk/hugo/heglk.cpp b/engines/glk/hugo/heglk.cpp
index 1d4586c..4884d0f 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 c5a7780..696b7a2 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 cc1416d..931f9a3 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 fd913b2..172c36a 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 0fca432..dccf978 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 1f5aaff..a1e2c29 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 7809ea1..5609601 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





More information about the Scummvm-git-logs mailing list