Rev 3343 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3343 | Rev 3593 | ||
---|---|---|---|
Line 50... | Line 50... | ||
50 | 50 | ||
51 | #define uint16_t_be2host(n) (n) |
51 | #define uint16_t_be2host(n) (n) |
52 | #define uint32_t_be2host(n) (n) |
52 | #define uint32_t_be2host(n) (n) |
53 | #define uint64_t_be2host(n) (n) |
53 | #define uint64_t_be2host(n) (n) |
54 | 54 | ||
- | 55 | #define host2uint16_t_le(n) uint16_t_byteorder_swap(n) |
|
- | 56 | #define host2uint32_t_le(n) uint32_t_byteorder_swap(n) |
|
- | 57 | #define host2uint64_t_le(n) uint64_t_byteorder_swap(n) |
|
- | 58 | ||
- | 59 | #define host2uint16_t_be(n) (n) |
|
- | 60 | #define host2uint32_t_be(n) (n) |
|
- | 61 | #define host2uint64_t_be(n) (n) |
|
- | 62 | ||
55 | #else |
63 | #else |
56 | 64 | ||
57 | #define uint16_t_le2host(n) (n) |
65 | #define uint16_t_le2host(n) (n) |
58 | #define uint32_t_le2host(n) (n) |
66 | #define uint32_t_le2host(n) (n) |
59 | #define uint64_t_le2host(n) (n) |
67 | #define uint64_t_le2host(n) (n) |
60 | 68 | ||
61 | #define uint16_t_be2host(n) uint16_t_byteorder_swap(n) |
69 | #define uint16_t_be2host(n) uint16_t_byteorder_swap(n) |
62 | #define uint32_t_be2host(n) uint32_t_byteorder_swap(n) |
70 | #define uint32_t_be2host(n) uint32_t_byteorder_swap(n) |
63 | #define uint64_t_be2host(n) uint64_t_byteorder_swap(n) |
71 | #define uint64_t_be2host(n) uint64_t_byteorder_swap(n) |
64 | 72 | ||
- | 73 | #define host2uint16_t_le(n) (n) |
|
- | 74 | #define host2uint32_t_le(n) (n) |
|
- | 75 | #define host2uint64_t_le(n) (n) |
|
- | 76 | ||
- | 77 | #define host2uint16_t_be(n) uint16_t_byteorder_swap(n) |
|
- | 78 | #define host2uint32_t_be(n) uint32_t_byteorder_swap(n) |
|
- | 79 | #define host2uint64_t_be(n) uint64_t_byteorder_swap(n) |
|
- | 80 | ||
65 | #endif |
81 | #endif |
66 | 82 | ||
67 | static inline uint64_t uint64_t_byteorder_swap(uint64_t n) |
83 | static inline uint64_t uint64_t_byteorder_swap(uint64_t n) |
68 | { |
84 | { |
69 | return ((n & 0xff) << 56) | |
85 | return ((n & 0xff) << 56) | |