From: Paul Ramsey Date: Mon, 2 Oct 2017 22:29:18 +0000 (+0000) Subject: Fix union issue (References #3871) X-Git-Tag: 2.4.1~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6065d27f20cf16c30d64c10e0ac6069cd2365aed;p=postgis Fix union issue (References #3871) git-svn-id: http://svn.osgeo.org/postgis/branches/2.4@15877 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/g_serialized.c b/liblwgeom/g_serialized.c index 54a8df3ec..fd1d2abbe 100644 --- a/liblwgeom/g_serialized.c +++ b/liblwgeom/g_serialized.c @@ -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.