mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-01-22 01:30:35 -05:00
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:
parent
f761de4c32
commit
679888feb4
1 changed files with 12 additions and 6 deletions
|
|
@ -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 \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue