| 243 | |
| 244 | template<typename T> |
| 245 | inline typename std::enable_if<!std::is_floating_point<T>::value && |
| 246 | !std::is_pointer<T>::value, T>::type |
| 247 | unpack(const char **in, uint8_t packResult) |
| 248 | { |
| 249 | int64_t packed = 0; |
| 250 | |
| 251 | if (packResult <= 8) { |
| 252 | memcpy(&packed, (*in), packResult); |
| 253 | (*in) += packResult; |
| 254 | return static_cast<T>(packed); |
| 255 | } |
| 256 | |
| 257 | int bytes = packResult == 0 ? 16 : (0x0f & (packResult - 8)); |
| 258 | memcpy(&packed, (*in), bytes); |
| 259 | (*in) += bytes; |
| 260 | |
| 261 | return static_cast<T>(-packed); |
| 262 | } |
| 263 | |
| 264 | template<typename T> |
| 265 | inline typename std::enable_if<std::is_pointer<T>::value, T>::type |
nothing calls this directly
no outgoing calls
no test coverage detected