Replaced SWAB macros with register-safe versions.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@165 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2002-04-21 22:25:17 +00:00
parent f761de4c32
commit 679888feb4

View file

@ -38,14 +38,20 @@
#define SWAB32(x) (x)
#else
#define SWAB16(x) \
(((x & 0x00ff) << 8) | \
((x & 0xff00) >> 8))
({ \
unsigned short __x = x; \
(((__x & 0x00ff) << 8) | \
((__x & 0xff00) >> 8)); \
})
#define SWAB32(x) \
(((x & 0x000000ff) << 24) | \
((x & 0x0000ff00) << 8) | \
((x & 0x00ff0000) >> 8) | \
((x & 0xff000000) >> 24))
({ \
unsigned long __x = x; \
(((__x & 0x000000ff) << 24) | \
((__x & 0x0000ff00) << 8) | \
((__x & 0x00ff0000) >> 8) | \
((__x & 0xff000000) >> 24)); \
})
#endif
#define nop \