소스 검색

Collapse unnamed union in VariantValue.

Eugene Kozlov 8 년 전
부모
커밋
71c490c492
1개의 변경된 파일29개의 추가작업 그리고 31개의 파일을 삭제
  1. 29 31
      Source/Urho3D/Core/Variant.h

+ 29 - 31
Source/Urho3D/Core/Variant.h

@@ -169,38 +169,36 @@ struct URHO3D_API ResourceRefList
 static const unsigned VARIANT_VALUE_SIZE = sizeof(void*) * 4;
 
 /// Union for the possible variant values. Objects exceeding the VARIANT_VALUE_SIZE are allocated on the heap.
-struct VariantValue
+union VariantValue
 {
-    union
-    {
-        unsigned char storage_[VARIANT_VALUE_SIZE];
-        int int_;
-        bool bool_;
-        float float_;
-        Vector2 vector2_;
-        Vector3 vector3_;
-        Vector4 vector4_;
-        Quaternion quaterion_;
-        Color color_;
-        String string_;
-        PODVector<unsigned char> buffer_;
-        void* voidPtr_;
-        ResourceRef resourceRef_;
-        ResourceRefList resourceRefList_;
-        VariantVector variantVector_;
-        VariantMap variantMap_;
-        IntRect intRect_;
-        IntVector2 intVector2_;
-        WeakPtr<RefCounted> weakPtr_;
-        Matrix3* matrix3_;
-        Matrix3x4* matrix3x4_;
-        Matrix4* matrix4_;
-        double double_;
-        StringVector stringVector_;
-        Rect rect_;
-        IntVector3 intVector3_;
-        long long int64_;
-    };
+    unsigned char storage_[VARIANT_VALUE_SIZE];
+    int int_;
+    bool bool_;
+    float float_;
+    Vector2 vector2_;
+    Vector3 vector3_;
+    Vector4 vector4_;
+    Quaternion quaterion_;
+    Color color_;
+    String string_;
+    PODVector<unsigned char> buffer_;
+    void* voidPtr_;
+    ResourceRef resourceRef_;
+    ResourceRefList resourceRefList_;
+    VariantVector variantVector_;
+    VariantMap variantMap_;
+    IntRect intRect_;
+    IntVector2 intVector2_;
+    WeakPtr<RefCounted> weakPtr_;
+    Matrix3* matrix3_;
+    Matrix3x4* matrix3x4_;
+    Matrix4* matrix4_;
+    double double_;
+    StringVector stringVector_;
+    Rect rect_;
+    IntVector3 intVector3_;
+    long long int64_;
+
     /// Construct uninitialized.
     VariantValue() { }
     /// Non-copyable.