[postgis-tickets] r15877 - Fix union issue (References #3871)
Paul Ramsey
pramsey at cleverelephant.ca
Mon Oct 2 15:29:19 PDT 2017
Author: pramsey
Date: 2017-10-02 15:29:18 -0700 (Mon, 02 Oct 2017)
New Revision: 15877
Modified:
branches/2.4/liblwgeom/g_serialized.c
Log:
Fix union issue (References #3871)
Modified: branches/2.4/liblwgeom/g_serialized.c
===================================================================
--- branches/2.4/liblwgeom/g_serialized.c 2017-10-02 22:29:12 UTC (rev 15876)
+++ branches/2.4/liblwgeom/g_serialized.c 2017-10-02 22:29:18 UTC (rev 15877)
@@ -243,14 +243,11 @@
uint64_t gbox_get_sortable_hash(const GBOX *g)
{
- union x {
+
+ union floatuint {
uint32_t u;
- float f
- };
- union y {
- uint32_t u;
- float f
- };
+ float f;
+ } x, y;
/*
* Since in theory the bitwise representation of an IEEE
@@ -272,7 +269,7 @@
}
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.
More information about the postgis-tickets
mailing list