diff options
author | marxin <mliska@suse.cz> | 2019-02-12 21:10:08 +0100 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-02-20 19:44:12 +0100 |
commit | 8d51618949d5ea8a94e0f504401e8f852a393968 (patch) | |
tree | 6c0ab829b02aba47ff3dc27b9a14d3c3a0658a3b /editor/doc/doc_data.cpp | |
parent | 132e2f458df7a3551a251d68afeccd0362ca6be2 (diff) |
Add -Wshadow=local to warnings and fix reported issues.
Fixes #25316.
Diffstat (limited to 'editor/doc/doc_data.cpp')
-rw-r--r-- | editor/doc/doc_data.cpp | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index 24a746d159..8f1d0d9677 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -497,9 +497,9 @@ void DocData::generate(bool p_basic_types) { method.name = mi.name; - for (int i = 0; i < mi.arguments.size(); i++) { + for (int j = 0; j < mi.arguments.size(); j++) { - PropertyInfo arginfo = mi.arguments[i]; + PropertyInfo arginfo = mi.arguments[j]; ArgumentDoc ad; ad.name = arginfo.name; @@ -509,7 +509,7 @@ void DocData::generate(bool p_basic_types) { else ad.type = Variant::get_type_name(arginfo.type); - int defarg = mi.default_arguments.size() - mi.arguments.size() + i; + int defarg = mi.default_arguments.size() - mi.arguments.size() + j; if (defarg >= 0) ad.default_value = mi.default_arguments[defarg]; @@ -620,12 +620,12 @@ void DocData::generate(bool p_basic_types) { return_doc_from_retinfo(md, mi.return_val); - for (int i = 0; i < mi.arguments.size(); i++) { + for (int j = 0; j < mi.arguments.size(); j++) { ArgumentDoc ad; - argument_doc_from_arginfo(ad, mi.arguments[i]); + argument_doc_from_arginfo(ad, mi.arguments[j]); - int darg_idx = i - (mi.arguments.size() - mi.default_arguments.size()); + int darg_idx = j - (mi.arguments.size() - mi.default_arguments.size()); if (darg_idx >= 0) { Variant default_arg = E->get().default_arguments[darg_idx]; @@ -734,9 +734,9 @@ Error DocData::load_classes(const String &p_dir) { while (path != String()) { if (!isdir && path.ends_with("xml")) { Ref<XMLParser> parser = memnew(XMLParser); - Error err = parser->open(p_dir.plus_file(path)); - if (err) - return err; + Error err2 = parser->open(p_dir.plus_file(path)); + if (err2) + return err2; _load(parser); } @@ -806,78 +806,78 @@ Error DocData::_load(Ref<XMLParser> parser) { if (parser->get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser->get_node_name(); + String name2 = parser->get_node_name(); - if (name == "brief_description") { + if (name2 == "brief_description") { parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) c.brief_description = parser->get_node_data(); - } else if (name == "description") { + } else if (name2 == "description") { parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) c.description = parser->get_node_data(); - } else if (name == "tutorials") { + } else if (name2 == "tutorials") { while (parser->read() == OK) { if (parser->get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser->get_node_name(); + String name3 = parser->get_node_name(); - if (name == "link") { + if (name3 == "link") { parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) c.tutorials.push_back(parser->get_node_data().strip_edges()); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name); + ERR_EXPLAIN("Invalid tag in doc file: " + name3); ERR_FAIL_V(ERR_FILE_CORRUPT); } } else if (parser->get_node_type() == XMLParser::NODE_ELEMENT_END && parser->get_node_name() == "tutorials") break; //end of <tutorials> } - } else if (name == "demos") { + } else if (name2 == "demos") { parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) c.demos = parser->get_node_data(); - } else if (name == "methods") { + } else if (name2 == "methods") { - Error err = _parse_methods(parser, c.methods); - ERR_FAIL_COND_V(err, err); + Error err2 = _parse_methods(parser, c.methods); + ERR_FAIL_COND_V(err2, err2); - } else if (name == "signals") { + } else if (name2 == "signals") { - Error err = _parse_methods(parser, c.signals); - ERR_FAIL_COND_V(err, err); - } else if (name == "members") { + Error err2 = _parse_methods(parser, c.signals); + ERR_FAIL_COND_V(err2, err2); + } else if (name2 == "members") { while (parser->read() == OK) { if (parser->get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser->get_node_name(); + String name3 = parser->get_node_name(); - if (name == "member") { + if (name3 == "member") { - PropertyDoc prop; + PropertyDoc prop2; ERR_FAIL_COND_V(!parser->has_attribute("name"), ERR_FILE_CORRUPT); - prop.name = parser->get_attribute_value("name"); + prop2.name = parser->get_attribute_value("name"); ERR_FAIL_COND_V(!parser->has_attribute("type"), ERR_FILE_CORRUPT); - prop.type = parser->get_attribute_value("type"); + prop2.type = parser->get_attribute_value("type"); if (parser->has_attribute("setter")) - prop.setter = parser->get_attribute_value("setter"); + prop2.setter = parser->get_attribute_value("setter"); if (parser->has_attribute("getter")) - prop.getter = parser->get_attribute_value("getter"); + prop2.getter = parser->get_attribute_value("getter"); if (parser->has_attribute("enum")) - prop.enumeration = parser->get_attribute_value("enum"); + prop2.enumeration = parser->get_attribute_value("enum"); parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) - prop.description = parser->get_node_data(); - c.properties.push_back(prop); + prop2.description = parser->get_node_data(); + c.properties.push_back(prop2); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name); + ERR_EXPLAIN("Invalid tag in doc file: " + name3); ERR_FAIL_V(ERR_FILE_CORRUPT); } @@ -885,28 +885,28 @@ Error DocData::_load(Ref<XMLParser> parser) { break; //end of <constants> } - } else if (name == "theme_items") { + } else if (name2 == "theme_items") { while (parser->read() == OK) { if (parser->get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser->get_node_name(); + String name3 = parser->get_node_name(); - if (name == "theme_item") { + if (name3 == "theme_item") { - PropertyDoc prop; + PropertyDoc prop2; ERR_FAIL_COND_V(!parser->has_attribute("name"), ERR_FILE_CORRUPT); - prop.name = parser->get_attribute_value("name"); + prop2.name = parser->get_attribute_value("name"); ERR_FAIL_COND_V(!parser->has_attribute("type"), ERR_FILE_CORRUPT); - prop.type = parser->get_attribute_value("type"); + prop2.type = parser->get_attribute_value("type"); parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) - prop.description = parser->get_node_data(); - c.theme_properties.push_back(prop); + prop2.description = parser->get_node_data(); + c.theme_properties.push_back(prop2); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name); + ERR_EXPLAIN("Invalid tag in doc file: " + name3); ERR_FAIL_V(ERR_FILE_CORRUPT); } @@ -914,30 +914,30 @@ Error DocData::_load(Ref<XMLParser> parser) { break; //end of <constants> } - } else if (name == "constants") { + } else if (name2 == "constants") { while (parser->read() == OK) { if (parser->get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser->get_node_name(); + String name3 = parser->get_node_name(); - if (name == "constant") { + if (name3 == "constant") { - ConstantDoc constant; + ConstantDoc constant2; ERR_FAIL_COND_V(!parser->has_attribute("name"), ERR_FILE_CORRUPT); - constant.name = parser->get_attribute_value("name"); + constant2.name = parser->get_attribute_value("name"); ERR_FAIL_COND_V(!parser->has_attribute("value"), ERR_FILE_CORRUPT); - constant.value = parser->get_attribute_value("value"); + constant2.value = parser->get_attribute_value("value"); if (parser->has_attribute("enum")) { - constant.enumeration = parser->get_attribute_value("enum"); + constant2.enumeration = parser->get_attribute_value("enum"); } parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) - constant.description = parser->get_node_data(); - c.constants.push_back(constant); + constant2.description = parser->get_node_data(); + c.constants.push_back(constant2); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name); + ERR_EXPLAIN("Invalid tag in doc file: " + name3); ERR_FAIL_V(ERR_FILE_CORRUPT); } @@ -947,7 +947,7 @@ Error DocData::_load(Ref<XMLParser> parser) { } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name); + ERR_EXPLAIN("Invalid tag in doc file: " + name2); ERR_FAIL_V(ERR_FILE_CORRUPT); } |