ソースを参照

[iOS] Fix build with warnings=extra.

(cherry picked from commit 987723b386f2b63ea33294c81ce026c6b45e1ae3)
bruvzg 2 年 前
コミット
6e29a9573c

+ 3 - 2
core/io/logger.cpp

@@ -169,10 +169,11 @@ void RotatedFileLogger::rotate_file() {
 
 	if (FileAccess::exists(base_path)) {
 		if (max_files > 1) {
-			char timestamp[21];
+			const size_t TIMESTAMP_SIZE = 21;
+			char timestamp[TIMESTAMP_SIZE];
 			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);
+			snprintf(timestamp, TIMESTAMP_SIZE, "_%04d-%02d-%02d_%02d.%02d.%02d", date.year, date.month, date.day, time.hour, time.min, time.sec);
 
 			String backup_name = base_path.get_basename() + timestamp;
 			if (base_path.get_extension() != String()) {

+ 9 - 0
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 <LinearMath/btMatrix3x3.h>
 #include <LinearMath/btTransform.h>
 #include <LinearMath/btVector3.h>
 
+#if defined(__clang__) && (__clang_major__ >= 13)
+#pragma clang diagnostic pop
+#endif
+
 /**
 	@author AndreaCatania
 */

+ 9 - 0
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 <LinearMath/btTransform.h>
 
+#if defined(__clang__) && (__clang_major__ >= 13)
+#pragma clang diagnostic pop
+#endif
+
 /**
 	@author AndreaCatania
 */

+ 9 - 0
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 <BulletDynamics/ConstraintSolver/btTypedConstraint.h>
 
+#if defined(__clang__) && (__clang_major__ >= 13)
+#pragma clang diagnostic pop
+#endif
+
 /**
 	@author AndreaCatania
 */

+ 9 - 0
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 <btBulletDynamicsCommon.h>
 
+#if defined(__clang__) && (__clang_major__ >= 13)
+#pragma clang diagnostic pop
+#endif
+
 /**
 	@author AndreaCatania
 */

+ 9 - 0
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 <BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h>
 #include <BulletCollision/CollisionDispatch/btCollisionCreateFunc.h>
 #include <BulletCollision/CollisionDispatch/btCollisionDispatcher.h>
 
+#if defined(__clang__) && (__clang_major__ >= 13)
+#pragma clang diagnostic pop
+#endif
+
 /**
 	@author AndreaCatania
 */

+ 9 - 0
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 <BulletCollision/BroadphaseCollision/btBroadphaseProxy.h>
 #include <btBulletDynamicsCommon.h>
 
+#if defined(__clang__) && (__clang_major__ >= 13)
+#pragma clang diagnostic pop
+#endif
+
 /**
 	@author AndreaCatania
 */

+ 9 - 0
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 <LinearMath/btAlignedObjectArray.h>
 #include <LinearMath/btScalar.h>
 #include <LinearMath/btVector3.h>
 
+#if defined(__clang__) && (__clang_major__ >= 13)
+#pragma clang diagnostic pop
+#endif
+
 /**
 	@author AndreaCatania
 */