diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-05-12 10:04:09 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-05-12 10:04:09 +0200 |
commit | cc48827e4aac3f3bfa1002eba635bd06db89864c (patch) | |
tree | 71ee9a5a9f08e585dc80f72cf082757456cdcdce /drivers | |
parent | 186aa649d2bc7ec58e7ba24620a3b2136c1fc203 (diff) | |
parent | 71ee65dc5701a0675ae6b1879a694a28c7206a63 (diff) | |
download | redot-engine-cc48827e4aac3f3bfa1002eba635bd06db89864c.tar.gz |
Merge pull request #76946 from AThousandShips/shadow_warning
Enable shadow warnings and fix raised errors
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gl_context/SCsub | 6 | ||||
-rw-r--r-- | drivers/pulseaudio/audio_driver_pulseaudio.cpp | 4 | ||||
-rw-r--r-- | drivers/unix/file_access_unix.cpp | 12 |
3 files changed, 13 insertions, 9 deletions
diff --git a/drivers/gl_context/SCsub b/drivers/gl_context/SCsub index 2204c486c6..91240ce3e3 100644 --- a/drivers/gl_context/SCsub +++ b/drivers/gl_context/SCsub @@ -10,7 +10,11 @@ if env["platform"] in ["haiku", "macos", "windows", "linuxbsd"]: ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env.Prepend(CPPPATH=[thirdparty_dir]) + # Treat glad headers as system headers to avoid raising warnings. Not supported on MSVC. + if not env.msvc: + env.Append(CPPFLAGS=["-isystem", Dir(thirdparty_dir).path]) + else: + env.Prepend(CPPPATH=[thirdparty_dir]) env.Append(CPPDEFINES=["GLAD_ENABLED"]) env.Append(CPPDEFINES=["GLES_OVER_GL"]) diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index 3114be9163..ab94d8911f 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -222,8 +222,8 @@ Error AudioDriverPulseAudio::init_output_device() { break; } - int latency = GLOBAL_GET("audio/driver/output_latency"); - buffer_frames = closest_power_of_2(latency * mix_rate / 1000); + int tmp_latency = GLOBAL_GET("audio/driver/output_latency"); + buffer_frames = closest_power_of_2(tmp_latency * mix_rate / 1000); pa_buffer_size = buffer_frames * pa_map.channels; print_verbose("PulseAudio: detected " + itos(pa_map.channels) + " output channels"); diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp index 3c2f36c7c0..e9affe41af 100644 --- a/drivers/unix/file_access_unix.cpp +++ b/drivers/unix/file_access_unix.cpp @@ -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 + "."); } |