diff options
author | Paul Gilbert | 2019-11-10 21:03:39 -0800 |
---|---|---|
committer | Paul Gilbert | 2019-11-11 18:20:30 -0800 |
commit | 7ca72705320760450d9afc32fc5659b0f661d064 (patch) | |
tree | 67d9c1b84137d2a565c37ae39eaedaefc90cfc57 /engines/glk | |
parent | 75def2b4808fae0aef52bb5ba165a9d10936dd05 (diff) | |
download | scummvm-rg350-7ca72705320760450d9afc32fc5659b0f661d064.tar.gz scummvm-rg350-7ca72705320760450d9afc32fc5659b0f661d064.tar.bz2 scummvm-rg350-7ca72705320760450d9afc32fc5659b0f661d064.zip |
GLK: ARCHETYPE: gcc compilation fixes
Diffstat (limited to 'engines/glk')
-rw-r--r-- | engines/glk/archetype/archetype.cpp | 18 | ||||
-rw-r--r-- | engines/glk/archetype/interpreter.cpp | 6 | ||||
-rw-r--r-- | engines/glk/archetype/misc.cpp | 4 | ||||
-rw-r--r-- | engines/glk/archetype/string.cpp | 2 |
4 files changed, 14 insertions, 16 deletions
diff --git a/engines/glk/archetype/archetype.cpp b/engines/glk/archetype/archetype.cpp index cf22afc4db..b5ef41fdfc 100644 --- a/engines/glk/archetype/archetype.cpp +++ b/engines/glk/archetype/archetype.cpp @@ -309,7 +309,7 @@ bool Archetype::send_message(int transport, int message_sent, int recipient, if (index_xarray(Vocabulary, message_sent, p)) { String str = String::format("'%s'", ((StringPtr)p)->c_str()); - debugN(str.c_str()); + debugN("%s", str.c_str()); } if (transport == OP_SEND_TO_TYPE) @@ -318,7 +318,7 @@ bool Archetype::send_message(int transport, int message_sent, int recipient, debugN(" to "); r._data._ident.ident_int = recipient; display_result(r); - debug(""); + debug("%s", ""); } // Trying to send a message to a destroyed object results in UNDEFINED @@ -384,7 +384,6 @@ void Archetype::eval_expr(ExprTree the_expr, ResultType &result, ContextType &co ResultType r1, r2; int i; ExprTree e; - bool b; // It is very important to make sure that the "kind" fields of our temporary result variables // are properly set to RESERVED/UNDEFINED before doing anything with them, so that if someone @@ -463,10 +462,10 @@ void Archetype::eval_expr(ExprTree the_expr, ResultType &result, ContextType &co } else if (convert_to(MESSAGE, r1)) { if (r2._data._ident.ident_kind == TYPE_ID) - b = send_message(OP_SEND_TO_TYPE, r1._data._msgTextQuote.index, r2._data._ident.ident_int, + send_message(OP_SEND_TO_TYPE, r1._data._msgTextQuote.index, r2._data._ident.ident_int, result, context); else - b = send_message(the_expr->_data._oper.op_name, r1._data._msgTextQuote.index, + send_message(the_expr->_data._oper.op_name, r1._data._msgTextQuote.index, r2._data._ident.ident_int, result, context); } } @@ -701,7 +700,7 @@ void Archetype::eval_expr(ExprTree the_expr, ResultType &result, ContextType &co display_expr(the_expr); debugN(" ==> "); display_result(result); - debug(""); + debug("%s", ""); } } else { switch (desired) { @@ -819,7 +818,7 @@ void Archetype::exec_stmt(StatementPtr the_stmt, ResultType &result, ContextType debugN(", "); } - debug(""); + debug("%s", ""); } np = nullptr; @@ -860,8 +859,7 @@ void Archetype::exec_stmt(StatementPtr the_stmt, ResultType &result, ContextType if (verbose) { debugN("case "); display_expr(the_stmt->_data._case.test_expr); - debugN(" of"); - debug(""); + debug(" of"); } eval_expr(the_stmt->_data._case.test_expr, r1, context, RVALUE); @@ -984,7 +982,7 @@ void Archetype::exec_stmt(StatementPtr the_stmt, ResultType &result, ContextType } if (verbose) - debug(""); // finish off dangling lines + debug("%s", ""); // finish off dangling lines } } // End of namespace Archetype diff --git a/engines/glk/archetype/interpreter.cpp b/engines/glk/archetype/interpreter.cpp index 654a3019bb..485a408555 100644 --- a/engines/glk/archetype/interpreter.cpp +++ b/engines/glk/archetype/interpreter.cpp @@ -394,10 +394,10 @@ void display_result(ResultType &result) { } if (enclose != " ") - debugN(enclose.c_str()); + debugN("%s", enclose.c_str()); write_result(result); if (enclose != " ") - debugN(enclose.c_str()); + debugN("%s", enclose.c_str()); } void display_expr(ExprTree the_tree) { @@ -410,7 +410,7 @@ void display_expr(ExprTree the_tree) { debugN(") "); } - debugN(Operators[the_tree->_data._oper.op_name]); + debugN("%s", Operators[the_tree->_data._oper.op_name]); debugN(" ("); display_expr(the_tree->_data._oper.right); debugN(") "); diff --git a/engines/glk/archetype/misc.cpp b/engines/glk/archetype/misc.cpp index 066c6c9225..f2c0c780ff 100644 --- a/engines/glk/archetype/misc.cpp +++ b/engines/glk/archetype/misc.cpp @@ -127,8 +127,8 @@ void add_bytes(int delta) { if (DebugMan.isDebugChannelEnabled(DEBUG_BYTES)) { String line = (delta >= 0) ? "Allocated " : "Deallocated "; - line += String::format("%.3d bytes. Current consumed memory: %.6d", ABS(delta), Bytes); - debug(line.c_str()); + line += String::format("%.3u bytes. Current consumed memory: %.6u", (uint)ABS(delta), (uint)Bytes); + debug("%s", line.c_str()); } } diff --git a/engines/glk/archetype/string.cpp b/engines/glk/archetype/string.cpp index d20a1c9487..849affab22 100644 --- a/engines/glk/archetype/string.cpp +++ b/engines/glk/archetype/string.cpp @@ -129,7 +129,7 @@ int String::val(int *code) { if (code) *code = 0; - return result; + return sign * result; } String String::left(size_t count) const { |