MCPcopy Create free account
hub / github.com/N64Recomp/N64Recomp / sanitize_section_name

Method sanitize_section_name

src/mdebug.cpp:135–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 }
134
135 std::string sanitize_section_name(std::string section_name) {
136 // Skip periods at the start of the section name.
137 size_t start_pos = 0;
138 while (section_name[start_pos] == '.' && start_pos < section_name.size()) {
139 start_pos++;
140 }
141
142 std::string ret = section_name.substr(start_pos);
143 for (size_t char_index = 0; char_index < ret.size(); char_index++) {
144 if (!is_identifier_char(ret[char_index])) {
145 ret[char_index] = '_';
146 }
147 }
148 return ret;
149 }
150
151 bool populate_context(const N64Recomp::ElfParsingConfig& elf_config, N64Recomp::Context& context, N64Recomp::DataSymbolMap& data_syms) {
152 size_t num_files = files_.size();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected