aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2009-02-21 03:32:13 +0000
committerMax Horn2009-02-21 03:32:13 +0000
commitc8ea2dce5f1beb99f50e741fd66cbd4075ca8345 (patch)
tree7da24cdfb7da02d1e02f92f06d3296773d088107
parent031e3e3b9081ad955d4ef814829c83f4b51792f0 (diff)
downloadscummvm-rg350-c8ea2dce5f1beb99f50e741fd66cbd4075ca8345.tar.gz
scummvm-rg350-c8ea2dce5f1beb99f50e741fd66cbd4075ca8345.tar.bz2
scummvm-rg350-c8ea2dce5f1beb99f50e741fd66cbd4075ca8345.zip
SCI: Fixed more warnings
svn-id: r38656
-rw-r--r--engines/sci/engine/said.cpp8
-rw-r--r--engines/sci/engine/said.y20
-rw-r--r--engines/sci/exereader.cpp3
3 files changed, 24 insertions, 7 deletions
diff --git a/engines/sci/engine/said.cpp b/engines/sci/engine/said.cpp
index fa1979ff82..fd55082072 100644
--- a/engines/sci/engine/said.cpp
+++ b/engines/sci/engine/said.cpp
@@ -189,7 +189,7 @@ static int
yylex(void);
static int
-yyerror(char *s) {
+yyerror(const char *s) {
said_parse_error = sci_strdup(s);
return 1; /* Abort */
}
@@ -1844,7 +1844,11 @@ static int yylex(void) {
return retval;
}
-#define SAID_NEXT_NODE ((said_tree_pos == 0) || (said_tree_pos >= VOCAB_TREE_NODES)) ? said_tree_pos = 0 : said_tree_pos++
+static inline int said_next_node() {
+ return ((said_tree_pos == 0) || (said_tree_pos >= VOCAB_TREE_NODES)) ? said_tree_pos = 0 : said_tree_pos++;
+}
+
+#define SAID_NEXT_NODE said_next_node()
static inline int said_leaf_node(tree_t pos, int value) {
said_tree[pos].type = PARSE_TREE_NODE_LEAF;
diff --git a/engines/sci/engine/said.y b/engines/sci/engine/said.y
index 25caffc014..9459405f79 100644
--- a/engines/sci/engine/said.y
+++ b/engines/sci/engine/said.y
@@ -92,7 +92,7 @@ static tree_t said_terminal(int);
static int yylex(void);
-static int yyerror(char *s) {
+static int yyerror(const char *s) {
said_parse_error = sci_strdup(s);
return 1; /* Abort */
}
@@ -258,7 +258,11 @@ static int yylex(void) {
return retval;
}
-#define SAID_NEXT_NODE ((said_tree_pos == 0) || (said_tree_pos >= VOCAB_TREE_NODES)) ? said_tree_pos = 0 : said_tree_pos++
+static inline int said_next_node() {
+ return ((said_tree_pos == 0) || (said_tree_pos >= VOCAB_TREE_NODES)) ? said_tree_pos = 0 : said_tree_pos++;
+}
+
+#define SAID_NEXT_NODE said_next_node()
static inline int said_leaf_node(tree_t pos, int value) {
said_tree[pos].type = PARSE_TREE_NODE_LEAF;
@@ -300,8 +304,16 @@ static tree_t said_terminal(int val) {
static tree_t said_aug_branch(int n1, int n2, tree_t t1, tree_t t2) {
int retval;
- retval = said_branch_node(SAID_NEXT_NODE, said_branch_node(SAID_NEXT_NODE, said_leaf_node(SAID_NEXT_NODE, n1),
- said_branch_node(SAID_NEXT_NODE, said_leaf_node(SAID_NEXT_NODE, n2), t1)), t2);
+ // FIXME: The following code is ambiguous and *not* safely portable,
+ // due to the way the SAID_NEXT_NODE macro is implemented
+ retval = said_branch_node(SAID_NEXT_NODE,
+ said_branch_node(SAID_NEXT_NODE,
+ said_leaf_node(SAID_NEXT_NODE, n1),
+ said_branch_node(SAID_NEXT_NODE,
+ said_leaf_node(SAID_NEXT_NODE, n2),
+ t1)
+ ),
+ t2);
#ifdef SAID_DEBUG
fprintf(stderr, "AUG(0x%x, 0x%x, [%04x], [%04x]) = [%04x]\n", n1, n2, t1, t2, retval);
diff --git a/engines/sci/exereader.cpp b/engines/sci/exereader.cpp
index edb2bc0589..469af3a0ff 100644
--- a/engines/sci/exereader.cpp
+++ b/engines/sci/exereader.cpp
@@ -70,7 +70,8 @@ Common::Platform getGameExePlatform(Common::SeekableReadStream *exeStream) {
// Skip number of types in map
exeStream->skip(2);
- uint16 val = exeStream->readUint16BE() + 1;
+// uint16 val = exeStream->readUint16BE() + 1;
+ exeStream->skip(2);
// Keep reading till we find the "CODE" bit
while (!exeStream->eos()) {