aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/parser
diff options
context:
space:
mode:
authorMatthew Hoops2010-07-28 19:03:49 +0000
committerMatthew Hoops2010-07-28 19:03:49 +0000
commit07b67fe44b20f8f1c9dcdf659f5e2666d69834f4 (patch)
tree60d2c4ff90a13499324b86b6c3377d72607b1d72 /engines/sci/parser
parent9a1afc5a2473b29a288a808917ed522ac3fac531 (diff)
downloadscummvm-rg350-07b67fe44b20f8f1c9dcdf659f5e2666d69834f4.tar.gz
scummvm-rg350-07b67fe44b20f8f1c9dcdf659f5e2666d69834f4.tar.bz2
scummvm-rg350-07b67fe44b20f8f1c9dcdf659f5e2666d69834f4.zip
SCI: Fix using the parser in SCI Fan Games
Get a pointer to the said spec instead of copying to a buffer. The fan games use a said spec with size < 64. Also, make said() take a const pointer as the spec cannot change. Thanks to waltervn and wjp. svn-id: r51432
Diffstat (limited to 'engines/sci/parser')
-rw-r--r--engines/sci/parser/said.cpp4
-rw-r--r--engines/sci/parser/vocabulary.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/engines/sci/parser/said.cpp b/engines/sci/parser/said.cpp
index 0411952f2a..9c07be2dff 100644
--- a/engines/sci/parser/said.cpp
+++ b/engines/sci/parser/said.cpp
@@ -657,7 +657,7 @@ static bool buildSaidTree() {
return true;
}
-static int said_parse_spec(byte *spec) {
+static int said_parse_spec(const byte *spec) {
int nextitem;
said_token = 0;
@@ -996,7 +996,7 @@ static int augment_parse_nodes(ParseTreeNode *parseT, ParseTreeNode *saidT) {
/**** Main code ****/
/*******************/
-int said(EngineState *s, byte *spec, bool verbose) {
+int said(EngineState *s, const byte *spec, bool verbose) {
int retval;
Vocabulary *voc = g_sci->getVocabulary();
diff --git a/engines/sci/parser/vocabulary.h b/engines/sci/parser/vocabulary.h
index a20508e191..d4df8af715 100644
--- a/engines/sci/parser/vocabulary.h
+++ b/engines/sci/parser/vocabulary.h
@@ -345,7 +345,7 @@ void vocab_dump_parse_tree(const char *tree_name, ParseTreeNode *nodes);
* @param verbose Whether to display the parse tree after building it
* @return 1 on a match, 0 otherwise
*/
-int said(EngineState *s, byte *spec, bool verbose);
+int said(EngineState *s, const byte *spec, bool verbose);
} // End of namespace Sci