| 128 | |
| 129 | template<typename T> |
| 130 | T fixed() |
| 131 | { |
| 132 | ensure(sizeof(T)); |
| 133 | static_assert(sizeof(T) <= 8, "T too big"); |
| 134 | uint64_t val = 0; |
| 135 | const unsigned char *p = (const unsigned char*)pos; |
| 136 | if (sec->ord == byte_order::lsb) { |
| 137 | for (unsigned i = 0; i < sizeof(T); i++) |
| 138 | val |= ((uint64_t)p[i]) << (i * 8); |
| 139 | } else { |
| 140 | for (unsigned i = 0; i < sizeof(T); i++) |
| 141 | val = (val << 8) | (uint64_t)p[i]; |
| 142 | } |
| 143 | pos += sizeof(T); |
| 144 | return (T)val; |
| 145 | } |
| 146 | |
| 147 | std::uint64_t uleb128() |
| 148 | { |
nothing calls this directly
no outgoing calls
no test coverage detected