SCI: Fixed more warnings

svn-id: r38656
This commit is contained in:
Max Horn 2009-02-21 03:32:13 +00:00
parent 031e3e3b90
commit c8ea2dce5f
3 changed files with 24 additions and 7 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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()) {