MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / swapByteOrder

Function swapByteOrder

Tools/partio2vtk/main.cpp:33–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31
32template<typename T>
33inline void swapByteOrder(T*v)
34{
35 constexpr size_t n = sizeof(T);
36 uint8_t out[n];
37 for (unsigned int c = 0; c < n; c++)
38 out[c] = reinterpret_cast<uint8_t*>(v)[n - c - 1];
39 std::memcpy(v, out, n);
40}
41
42// main
43int main(int argc, char **argv)

Callers 5

saveParticleCloudVTKFunction · 0.70
writeRigidBodiesMethod · 0.50
writeParticlesMethod · 0.50
writeParticlesVTKMethod · 0.50
writeParticleDataVTKMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected