6#define OPTI_INT8_MAX 0x7F
7#define OPTI_UINT8_MAX 0xFF
9#define OPTI_INT16_MAX 0x7FFF
10#define OPTI_UINT16_MAX 0xFFFF
12#define OPTI_INT32_MAX 0x7FFFFFFF
13#define OPTI_UINT32_MAX 0xFFFFFFFF
15#define OPTI_INT64_MAX 0x7FFFFFFFFFFFFFFF
16#define OPTI_UINT64_MAX 0xFFFFFFFFFFFFFFFF
23 typedef uint8_t uint8;
24 typedef int16_t int16;
25 typedef uint16_t uint16;
26 typedef int32_t int32;
27 typedef uint32_t uint32;
28 typedef int64_t int64;
29 typedef uint64_t uint64;
31 static inline uint16 swapuint16(uint16 x)
33 return (x >> 8) | (x << 8);
36 static inline uint32 swapuint32(uint32 x)
38 return ((x & 0x000000FF) << 24) |
39 ((x & 0x0000FF00) << 8) |
40 ((x & 0x00FF0000) >> 8) |
41 ((x & 0xFF000000) >> 24);
44 static inline uint64 swapuint64(uint64 x)
46 return ((x << 56) & 0xFF00000000000000ULL) | ((x << 40) & 0x00FF000000000000ULL) |
47 ((x << 24) & 0x0000FF0000000000ULL) | ((x << 8) & 0x000000FF00000000ULL) |
48 ((x >> 8) & 0x00000000FF000000ULL) | ((x >> 24) & 0x0000000000FF0000ULL) |
49 ((x >> 40) & 0x000000000000FF00ULL) | ((x >> 56) & 0x00000000000000FFULL);