From b2b10ce7da7f3ac47e8f5688bb2693e1a3d7a8c4 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 18 Jul 2023 18:20:11 +0200 Subject: [PATCH] Fix various core types to be trivially constructible as properly POD-type --- Source/Editor/Tools/Foliage/FoliageTools.cpp | 1 - Source/Engine/Core/Math/BoundingBox.h | 4 +--- Source/Engine/Core/Math/BoundingFrustum.h | 4 +--- Source/Engine/Core/Math/BoundingSphere.h | 4 +--- Source/Engine/Core/Math/Color.h | 4 +--- Source/Engine/Core/Math/Color32.h | 4 +--- Source/Engine/Core/Math/Half.h | 12 +++--------- Source/Engine/Core/Math/Matrix.h | 4 +--- Source/Engine/Core/Math/Matrix3x3.h | 4 +--- Source/Engine/Core/Math/Plane.h | 4 +--- Source/Engine/Core/Math/Quaternion.h | 4 +--- Source/Engine/Core/Math/Ray.h | 4 +--- Source/Engine/Core/Math/Rectangle.h | 4 +--- Source/Engine/Core/Math/Transform.h | 4 +--- Source/Engine/Core/Math/Triangle.h | 4 +--- Source/Engine/Core/Math/Vector2.h | 4 +--- Source/Engine/Core/Math/Vector3.h | 4 +--- Source/Engine/Core/Math/Vector4.h | 4 +--- Source/Engine/Core/Math/Viewport.h | 4 +--- 19 files changed, 20 insertions(+), 61 deletions(-) diff --git a/Source/Editor/Tools/Foliage/FoliageTools.cpp b/Source/Editor/Tools/Foliage/FoliageTools.cpp index b24bcdf00..7d0de7d41 100644 --- a/Source/Editor/Tools/Foliage/FoliageTools.cpp +++ b/Source/Editor/Tools/Foliage/FoliageTools.cpp @@ -292,7 +292,6 @@ void FoliageTools::Paint(Foliage* foliage, Span foliageTypesIndices, cons { PROFILE_CPU_NAMED("Place Instances"); - Matrix matrix; FoliageInstance instance; Quaternion tmp; Matrix world; diff --git a/Source/Engine/Core/Math/BoundingBox.h b/Source/Engine/Core/Math/BoundingBox.h index 0ee4fc1a9..d06ef0b3f 100644 --- a/Source/Engine/Core/Math/BoundingBox.h +++ b/Source/Engine/Core/Math/BoundingBox.h @@ -38,9 +38,7 @@ public: /// /// Empty constructor. /// - BoundingBox() - { - } + BoundingBox() = default; /// /// Initializes a new instance of the struct. diff --git a/Source/Engine/Core/Math/BoundingFrustum.h b/Source/Engine/Core/Math/BoundingFrustum.h index 287d33c2f..1502b6302 100644 --- a/Source/Engine/Core/Math/BoundingFrustum.h +++ b/Source/Engine/Core/Math/BoundingFrustum.h @@ -34,9 +34,7 @@ public: /// /// Empty constructor. /// - BoundingFrustum() - { - } + BoundingFrustum() = default; /// /// Initializes a new instance of the struct. diff --git a/Source/Engine/Core/Math/BoundingSphere.h b/Source/Engine/Core/Math/BoundingSphere.h index 08f5df7f1..da303e8d5 100644 --- a/Source/Engine/Core/Math/BoundingSphere.h +++ b/Source/Engine/Core/Math/BoundingSphere.h @@ -34,9 +34,7 @@ public: /// /// Empty constructor. /// - BoundingSphere() - { - } + BoundingSphere() = default; /// /// Initializes a new instance of the struct. diff --git a/Source/Engine/Core/Math/Color.h b/Source/Engine/Core/Math/Color.h index 997ed9c17..af93fc0f2 100644 --- a/Source/Engine/Core/Math/Color.h +++ b/Source/Engine/Core/Math/Color.h @@ -50,9 +50,7 @@ public: /// /// Empty constructor. /// - Color() - { - } + Color() = default; /// /// Initializes a new instance of the struct. diff --git a/Source/Engine/Core/Math/Color32.h b/Source/Engine/Core/Math/Color32.h index 36da3d41d..6c2b9648d 100644 --- a/Source/Engine/Core/Math/Color32.h +++ b/Source/Engine/Core/Math/Color32.h @@ -53,9 +53,7 @@ public: /// /// Empty constructor. /// - Color32() - { - } + Color32() = default; /// /// Constructs a new Color32 with given r, g, b, a components. diff --git a/Source/Engine/Core/Math/Half.h b/Source/Engine/Core/Math/Half.h index 06b03895d..346b5d6b3 100644 --- a/Source/Engine/Core/Math/Half.h +++ b/Source/Engine/Core/Math/Half.h @@ -121,9 +121,7 @@ public: /// /// Default constructor /// - Half2() - { - } + Half2() = default; /// /// Init @@ -185,9 +183,7 @@ public: Half Z; public: - Half3() - { - } + Half3() = default; Half3(Half x, Half y, Half z) : X(x) @@ -242,9 +238,7 @@ public: Half W; public: - Half4() - { - } + Half4() = default; Half4(Half x, Half y, Half z, Half w) : X(x) diff --git a/Source/Engine/Core/Math/Matrix.h b/Source/Engine/Core/Math/Matrix.h index 7d6d57bac..aed2ead8d 100644 --- a/Source/Engine/Core/Math/Matrix.h +++ b/Source/Engine/Core/Math/Matrix.h @@ -83,9 +83,7 @@ public: /// /// Empty constructor. /// - Matrix() - { - } + Matrix() = default; /// /// Initializes a new instance of the struct. diff --git a/Source/Engine/Core/Math/Matrix3x3.h b/Source/Engine/Core/Math/Matrix3x3.h index 1e29be85a..344f68455 100644 --- a/Source/Engine/Core/Math/Matrix3x3.h +++ b/Source/Engine/Core/Math/Matrix3x3.h @@ -63,9 +63,7 @@ public: /// /// Empty constructor. /// - Matrix3x3() - { - } + Matrix3x3() = default; /// /// Initializes a new instance of the struct. diff --git a/Source/Engine/Core/Math/Plane.h b/Source/Engine/Core/Math/Plane.h index 57a2be344..8c3d4129b 100644 --- a/Source/Engine/Core/Math/Plane.h +++ b/Source/Engine/Core/Math/Plane.h @@ -30,9 +30,7 @@ public: /// /// Empty constructor. /// - Plane() - { - } + Plane() = default; /// /// Init diff --git a/Source/Engine/Core/Math/Quaternion.h b/Source/Engine/Core/Math/Quaternion.h index 5b164f979..e6425f7ab 100644 --- a/Source/Engine/Core/Math/Quaternion.h +++ b/Source/Engine/Core/Math/Quaternion.h @@ -67,9 +67,7 @@ public: /// /// Empty constructor. /// - Quaternion() - { - } + Quaternion() = default; /// /// Init diff --git a/Source/Engine/Core/Math/Ray.h b/Source/Engine/Core/Math/Ray.h index c8486f39e..f2f9081e5 100644 --- a/Source/Engine/Core/Math/Ray.h +++ b/Source/Engine/Core/Math/Ray.h @@ -35,9 +35,7 @@ public: /// /// Empty constructor. /// - Ray() - { - } + Ray() = default; /// /// Initializes a new instance of the struct. diff --git a/Source/Engine/Core/Math/Rectangle.h b/Source/Engine/Core/Math/Rectangle.h index c59905fd6..bf282b6e3 100644 --- a/Source/Engine/Core/Math/Rectangle.h +++ b/Source/Engine/Core/Math/Rectangle.h @@ -31,9 +31,7 @@ public: /// /// Empty constructor. /// - Rectangle() - { - } + Rectangle() = default; // Init // @param x Rectangle location X coordinate diff --git a/Source/Engine/Core/Math/Transform.h b/Source/Engine/Core/Math/Transform.h index ef644f08a..1079b4c23 100644 --- a/Source/Engine/Core/Math/Transform.h +++ b/Source/Engine/Core/Math/Transform.h @@ -40,9 +40,7 @@ public: /// /// Empty constructor. /// - Transform() - { - } + Transform() = default; /// /// Initializes a new instance of the struct. diff --git a/Source/Engine/Core/Math/Triangle.h b/Source/Engine/Core/Math/Triangle.h index a92919cfc..63f0e34ec 100644 --- a/Source/Engine/Core/Math/Triangle.h +++ b/Source/Engine/Core/Math/Triangle.h @@ -30,9 +30,7 @@ public: /// /// Empty constructor. /// - Triangle() - { - } + Triangle() = default; /// /// Initializes a new instance of the struct. diff --git a/Source/Engine/Core/Math/Vector2.h b/Source/Engine/Core/Math/Vector2.h index 87ced1de6..83deb009a 100644 --- a/Source/Engine/Core/Math/Vector2.h +++ b/Source/Engine/Core/Math/Vector2.h @@ -60,9 +60,7 @@ public: /// /// Empty constructor. /// - Vector2Base() - { - } + Vector2Base() = default; FORCE_INLINE Vector2Base(T xy) : X(xy) diff --git a/Source/Engine/Core/Math/Vector3.h b/Source/Engine/Core/Math/Vector3.h index 33be7f2d6..cad5250b7 100644 --- a/Source/Engine/Core/Math/Vector3.h +++ b/Source/Engine/Core/Math/Vector3.h @@ -89,9 +89,7 @@ public: /// /// Empty constructor. /// - Vector3Base() - { - } + Vector3Base() = default; FORCE_INLINE Vector3Base(T xyz) : X(xyz) diff --git a/Source/Engine/Core/Math/Vector4.h b/Source/Engine/Core/Math/Vector4.h index 213f05815..5c7b24c4a 100644 --- a/Source/Engine/Core/Math/Vector4.h +++ b/Source/Engine/Core/Math/Vector4.h @@ -76,9 +76,7 @@ public: /// /// Empty constructor. /// - Vector4Base() - { - } + Vector4Base() = default; FORCE_INLINE Vector4Base(T xyzw) : X(xyzw) diff --git a/Source/Engine/Core/Math/Viewport.h b/Source/Engine/Core/Math/Viewport.h index bb4ec8f8b..d478eb7cc 100644 --- a/Source/Engine/Core/Math/Viewport.h +++ b/Source/Engine/Core/Math/Viewport.h @@ -52,9 +52,7 @@ public: /// /// Empty constructor. /// - Viewport() - { - } + Viewport() = default; // Init // @param x The x coordinate of the upper-left corner of the viewport in pixels