MCPcopy Create free account
hub / github.com/aclements/libelfin / fixed

Method fixed

dwarf/internal.hh:130–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected