aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@gmail.com>2006-05-17 18:21:50 -0500
committerJosh Boyer <jwboyer@gmail.com>2006-05-17 18:21:50 -0500
commit5bae9f28100c12605be1a5852d04cdf973fd323c (patch)
tree1d0b041b7e7031697b61ca1a714e0f67d74d8e51 /include
parent16b24f3f92973a057e2de7e57c5ec25df5df52e9 (diff)
Switch to using standard types. This is userspace, not kernel.
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/mtd_swab.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/include/mtd_swab.h b/include/mtd_swab.h
index 05732a9..a5175da 100644
--- a/include/mtd_swab.h
+++ b/include/mtd_swab.h
@@ -4,26 +4,26 @@
#include <endian.h>
#define swab16(x) \
- ((__u16)( \
- (((__u16)(x) & (__u16)0x00ffU) << 8) | \
- (((__u16)(x) & (__u16)0xff00U) >> 8) ))
+ ((uint16_t)( \
+ (((uint16_t)(x) & (uint16_t)0x00ffU) << 8) | \
+ (((uint16_t)(x) & (uint16_t)0xff00U) >> 8) ))
#define swab32(x) \
- ((__u32)( \
- (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
- (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
- (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
- (((__u32)(x) & (__u32)0xff000000UL) >> 24) ))
+ ((uint32_t)( \
+ (((uint32_t)(x) & (__u32)0x000000ffUL) << 24) | \
+ (((uint32_t)(x) & (__u32)0x0000ff00UL) << 8) | \
+ (((uint32_t)(x) & (__u32)0x00ff0000UL) >> 8) | \
+ (((uint32_t)(x) & (__u32)0xff000000UL) >> 24) ))
#if __BYTE_ORDER == __BIG_ENDIAN
-#define cpu_to_le16(x) ({ __u16 _x = x; swab16(_x); })
-#define cpu_to_le32(x) ({ __u32 _x = x; swab32(_x); })
+#define cpu_to_le16(x) ({ uint16_t _x = x; swab16(_x); })
+#define cpu_to_le32(x) ({ uint32_t _x = x; swab32(_x); })
#define cpu_to_be16(x) (x)
#define cpu_to_be32(x) (x)
#else
#define cpu_to_le16(x) (x)
#define cpu_to_le32(x) (x)
-#define cpu_to_be16(x) ({ __u16 _x = x; swab16(_x); })
-#define cpu_to_be32(x) ({ __u32 _x = x; swab32(_x); })
+#define cpu_to_be16(x) ({ uint16_t _x = x; swab16(_x); })
+#define cpu_to_be32(x) ({ uint32_t _x = x; swab32(_x); })
#endif
#define le16_to_cpu(x) cpu_to_le16(x)
#define be16_to_cpu(x) cpu_to_be16(x)