24#include <CoreFoundation/CoreFoundation.h>
46 size_t i_right = len - 1;
47 while (i_left < i_right)
50 uint8_t left_copy = byte_array[i_left];
51 byte_array[i_left] = byte_array[i_right];
52 byte_array[i_right] = left_copy;
73 static inline uint16_t
ByteSwap16(
const uint16_t& x )
80 static inline int16_t
ByteSwap16(
const int16_t& x )
87 static inline uint32_t
ByteSwap32(
const uint32_t& x )
94 static inline int32_t
ByteSwap32(
const int32_t& x)
101 static inline uint64_t
ByteSwap64 (
const uint64_t& x )
108 static inline int64_t
ByteSwap64(
const int64_t& x)
118 static inline uint16_t
ByteSwap16( uint16_t x )
120 return CFSwapInt16(x);
125 return (int16_t)CFSwapInt16((uint16_t)x);
128 static inline uint32_t
ByteSwap32( uint32_t x )
130 return CFSwapInt32(x);
135 return (int32_t)CFSwapInt32((uint32_t)x);
138 static inline uint64_t
ByteSwap64( uint64_t x )
140 return CFSwapInt64(x);
145 return (int64_t)CFSwapInt64((uint64_t)x);
157 return (int16_t)bswap_16((uint16_t)x);
167 return (int32_t)bswap_32((uint32_t)x);
177 return (int64_t)bswap_64((uint64_t)x);
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
static void ByteSwapArray(uint8_t *byte_array, size_t len)
Swap all the bytes in an array to convert from little - endian byte order to big-endian byte order,...
static double ByteSwap64(const double &x)
static uint16_t ByteSwap16(uint16_t x)
static float ByteSwap32(const float &x)