| 39 | |
| 40 | template <typename T> |
| 41 | void 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 |
no outgoing calls
no test coverage detected