36 #ifndef __UT_Endian_h__
37 #define __UT_Endian_h__
43 #define UTswap_int16(x,z) { x = (((z & 0xff) << 8) | ((z >> 8) & 0xff)); }
44 #define UTswap_int32(x,z) { x = ((z & 0xff) << 24) | ((z & 0xff00) << 8) \
45 | ((z >> 8) & 0xff00) | ((z >> 24) & 0xff); }
46 #define UTswap_int64(x,z) { x = (((((z ) & 0xff) << 56) | \
47 (((z >> 8) & 0xff) << 48) | \
48 (((z >> 16) & 0xff) << 40) | \
49 (((z >> 24) & 0xff) << 32) | \
50 (((z >> 32) & 0xff) << 24) | \
51 (((z >> 40) & 0xff) << 16) | \
52 (((z >> 48) & 0xff) << 8) | \
53 (((z >> 56) & 0xff) ))); }
54 #define UTswap_int16_inplace(z) UTswap_int16(z,z)
55 #define UTswap_int32_inplace(z) UTswap_int32(z,z)
56 #define UTswap_int64_inplace(z) UTswap_int64(z,z)
76 #define BYTE_ORDER_MATCHING_TAG16 0x3210
77 #define BYTE_ORDER_OPPOSITE_TAG16 0x1032
78 #define BYTE_ORDER_MATCHING_TAG32 0x76543210
79 #define BYTE_ORDER_OPPOSITE_TAG32 0x10325476
80 #define BYTE_ORDER_MATCHING_TAG64 0xFEDCBA9876543210ULL
81 #define BYTE_ORDER_OPPOSITE_TAG64 0x1032547698BADCFEULL
83 #ifdef SESI_LITTLE_ENDIAN
160 #endif // End of the defines
163 #define CAST_SAME_TYPE(TYPE) \
164 inline static void UTcast(TYPE *dest, const TYPE *src, uint64 size) \
165 { memmove(dest, src, size*sizeof(TYPE)); } \
166 static inline void UTcastFast(TYPE *dest, const TYPE *src, uint64 size) \
167 { memcpy(dest, src, size*sizeof(TYPE)); } \
170 #define CAST_DIFFERENT_TYPE(DTYPE, STYPE) \
171 UT_API void UTcast(DTYPE *dest, const STYPE *src, uint64 size); \
172 static inline void UTcastFast(DTYPE *dest, const STYPE *src, uint64 size) \
174 for (uint64 i = 0; i < size; i++) \
175 dest[i]=(DTYPE)src[i]; \
311 #undef CAST_SAME_TYPE
312 #undef CAST_DIFFERENT_TYPE
GLdouble GLdouble GLdouble z
unsigned long long uint64
void UTtomips(int16 *, int64)
#define CAST_SAME_TYPE(TYPE)
GLenum GLsizei GLsizei GLint * values
UT_API void UTswapBytes(int16 *values, int64 num)
#define UTswap_int32(x, z)
#define CAST_DIFFERENT_TYPE(DTYPE, STYPE)
void UTtovax(int16 *values, int64 num)
#define UTswap_int16(x, z)