Skip to content

Commit

Permalink
GLK: QUEST: Shadowing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Sep 30, 2019
1 parent e895548 commit 0eed867
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions engines/glk/quest/geas_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion engines/glk/quest/geas_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ struct GeasState {

//void register_block (String blockname, String blocktype);

GeasState() {}
GeasState() : running(false) {}
//GeasState (GeasRunner &, const GeasFile &);
GeasState(GeasInterface &, const GeasFile &);
/*
Expand Down
2 changes: 1 addition & 1 deletion engines/glk/quest/limit_stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions engines/glk/quest/read_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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()) {
Expand Down

0 comments on commit 0eed867

Please sign in to comment.