From b76fc1c50df09b64a298a34728b6798d766c30f7 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Mon, 2 Oct 2017 22:29:12 +0000 Subject: [PATCH] Fix union issue (References #3871) git-svn-id: http://svn.osgeo.org/postgis/trunk@15876 b70326c6-7e19-0410-871a-916f4a2858ee --- liblwgeom/g_serialized.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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. -- 2.40.0