aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2019-05-15 14:22:23 -1000
committerPaul Gilbert2019-05-15 14:22:23 -1000
commit120ea78e135e501f640a430484069a11437783cc (patch)
tree0816b5d3117c1f3c1fd6cab27d311135c0a91f20
parent6cecf9c0c6a6f8c03e94f2300428643b98a0efad (diff)
downloadscummvm-rg350-120ea78e135e501f640a430484069a11437783cc.tar.gz
scummvm-rg350-120ea78e135e501f640a430484069a11437783cc.tar.bz2
scummvm-rg350-120ea78e135e501f640a430484069a11437783cc.zip
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
-rw-r--r--engines/glk/hugo/heparse.cpp16
-rw-r--r--engines/glk/hugo/herun.cpp4
-rw-r--r--engines/glk/hugo/hugo.cpp2
-rw-r--r--engines/glk/hugo/hugo.h2
4 files changed, 12 insertions, 12 deletions
diff --git a/engines/glk/hugo/heparse.cpp b/engines/glk/hugo/heparse.cpp
index c837b465fd..ad96807002 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 cb33ef9160..dca7ac2333 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 e6283d16d0..543da72a14 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 74b885b982..c09e318633 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()