From c10267d83b01cc8e42973c41fb365131a316b68b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 29 Sep 2019 18:13:32 -0700 Subject: GLK: QUEST: More warning fixes --- engines/glk/quest/geas_file.cpp | 30 +++++++++++++++--------------- engines/glk/quest/read_file.cpp | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'engines/glk/quest') diff --git a/engines/glk/quest/geas_file.cpp b/engines/glk/quest/geas_file.cpp index c31b4d5a61..5bd0d5558c 100644 --- a/engines/glk/quest/geas_file.cpp +++ b/engines/glk/quest/geas_file.cpp @@ -285,13 +285,13 @@ bool GeasFile::get_obj_property(String objname, String propname, String &string_ void GeasFile::get_type_property(String typenamex, String propname, bool &bool_rv, String &string_rv) const { //cerr << " Checking type <" << typenamex << "> for prop <" << propname << ">\n"; - const GeasBlock *block = find_by_name("type", typenamex); - if (block == NULL) { + const GeasBlock *geasBlock = find_by_name("type", typenamex); + if (geasBlock == NULL) { debug_print("Object of nonexistent type " + typenamex); return; } - for (uint i = 0; i < block->data.size(); i ++) { - String line = block->data[i]; + for (uint i = 0; i < geasBlock->data.size(); i ++) { + String line = geasBlock->data[i]; //cerr << " Comparing vs. line <" << line << ">\n"; uint c1, c2; int p; @@ -358,12 +358,12 @@ bool GeasFile::obj_of_type(String objname, String typenamex) const { } String objtype = (*obj_types.find(objname))._value; - const GeasBlock *block = find_by_name(objtype, objname); + const GeasBlock *geasBlock = find_by_name(objtype, objname); uint c1, c2; - assert(block != NULL); - for (uint i = 0; i < block->data.size(); i ++) { - String line = block->data[i]; + assert(geasBlock != NULL); + for (uint i = 0; i < geasBlock->data.size(); i ++) { + String line = geasBlock->data[i]; String tok = first_token(line, c1, c2); // SENSITIVE? if (tok == "type") { @@ -384,13 +384,13 @@ bool GeasFile::type_of_type(String subtype, String supertype) const { if (ci_equal(subtype, supertype)) return true; //cerr << " Checking type <" << subtype << "> for type <" << supertype << ">\n"; - const GeasBlock *block = find_by_name("type", subtype); - if (block == NULL) { + const GeasBlock *geasBlock = find_by_name("type", subtype); + if (geasBlock == NULL) { debug_print("t_o_t: Nonexistent type " + subtype); return false; } - for (uint i = 0; i < block->data.size(); i ++) { - String line = block->data[i]; + for (uint i = 0; i < geasBlock->data.size(); i ++) { + String line = geasBlock->data[i]; //cerr << " Comparing vs. line <" << line << ">\n"; uint c1, c2; String tok = first_token(line, c1, c2); @@ -427,11 +427,11 @@ bool GeasFile::get_obj_action(String objname, String propname, String &string_rv //reserved_words *rw; - const GeasBlock *block = find_by_name(objtype, objname); + const GeasBlock *geasBlock = find_by_name(objtype, objname); String not_prop = "not " + propname; uint c1, c2; - for (uint i = 0; i < block->data.size(); i ++) { - String line = block->data[i]; + for (uint i = 0; i < geasBlock->data.size(); i ++) { + String line = geasBlock->data[i]; //cerr << " g_o_a: Handling line <" << line << ">\n"; String tok = first_token(line, c1, c2); // SENSITIVE? diff --git a/engines/glk/quest/read_file.cpp b/engines/glk/quest/read_file.cpp index cc3fdd1aee..fb930152dc 100644 --- a/engines/glk/quest/read_file.cpp +++ b/engines/glk/quest/read_file.cpp @@ -645,7 +645,7 @@ bool is_balanced(String str) { if (index == -1) return true; int depth; - for (depth = 1, index ++; depth > 0 && index < str.size(); index ++) + for (depth = 1, index ++; depth > 0 && index < (int)str.size(); index ++) if (str[index] == '{') ++ depth; else if (str[index] == '}') @@ -658,7 +658,7 @@ int count_depth(String str, int count) { int index = 0; if (count == 0) index = str.find('{'); - while (index < str.size()) { + while (index < (int)str.size()) { if (str[index] == '{') ++ count; else if (str[index] == '}') -- cgit v1.2.3