Enable shadow warnings and fix raised errors

This commit is contained in:
Ninni Pipping 2023-05-11 12:32:23 +02:00
parent fd4a06c515
commit 71ee65dc57
27 changed files with 779 additions and 761 deletions

View file

@ -301,11 +301,11 @@ bool FileAccessUnix::file_exists(const String &p_path) {
uint64_t FileAccessUnix::_get_modified_time(const String &p_file) {
String file = fix_path(p_file);
struct stat flags = {};
int err = stat(file.utf8().get_data(), &flags);
struct stat status = {};
int err = stat(file.utf8().get_data(), &status);
if (!err) {
return flags.st_mtime;
return status.st_mtime;
} else {
print_verbose("Failed to get modified time for: " + p_file + "");
return 0;
@ -314,11 +314,11 @@ uint64_t FileAccessUnix::_get_modified_time(const String &p_file) {
uint32_t FileAccessUnix::_get_unix_permissions(const String &p_file) {
String file = fix_path(p_file);
struct stat flags = {};
int err = stat(file.utf8().get_data(), &flags);
struct stat status = {};
int err = stat(file.utf8().get_data(), &status);
if (!err) {
return flags.st_mode & 0x7FF; //only permissions
return status.st_mode & 0x7FF; //only permissions
} else {
ERR_FAIL_V_MSG(0, "Failed to get unix permissions for: " + p_file + ".");
}