]> granicus.if.org Git - postgis/commitdiff
Fix union issue (References #3871)
authorPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 2 Oct 2017 22:29:12 +0000 (22:29 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 2 Oct 2017 22:29:12 +0000 (22:29 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@15876 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/g_serialized.c

index 54a8df3ecd286cea47791041863c5e620a6c2aa2..fd1d2abbe0ac4cf332c3420de5f278f7aafc50d4 100644 (file)
@@ -243,14 +243,11 @@ static uint64_t uint32_interleave_2(uint32_t u1, uint32_t u2)
 
 uint64_t gbox_get_sortable_hash(const GBOX *g)
 {
-       union x {
-               uint32_t u;
-               float f
-       };
-       union y {
+
+       union floatuint {
                uint32_t u;
-               float f
-       };
+               float f;
+       } x, y;
 
        /*
        * Since in theory the bitwise representation of an IEEE
@@ -272,7 +269,7 @@ uint64_t gbox_get_sortable_hash(const GBOX *g)
        }
        else
        {
-               /* 
+               /*
                * Here we'd like to get two ordinates from 4 in the box.
                * Since it's just a sortable bit representation we can omit division from (A+B)/2.
                * All it should do is subtract 1 from exponent anyways.