From d368b55a53b78e377839dbd1505d1dfe22e3a4c9 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Mon, 31 Oct 2022 11:45:32 +0200 Subject: [PATCH] [iOS] Fix build with warnings=extra. (cherry picked from commit 987723b386f2b63ea33294c81ce026c6b45e1ae3) --- core/io/logger.cpp | 7 ++----- modules/bullet/bullet_types_converter.h | 9 +++++++++ modules/bullet/collision_object_bullet.h | 9 +++++++++ modules/bullet/constraint_bullet.h | 9 +++++++++ modules/bullet/godot_collision_dispatcher.h | 9 +++++++++ modules/bullet/godot_ray_world_algorithm.h | 9 +++++++++ modules/bullet/godot_result_callbacks.h | 9 +++++++++ modules/bullet/shape_bullet.h | 9 +++++++++ 8 files changed, 65 insertions(+), 5 deletions(-) diff --git a/core/io/logger.cpp b/core/io/logger.cpp index 9e267a36ccf..ff86489739f 100644 --- a/core/io/logger.cpp +++ b/core/io/logger.cpp @@ -32,6 +32,7 @@ #include "core/os/dir_access.h" #include "core/os/os.h" +#include "core/os/time.h" #include "core/print_string.h" #include "core/project_settings.h" @@ -169,11 +170,7 @@ void RotatedFileLogger::rotate_file() { if (FileAccess::exists(base_path)) { if (max_files > 1) { - char timestamp[21]; - OS::Date date = OS::get_singleton()->get_date(); - OS::Time time = OS::get_singleton()->get_time(); - sprintf(timestamp, "_%04d-%02d-%02d_%02d.%02d.%02d", date.year, date.month, date.day, time.hour, time.min, time.sec); - + String timestamp = Time::get_singleton()->get_datetime_string_from_system().replace(":", "."); String backup_name = base_path.get_basename() + timestamp; if (base_path.get_extension() != String()) { backup_name += "." + base_path.get_extension(); diff --git a/modules/bullet/bullet_types_converter.h b/modules/bullet/bullet_types_converter.h index 5cf2e81fbc7..bd2a8a039d9 100644 --- a/modules/bullet/bullet_types_converter.h +++ b/modules/bullet/bullet_types_converter.h @@ -36,10 +36,19 @@ #include "core/math/vector3.h" #include "core/typedefs.h" +#if defined(__clang__) && (__clang_major__ >= 13) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +#endif + #include #include #include +#if defined(__clang__) && (__clang_major__ >= 13) +#pragma clang diagnostic pop +#endif + /** @author AndreaCatania */ diff --git a/modules/bullet/collision_object_bullet.h b/modules/bullet/collision_object_bullet.h index 83c9046eb10..da02527611c 100644 --- a/modules/bullet/collision_object_bullet.h +++ b/modules/bullet/collision_object_bullet.h @@ -37,8 +37,17 @@ #include "core/vset.h" #include "shape_owner_bullet.h" +#if defined(__clang__) && (__clang_major__ >= 13) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +#endif + #include +#if defined(__clang__) && (__clang_major__ >= 13) +#pragma clang diagnostic pop +#endif + /** @author AndreaCatania */ diff --git a/modules/bullet/constraint_bullet.h b/modules/bullet/constraint_bullet.h index 8b901d0f7b3..5b82e0ac385 100644 --- a/modules/bullet/constraint_bullet.h +++ b/modules/bullet/constraint_bullet.h @@ -34,8 +34,17 @@ #include "bullet_utilities.h" #include "rid_bullet.h" +#if defined(__clang__) && (__clang_major__ >= 13) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +#endif + #include +#if defined(__clang__) && (__clang_major__ >= 13) +#pragma clang diagnostic pop +#endif + /** @author AndreaCatania */ diff --git a/modules/bullet/godot_collision_dispatcher.h b/modules/bullet/godot_collision_dispatcher.h index c3f7ae93eff..c3388cf69aa 100644 --- a/modules/bullet/godot_collision_dispatcher.h +++ b/modules/bullet/godot_collision_dispatcher.h @@ -33,8 +33,17 @@ #include "core/int_types.h" +#if defined(__clang__) && (__clang_major__ >= 13) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +#endif + #include +#if defined(__clang__) && (__clang_major__ >= 13) +#pragma clang diagnostic pop +#endif + /** @author AndreaCatania */ diff --git a/modules/bullet/godot_ray_world_algorithm.h b/modules/bullet/godot_ray_world_algorithm.h index c81e1107c82..28ac82a4047 100644 --- a/modules/bullet/godot_ray_world_algorithm.h +++ b/modules/bullet/godot_ray_world_algorithm.h @@ -31,10 +31,19 @@ #ifndef GODOT_RAY_WORLD_ALGORITHM_H #define GODOT_RAY_WORLD_ALGORITHM_H +#if defined(__clang__) && (__clang_major__ >= 13) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +#endif + #include #include #include +#if defined(__clang__) && (__clang_major__ >= 13) +#pragma clang diagnostic pop +#endif + /** @author AndreaCatania */ diff --git a/modules/bullet/godot_result_callbacks.h b/modules/bullet/godot_result_callbacks.h index 824ef00c707..4248491fd5e 100644 --- a/modules/bullet/godot_result_callbacks.h +++ b/modules/bullet/godot_result_callbacks.h @@ -33,9 +33,18 @@ #include "servers/physics_server.h" +#if defined(__clang__) && (__clang_major__ >= 13) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +#endif + #include #include +#if defined(__clang__) && (__clang_major__ >= 13) +#pragma clang diagnostic pop +#endif + /** @author AndreaCatania */ diff --git a/modules/bullet/shape_bullet.h b/modules/bullet/shape_bullet.h index d65c36ed4b3..fe68f745482 100644 --- a/modules/bullet/shape_bullet.h +++ b/modules/bullet/shape_bullet.h @@ -36,10 +36,19 @@ #include "rid_bullet.h" #include "servers/physics_server.h" +#if defined(__clang__) && (__clang_major__ >= 13) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +#endif + #include #include #include +#if defined(__clang__) && (__clang_major__ >= 13) +#pragma clang diagnostic pop +#endif + /** @author AndreaCatania */