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 /main/tests | |
parent | 132e2f458df7a3551a251d68afeccd0362ca6be2 (diff) |
Add -Wshadow=local to warnings and fix reported issues.
Fixes #25316.
Diffstat (limited to 'main/tests')
-rw-r--r-- | main/tests/test_gdscript.cpp | 4 | ||||
-rw-r--r-- | main/tests/test_shader_lang.cpp | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp index b0b7fc8357..55e31a18c3 100644 --- a/main/tests/test_gdscript.cpp +++ b/main/tests/test_gdscript.cpp @@ -1041,10 +1041,10 @@ MainLoop *test(TestType p_type) { } else if (p_type == TEST_BYTECODE) { - Vector<uint8_t> buf = GDScriptTokenizerBuffer::parse_code_string(code); + Vector<uint8_t> buf2 = GDScriptTokenizerBuffer::parse_code_string(code); String dst = test.get_basename() + ".gdc"; FileAccess *fw = FileAccess::open(dst, FileAccess::WRITE); - fw->store_buffer(buf.ptr(), buf.size()); + fw->store_buffer(buf2.ptr(), buf2.size()); memdelete(fw); } diff --git a/main/tests/test_shader_lang.cpp b/main/tests/test_shader_lang.cpp index 8441748cc0..dcb19b7df7 100644 --- a/main/tests/test_shader_lang.cpp +++ b/main/tests/test_shader_lang.cpp @@ -149,11 +149,11 @@ static String dump_node_code(SL::Node *p_node, int p_level) { String header; header = _typestr(fnode->return_type) + " " + fnode->name + "("; - for (int i = 0; i < fnode->arguments.size(); i++) { + for (int j = 0; j < fnode->arguments.size(); j++) { - if (i > 0) + if (j > 0) header += ", "; - header += _prestr(fnode->arguments[i].precision) + _typestr(fnode->arguments[i].type) + " " + fnode->arguments[i].name; + header += _prestr(fnode->arguments[j].precision) + _typestr(fnode->arguments[j].type) + " " + fnode->arguments[j].name; } header += ")\n"; @@ -336,9 +336,9 @@ MainLoop *test() { print_line("Error at line: " + rtos(sl.get_error_line()) + ": " + sl.get_error_text()); return NULL; } else { - String code; - recreate_code(&code, sl.get_shader()); - print_line("code:\n\n" + code); + String code2; + recreate_code(&code2, sl.get_shader()); + print_line("code:\n\n" + code2); } return NULL; |