Browse Source

Closes issue888: fix compiler warnings for using a gnu-extension (
anonymous structs ).

Kim Kulling 9 years ago
parent
commit
398595225e

+ 2 - 12
include/assimp/color4.h

@@ -86,12 +86,7 @@ public:
 public:
 
     // Red, green, blue and alpha color values
-    union {
-        struct {
-            TReal r, g, b, a;
-        };
-        TReal c[ 4 ];
-    };
+    TReal r, g, b, a;
 } PACK_STRUCT;  // !struct aiColor4D
 
 typedef aiColor4t<float> aiColor4D;
@@ -99,12 +94,7 @@ typedef aiColor4t<float> aiColor4D;
 #else
 
 struct aiColor4D {
-    union {
-        struct {
-            float r, g, b, a;
-        };
-        float c[ 4 ];
-    };
+    float r, g, b, a;
 } PACK_STRUCT;
 
 #endif // __cplusplus

+ 6 - 19
include/assimp/matrix3x3.h

@@ -160,16 +160,9 @@ public:
         const aiVector3t<TReal>& to, aiMatrix3x3t& out);
 
 public:
-
-    union {
-        struct {
-            TReal a1, a2, a3;
-            TReal b1, b2, b3;
-            TReal c1, c2, c3;
-        };
-        TReal m[ 3 ][ 3 ];
-        TReal mData[ 9 ];
-    };
+    TReal a1, a2, a3;
+    TReal b1, b2, b3;
+    TReal c1, c2, c3;
 } PACK_STRUCT;
 
 typedef aiMatrix3x3t<float> aiMatrix3x3;
@@ -177,15 +170,9 @@ typedef aiMatrix3x3t<float> aiMatrix3x3;
 #else
 
 struct aiMatrix3x3 {
-    union {
-        struct {
-            float a1, a2, a3;
-            float b1, b2, b3;
-            float c1, c2, c3;
-        };
-        float m[ 3 ][ 3 ];
-        float mData[ 9 ];
-    };
+    float a1, a2, a3;
+    float b1, b2, b3;
+    float c1, c2, c3;
 } PACK_STRUCT;
 
 #endif // __cplusplus

+ 8 - 20
include/assimp/matrix4x4.h

@@ -222,16 +222,10 @@ public:
         const aiVector3t<TReal>& to, aiMatrix4x4t& out);
 
 public:
-    union {
-        struct {
-            TReal a1, a2, a3, a4;
-            TReal b1, b2, b3, b4;
-            TReal c1, c2, c3, c4;
-            TReal d1, d2, d3, d4;
-        };
-        TReal m[ 4 ][ 4 ];
-        TReal mData[ 16 ];
-    };
+    TReal a1, a2, a3, a4;
+    TReal b1, b2, b3, b4;
+    TReal c1, c2, c3, c4;
+    TReal d1, d2, d3, d4;
 } PACK_STRUCT;
 
 typedef aiMatrix4x4t<float> aiMatrix4x4;
@@ -239,16 +233,10 @@ typedef aiMatrix4x4t<float> aiMatrix4x4;
 #else
 
 struct aiMatrix4x4 {
-    union {
-        struct {
-            float a1, a2, a3, a4;
-            float b1, b2, b3, b4;
-            float c1, c2, c3, c4;
-            float d1, d2, d3, d4;
-        };
-        float m[ 4 ][ 4 ];
-        float mData[ 16 ];
-    };
+    float a1, a2, a3, a4;
+    float b1, b2, b3, b4;
+    float c1, c2, c3, c4;
+    float d1, d2, d3, d4;
 } PACK_STRUCT;
 
 

+ 2 - 13
include/assimp/vector2.h

@@ -95,13 +95,7 @@ public:
     template <typename TOther>
     operator aiVector2t<TOther> () const;
 
-    union {
-        struct {
-            TReal x, y;
-        };
-        TReal v[ 2 ];
-    };
-
+    TReal x, y;
 } PACK_STRUCT;
 
 typedef aiVector2t<float> aiVector2D;
@@ -109,12 +103,7 @@ typedef aiVector2t<float> aiVector2D;
 #else
 
 struct aiVector2D {
-    union {
-        struct {
-            float x, y;
-        };
-        float v[ 2 ];
-    };
+    float x, y;
 };
 
 #endif // __cplusplus

+ 2 - 12
include/assimp/vector3.h

@@ -125,12 +125,7 @@ public:
      *  @param o Second factor */
     const aiVector3t SymMul(const aiVector3t& o);
 
-    union {
-        struct {
-            TReal x, y, z;
-        };
-        TReal v[ 3 ];
-    };
+    TReal x, y, z;
 } PACK_STRUCT;
 
 
@@ -139,12 +134,7 @@ typedef aiVector3t<float> aiVector3D;
 #else
 
 struct aiVector3D {
-    union {
-        struct {
-            float x, y, z;
-        };
-        float v[ 3 ];
-    };
+    float x, y, z;
 } PACK_STRUCT;
 
 #endif // __cplusplus

+ 1 - 0
test/regression/run.py

@@ -58,6 +58,7 @@ import os
 import subprocess
 import zipfile
 import collections
+import multiprocessing
 
 import settings
 import utils