mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 14:11:15 +00:00
Fix some warnings raised by GCC-11.1
This commit is contained in:
parent
f164c00a94
commit
f8e34209af
5 changed files with 32 additions and 26 deletions
|
|
@ -121,24 +121,27 @@ int test_main(int argc, char *argv[]) {
|
|||
test_args.push_back(arg);
|
||||
}
|
||||
}
|
||||
// Convert Godot command line arguments back to standard arguments.
|
||||
char **doctest_args = new char *[test_args.size()];
|
||||
for (int x = 0; x < test_args.size(); x++) {
|
||||
// Operation to convert Godot string to non wchar string.
|
||||
CharString cs = test_args[x].utf8();
|
||||
const char *str = cs.get_data();
|
||||
// Allocate the string copy.
|
||||
doctest_args[x] = new char[strlen(str) + 1];
|
||||
// Copy this into memory.
|
||||
memcpy(doctest_args[x], str, strlen(str) + 1);
|
||||
}
|
||||
|
||||
test_context.applyCommandLine(test_args.size(), doctest_args);
|
||||
if (test_args.size() > 0) {
|
||||
// Convert Godot command line arguments back to standard arguments.
|
||||
char **doctest_args = new char *[test_args.size()];
|
||||
for (int x = 0; x < test_args.size(); x++) {
|
||||
// Operation to convert Godot string to non wchar string.
|
||||
CharString cs = test_args[x].utf8();
|
||||
const char *str = cs.get_data();
|
||||
// Allocate the string copy.
|
||||
doctest_args[x] = new char[strlen(str) + 1];
|
||||
// Copy this into memory.
|
||||
memcpy(doctest_args[x], str, strlen(str) + 1);
|
||||
}
|
||||
|
||||
for (int x = 0; x < test_args.size(); x++) {
|
||||
delete[] doctest_args[x];
|
||||
test_context.applyCommandLine(test_args.size(), doctest_args);
|
||||
|
||||
for (int x = 0; x < test_args.size(); x++) {
|
||||
delete[] doctest_args[x];
|
||||
}
|
||||
delete[] doctest_args;
|
||||
}
|
||||
delete[] doctest_args;
|
||||
|
||||
return test_context.run();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue