Index: ogr/ogrsf_frmts/xplane/ogr_xplane_awy_reader.cpp
===================================================================
--- ogr/ogrsf_frmts/xplane/ogr_xplane_awy_reader.cpp	(revision 15093)
+++ ogr/ogrsf_frmts/xplane/ogr_xplane_awy_reader.cpp	(working copy)
@@ -28,6 +28,7 @@
  ****************************************************************************/
 
 #include "ogr_xplane_awy_reader.h"
+#include <cassert>
 
 CPL_CVSID("$Id$");
 
@@ -289,10 +290,23 @@
 /*                      OGRXPlaneAirwayHashDouble()                     */
 /************************************************************************/
 
-static unsigned long OGRXPlaneAirwayHashDouble(double* pdfVal)
+union double_to_hilo
 {
-    unsigned int* pnValue = (unsigned int*)pdfVal;
-    return pnValue[0] ^ pnValue[1];
+    double dbl;
+    unsigned int u32[2];
+};
+
+static unsigned long OGRXPlaneAirwayHashDouble(double const& pdfVal)
+{
+    // mloskot: just to document the pre-condition
+    assert(sizeof(double) == sizeof(unsigned int) * 2);
+
+    double_to_hilo val;
+    val.dbl = pdfVal;
+    unsigned int const hi = val.u32[0];
+    unsigned int const lo = val.u32[1];
+
+    return hi ^ lo;
 }
 
 /************************************************************************/
@@ -304,9 +318,9 @@
     OGRFeature* feature = (OGRFeature*)_feature;
     OGRPoint* point = (OGRPoint*) feature->GetGeometryRef();
     unsigned long hash = CPLHashSetHashStr((unsigned char*)feature->GetFieldAsString(0));
-    double x = point->getX();
-    double y = point->getY();
-    return hash ^ OGRXPlaneAirwayHashDouble(&x) ^ OGRXPlaneAirwayHashDouble(&y);
+    double const x = point->getX();
+    double const y = point->getY();
+    return hash ^ OGRXPlaneAirwayHashDouble(x) ^ OGRXPlaneAirwayHashDouble(y);
 }
 
 /************************************************************************/
@@ -386,3 +400,4 @@
 
     OGRXPlaneLayer::ResetReading();
 }
+

