[Spread-cvs] commit: r393 - trunk/stdutil/src

jschultz at spread.org jschultz at spread.org
Wed Jan 24 17:41:09 EST 2007


Author: jschultz
Date: 2007-01-24 17:41:09 -0500 (Wed, 24 Jan 2007)
New Revision: 393

Modified:
   trunk/stdutil/src/stdutil.c
Log:
Fixed improper integer cast in stdhcode_sfh_get16bits in the #else definition.  This bug would cause byte alignment failures on picky architectures.



Modified: trunk/stdutil/src/stdutil.c
===================================================================
--- trunk/stdutil/src/stdutil.c	2006-11-30 16:52:43 UTC (rev 392)
+++ trunk/stdutil/src/stdutil.c	2007-01-24 22:41:09 UTC (rev 393)
@@ -219,7 +219,8 @@
      defined (__BORLANDC__) || defined (__TURBOC__))
 #  define stdhcode_sfh_get16bits(d) ( *((const stduint16*)(d)) )
 #else
-#  define stdhcode_sfh_get16bits(d) ( ((stduint32) *((const stduint8 *)(d) + 1) << 8) | *(const stduint32 *)(d) )
+#  define stdhcode_sfh_get16bits(d) ( ((stduint32) *((const stduint8 *)(d) + 1) << 8) | 
+                                       (stduint32) *(const stduint8 *)(d) )
 #endif
 
 STDINLINE stduint32 stdhcode_sfh(const void * buf, stdsize buf_len) 




More information about the Spread-cvs mailing list