MCPcopy Create free account
hub / github.com/Kitware/VTK / ConvertFromNetworkOrder

Function ConvertFromNetworkOrder

IO/PostgreSQL/vtkPostgreSQLQuery.cxx:41–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40template <typename T>
41void ConvertFromNetworkOrder(T& target, const char* rawBytes)
42{
43 target = 0; // make sure we start from 0
44 for (unsigned int i = 0; i < sizeof(T); ++i)
45 {
46 int targetByte = sizeof(T) - (i + 1);
47 target |= (static_cast<T>(static_cast<unsigned char>(rawBytes[i])) << (8 * targetByte));
48 }
49}
50
51//------------------------------------------------------------------------------
52

Calls

no outgoing calls

Tested by

no test coverage detected