MCPcopy Create free account
hub / github.com/DFHack/dfhack / get_addr

Function get_addr

library/VersionInfoFactory.cpp:110–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110static uintptr_t get_addr(const char * cstr_value, const char * cstr_base,
111 const std::vector<DFHack::t_memrange> & ranges)
112{
113 uintptr_t addr = to_addr(cstr_value);
114 if (cstr_base) {
115 string base_name = "/";
116 base_name += cstr_base;
117 for (auto & range : ranges) {
118 string range_name = range.name;
119 if (range_name.ends_with(base_name)) {
120 addr += (uintptr_t)range.base;
121 break;
122 }
123 }
124 }
125 return addr;
126}
127
128void VersionInfoFactory::ParseVersion (TiXmlElement* entry, VersionInfo* mem)
129{

Callers 1

ParseVersionMethod · 0.85

Calls 1

to_addrFunction · 0.85

Tested by

no test coverage detected