aboutsummaryrefslogtreecommitdiff
path: root/include/platform.h
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-02-04 18:41:18 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-02-04 18:41:18 +0100
commit12ca080a1ca8dfd0aeac54485451b906a7e61b16 (patch)
treeabb273fb03a73bc9c20d05f9128bdfd9bfe55e55 /include/platform.h
parent98a4c7cf3d799ab953cb77e8b34597c73e3e7335 (diff)
downloadbusybox-w32-12ca080a1ca8dfd0aeac54485451b906a7e61b16.tar.gz
busybox-w32-12ca080a1ca8dfd0aeac54485451b906a7e61b16.tar.bz2
busybox-w32-12ca080a1ca8dfd0aeac54485451b906a7e61b16.zip
*: eliminate more aliasing warnings
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include/platform.h')
-rw-r--r--include/platform.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/platform.h b/include/platform.h
index ab4402e79..dcc61a77b 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -201,10 +201,14 @@
201 * a lvalue. This makes it more likely to not swap them by mistake 201 * a lvalue. This makes it more likely to not swap them by mistake
202 */ 202 */
203#if defined(i386) || defined(__x86_64__) 203#if defined(i386) || defined(__x86_64__)
204# define move_from_unaligned_int(v, intp) ((v) = *(int*)(intp)) 204# include <stdint.h>
205# define move_from_unaligned16(v, u16p) ((v) = *(uint16_t*)(u16p)) 205typedef int bb__aliased_int FIX_ALIASING;
206# define move_from_unaligned32(v, u32p) ((v) = *(uint32_t*)(u32p)) 206typedef uint16_t bb__aliased_uint16_t FIX_ALIASING;
207# define move_to_unaligned32(u32p, v) (*(uint32_t*)(u32p) = (v)) 207typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
208# define move_from_unaligned_int(v, intp) ((v) = *(bb__aliased_int*)(intp))
209# define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p))
210# define move_from_unaligned32(v, u32p) ((v) = *(bb__aliased_uint32_t*)(u32p))
211# define move_to_unaligned32(u32p, v) (*(bb__aliased_uint32_t*)(u32p) = (v))
208/* #elif ... - add your favorite arch today! */ 212/* #elif ... - add your favorite arch today! */
209#else 213#else
210/* performs reasonably well (gcc usually inlines memcpy here) */ 214/* performs reasonably well (gcc usually inlines memcpy here) */