---------------------------------------------------------------------- Swap two bytes of data * @param[inout] _szOut A void* to save the reintcasts for the caller. */
| 73 | /** Swap two bytes of data |
| 74 | * @param[inout] _szOut A void* to save the reintcasts for the caller. */ |
| 75 | static inline void Swap2(void* _szOut) |
| 76 | { |
| 77 | ai_assert(_szOut); |
| 78 | |
| 79 | #if _MSC_VER >= 1400 |
| 80 | uint16_t* const szOut = reinterpret_cast<uint16_t*>(_szOut); |
| 81 | *szOut = _byteswap_ushort(*szOut); |
| 82 | #else |
| 83 | uint8_t* const szOut = reinterpret_cast<uint8_t*>(_szOut); |
| 84 | std::swap(szOut[0],szOut[1]); |
| 85 | #endif |
| 86 | } |
| 87 | |
| 88 | // ---------------------------------------------------------------------- |
| 89 | /** Swap four bytes of data |