]> granicus.if.org Git - postgis/commitdiff
Changed getint and getdouble used by WKB so that it plays nice with
authorPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 13 Jan 2004 22:14:25 +0000 (22:14 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 13 Jan 2004 22:14:25 +0000 (22:14 +0000)
memory alignment (solaris issue).

git-svn-id: http://svn.osgeo.org/postgis/trunk@423 b70326c6-7e19-0410-871a-916f4a2858ee

postgis_inout.c

index 0f6351594316e1a28fe20654b9fce3ae0e4b0ca9..2b72eeebeac8a2b635cdf557e7410b5e99fac85c 100644 (file)
  *
  **********************************************************************
  * $Log$
+ * Revision 1.36  2004/01/13 22:14:25  pramsey
+ * Changed getint and getdouble used by WKB so that it plays nice with
+ * memory alignment (solaris issue).
+ *
  * Revision 1.35  2003/12/12 18:00:15  strk
  * reverted make_line patch, patched size_subobject instead - the reported bug was caused to their inconsistency
  *
@@ -3807,12 +3811,18 @@ Datum histogram2d_out(PG_FUNCTION_ARGS)
 
 int getint(char *c)
 {
-       return *((int*)c);
+       int i;
+       memcpy( &i, c, 4);
+       return i;
+//return *((int*)c);
 }
 
 double getdouble(char *c)
 {
-       return *((double*)c);
+       double d;
+       memcpy( &d, c, 8);
+       return d;
+//     return *((double*)c);
 }
 
 //void flip_endian_double(char *dd);