Revert code in error and include the gcc suggested workaround for the original proble...
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 20 Nov 2009 21:47:39 +0000 (21:47 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 20 Nov 2009 21:47:39 +0000 (21:47 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230697 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/unaligned.h

index 4737c4e..63f430f 100644 (file)
@@ -50,16 +50,9 @@ static inline unsigned short get_unaligned_uint16(const void *p)
 
 static inline void put_unaligned_uint64(void *p, uint64_t datum)
 {
-       unsigned char *cp = p;
+       struct { unsigned int d; } __attribute__((packed,may_alias)) *pp = p;
 
-       cp[0] = (datum >> 56) & 0xff;
-       cp[1] = (datum >> 48) & 0xff;
-       cp[2] = (datum >> 40) & 0xff;
-       cp[3] = (datum >> 32) & 0xff;
-       cp[4] = (datum >> 24) & 0xff;
-       cp[5] = (datum >> 16) & 0xff;
-       cp[6] = (datum >>  8) & 0xff;
-       cp[7] = (datum >>  0) & 0xff;
+       pp->d = datum;
 }
 
 static inline void put_unaligned_uint32(void *p, unsigned int datum)