MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Swap2

Method Swap2

Source/ThirdParty/assimp/ByteSwapper.h:75–86  ·  view source on GitHub ↗

---------------------------------------------------------------------- Swap two bytes of data * @param[inout] _szOut A void* to save the reintcasts for the caller. */

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

swapFunction · 0.50

Tested by

no test coverage detected