11#ifndef __BLI_ENDIAN_SWITCH_H__
12# error "this file isn't to be directly included"
31 *val = __builtin_bswap16(*val);
33 unsigned short tval = *val;
34 *val = (tval >> 8) | (tval << 8);
47 *val = __builtin_bswap32(*val);
49 unsigned int tval = *val;
50 *val = ((tval >> 24)) | ((tval << 8) & 0x00ff0000) | ((tval >> 8) & 0x0000ff00) | ((tval << 24));
67 *val = __builtin_bswap64(*val);
70 *val = ((tval >> 56)) | ((tval << 40) & 0x00ff000000000000ll) |
71 ((tval << 24) & 0x0000ff0000000000ll) | ((tval << 8) & 0x000000ff00000000ll) |
72 ((tval >> 8) & 0x00000000ff000000ll) | ((tval >> 24) & 0x0000000000ff0000ll) |
73 ((tval >> 40) & 0x000000000000ff00ll) | ((tval << 56));
BLI_INLINE void BLI_endian_switch_float(float *val)
BLI_INLINE void BLI_endian_switch_int32(int *val)
BLI_INLINE void BLI_endian_switch_int64(int64_t *val)
BLI_INLINE void BLI_endian_switch_int16(short *val)
BLI_INLINE void BLI_endian_switch_uint16(unsigned short *val)
BLI_INLINE void BLI_endian_switch_uint32(unsigned int *val)
BLI_INLINE void BLI_endian_switch_uint64(uint64_t *val)
BLI_INLINE void BLI_endian_switch_double(double *val)
unsigned long long int uint64_t