You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Enable shadow warnings and fix raised errors
This commit is contained in:
@@ -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 + ".");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user