[Scummvm-git-logs] scummvm master -> 120ea78e135e501f640a430484069a11437783cc

dreammaster paulfgilbert at gmail.com
Thu May 16 02:24:09 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:
120ea78e13 GLK: HUGO: Fix handling of parse errors


Commit: 120ea78e135e501f640a430484069a11437783cc
    https://github.com/scummvm/scummvm/commit/120ea78e135e501f640a430484069a11437783cc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-05-15T14:22:23-10:00

Commit Message:
GLK: HUGO: Fix handling of parse errors

Care will really need to be taken in the future if there's
any cleanup of fields to the proper 'bool' type. Hugo
inconsistency mixes use of true/false in fields that can
take non-bool values, such as for full_buffer

Changed paths:
    engines/glk/hugo/heparse.cpp
    engines/glk/hugo/herun.cpp
    engines/glk/hugo/hugo.cpp
    engines/glk/hugo/hugo.h


diff --git a/engines/glk/hugo/heparse.cpp b/engines/glk/hugo/heparse.cpp
index c837b46..ad96807 100644
--- a/engines/glk/hugo/heparse.cpp
+++ b/engines/glk/hugo/heparse.cpp
@@ -692,7 +692,7 @@ GotVerb:
 				/* end of both input and grammar */
 				if (wd[wordnum]==0 && Peek(grammaraddr)==ROUTINE_T)
 				{
-					full_buffer = (char)wordnum;
+					full_buffer = (byte)wordnum;
 					break;
 				}
 
@@ -1330,7 +1330,7 @@ Clarify:
 			if (pobjcount==1)
 			{
 				pobj = pobjlist[0].obj;
-				full_buffer = false;
+				full_buffer = 0;
 				goto RestoreTempArrays;
 			}
 
@@ -1354,7 +1354,7 @@ Clarify:
 			*/
 			if (flag==0)
 			{
-				full_buffer = true;
+				full_buffer = 1;
 				return false;
 			}
 
@@ -1367,7 +1367,7 @@ Clarify:
 			j = MatchObject(&i);
 			if (j==false)	/* parsing error */
 			{
-				full_buffer = false;
+				full_buffer = 0;
 				return false;
 			}
 			else if (j==-1)	/* multiple matches found */
@@ -1388,7 +1388,7 @@ Clarify:
 					}
 					if (flag==1)
 					{
-						full_buffer = false;
+						full_buffer = 0;
 						goto RestoreTempArrays;
 					}
 				}
@@ -1418,10 +1418,10 @@ Clarify:
 				{
 					/* "You'll have to be more specific..." */
 					ParseError(13, 0);
-					full_buffer = false;
+					full_buffer = 0;
 					return false;
 				}
-				full_buffer = false;
+				full_buffer = 0;
 			}
 
 RestoreTempArrays:
@@ -1468,7 +1468,7 @@ RestoreTempArrays:
 				{
 					/* "You'll have to be more specific..." */
 					ParseError(13, 0);
-					full_buffer = false;
+					full_buffer = 0;
 					return false;
 				}
 			}
diff --git a/engines/glk/hugo/herun.cpp b/engines/glk/hugo/herun.cpp
index cb33ef9..dca7ac2 100644
--- a/engines/glk/hugo/herun.cpp
+++ b/engines/glk/hugo/herun.cpp
@@ -250,7 +250,7 @@ Start:
 				do
 				{
 FreshInput:
-					if (full_buffer != true)
+					if (full_buffer != 1)
 					{
 						newinput = true;
 						speaking = 0;
@@ -325,7 +325,7 @@ FreshInput:
 RecordedNewline:;
 						}
 					}
-					else full_buffer = false;
+					else full_buffer = 0;
 
 					if (!strcmp(buffer, "") || buffer[0]=='.')
 					{
diff --git a/engines/glk/hugo/hugo.cpp b/engines/glk/hugo/hugo.cpp
index e6283d1..543da72 100644
--- a/engines/glk/hugo/hugo.cpp
+++ b/engines/glk/hugo/hugo.cpp
@@ -56,7 +56,7 @@ Hugo::Hugo(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(syst, gam
 		grammaraddr(0), obj_parselist(nullptr), domain(0), odomain(0), objcount(0),
 		parse_allflag(false), pobjcount(0), pobj(0), obj_match_state(0), object_is_number(0),
 		objgrammar(0), objstart(0), objfinish(0), addflag(false), speaking(0), oopscount(0),
-		parse_called_twice(0), reparse_everything(0), full_buffer(false), recursive_call(false),
+		parse_called_twice(0), reparse_everything(0), full_buffer(0), recursive_call(false),
 		parse_location(0),
 		// heres
 		resource_file(nullptr), extra_param(0), resource_type(0),
diff --git a/engines/glk/hugo/hugo.h b/engines/glk/hugo/hugo.h
index 74b885b..c09e318 100644
--- a/engines/glk/hugo/hugo.h
+++ b/engines/glk/hugo/hugo.h
@@ -181,7 +181,7 @@ private:
 	char parse_called_twice;
 	char reparse_everything;
 	char punc_string[64];					///< punctuation string
-	bool  full_buffer;
+	byte full_buffer;
 
 	/**
 	 * to MatchObject()





More information about the Scummvm-git-logs mailing list