[Scummvm-git-logs] scummvm master -> 0eed86744543f8cce15fc038a2b82fc29aed51c9

dreammaster paulfgilbert at gmail.com
Mon Sep 30 02:51:02 CEST 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0eed867445 GLK: QUEST: Shadowing fixes


Commit: 0eed86744543f8cce15fc038a2b82fc29aed51c9
    https://github.com/scummvm/scummvm/commit/0eed86744543f8cce15fc038a2b82fc29aed51c9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-09-29T17:50:42-07:00

Commit Message:
GLK: QUEST: Shadowing fixes

Changed paths:
    engines/glk/quest/geas_file.cpp
    engines/glk/quest/geas_state.h
    engines/glk/quest/limit_stack.h
    engines/glk/quest/read_file.cpp


diff --git a/engines/glk/quest/geas_file.cpp b/engines/glk/quest/geas_file.cpp
index 187c7cc..c31b4d5 100644
--- a/engines/glk/quest/geas_file.cpp
+++ b/engines/glk/quest/geas_file.cpp
@@ -231,14 +231,14 @@ bool GeasFile::get_obj_property(String objname, String propname, String &string_
 	}
 	String objtype = (*obj_types.find(objname))._value;
 
-	const GeasBlock *block = find_by_name(objtype, objname);
+	const GeasBlock *geasBlock = find_by_name(objtype, objname);
 
 	String not_prop = "not " + propname;
 	uint c1, c2;
-	assert(block != NULL);
-	//assert (block->data != NULL);
-	for (uint i = 0; i < block->data.size(); i ++) {
-		String line = block->data[i];
+	assert(geasBlock != NULL);
+	//assert (geasBlock->data != NULL);
+	for (uint i = 0; i < geasBlock->data.size(); i ++) {
+		String line = geasBlock->data[i];
 		//cerr << "  g_o_p: Handling line <" << line << ">\n";
 		String tok = first_token(line, c1, c2);
 		// SENSITIVE?
@@ -481,13 +481,13 @@ bool GeasFile::get_obj_action(String objname, String propname, String &string_rv
 
 void GeasFile::get_type_action(String typenamex, String actname, bool &bool_rv, String &string_rv) const {
 	//cerr << "  Checking type <" << typenamex << "> for action <" << actname << ">\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 << "    g_t_a: Comparing vs. line <" << line << ">\n";
 		uint c1, c2;
 		String tok = first_token(line, c1, c2);
diff --git a/engines/glk/quest/geas_state.h b/engines/glk/quest/geas_state.h
index 70365f1..647ee45 100644
--- a/engines/glk/quest/geas_state.h
+++ b/engines/glk/quest/geas_state.h
@@ -138,7 +138,7 @@ public:
 
 	//void register_block (String blockname, String blocktype);
 
-	GeasState() {}
+	GeasState() : running(false) {}
 	//GeasState (GeasRunner &, const GeasFile &);
 	GeasState(GeasInterface &, const GeasFile &);
 	/*
diff --git a/engines/glk/quest/limit_stack.h b/engines/glk/quest/limit_stack.h
index 75cad44..35ea93d 100644
--- a/engines/glk/quest/limit_stack.h
+++ b/engines/glk/quest/limit_stack.h
@@ -54,7 +54,7 @@ template <class T> class LimitStack {
 	*/
 
 public:
-	LimitStack(uint size) : stack_size(size), cur_ptr(0), end_ptr(size - 1), data(Common::Array<T> (size)) { }
+	LimitStack(uint maxSize) : stack_size(maxSize), cur_ptr(0), end_ptr(maxSize - 1), data(Common::Array<T> (maxSize)) { }
 
 	void push(T &item) {
 		if (cur_ptr == end_ptr)
diff --git a/engines/glk/quest/read_file.cpp b/engines/glk/quest/read_file.cpp
index af6cc9d..cc3fdd1 100644
--- a/engines/glk/quest/read_file.cpp
+++ b/engines/glk/quest/read_file.cpp
@@ -641,7 +641,7 @@ String trim(String s, trim_modes trim_mode) {
  * - Otherwise, it's unbalanced
  */
 bool is_balanced(String str) {
-	uint index = str.find('{');
+	int index = str.find('{');
 	if (index == -1)
 		return true;
 	int depth;
@@ -655,7 +655,7 @@ bool is_balanced(String str) {
 
 int count_depth(String str, int count) {
 	//cerr << "count_depth (" << str << ", " << count << ")" << endl;
-	uint index = 0;
+	int index = 0;
 	if (count == 0)
 		index = str.find('{');
 	while (index < str.size()) {





More information about the Scummvm-git-logs mailing list