| 230 | */ |
| 231 | template <typename T> |
| 232 | T swapEndian(T val) { |
| 233 | char* bytes = reinterpret_cast<char*>(&val); |
| 234 | for (unsigned int i = 0; i < sizeof(val) / 2; i++) { |
| 235 | std::swap(bytes[sizeof(val) - 1 - i], bytes[i]); |
| 236 | } |
| 237 | return val; |
| 238 | } |
| 239 | |
| 240 | |
| 241 | // Unpack flattened list from the convention used in TypedListProperty |
no test coverage detected