From: Tilghman Lesher Date: Fri, 20 Nov 2009 21:47:39 +0000 (+0000) Subject: Revert code in error and include the gcc suggested workaround for the original proble... X-Git-Tag: 11.0.0-beta1~3841 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6378e07d7b5406391669627e23080abdc797a1b;p=thirdparty%2Fasterisk.git Revert code in error and include the gcc suggested workaround for the original problem, while gcc investigates. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230697 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/include/asterisk/unaligned.h b/include/asterisk/unaligned.h index 4737c4ec91..63f430f896 100644 --- a/include/asterisk/unaligned.h +++ b/include/asterisk/unaligned.h @@ -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)