summaryrefslogtreecommitdiff
path: root/src/core/loader/elf.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2016-01-25 00:41:32 -0800
committerGravatar Yuri Kunde Schlesner2016-01-25 00:41:32 -0800
commit8b3994e9e4629423960f9ba22e5df01afd5b724b (patch)
treeaf24d4a10baa5c0c3eee4e2eefb2b202245c3a5e /src/core/loader/elf.cpp
parentMerge pull request #1372 from lioncash/tie (diff)
parentelf: Don't cast away const (diff)
downloadyuzu-8b3994e9e4629423960f9ba22e5df01afd5b724b.tar.gz
yuzu-8b3994e9e4629423960f9ba22e5df01afd5b724b.tar.xz
yuzu-8b3994e9e4629423960f9ba22e5df01afd5b724b.zip
Merge pull request #1373 from lioncash/cast
elf: Don't cast away const
Diffstat (limited to 'src/core/loader/elf.cpp')
-rw-r--r--src/core/loader/elf.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp
index 5d7264f12..69df94324 100644
--- a/src/core/loader/elf.cpp
+++ b/src/core/loader/elf.cpp
@@ -250,7 +250,7 @@ const char *ElfReader::GetSectionName(int section) const {
250 return nullptr; 250 return nullptr;
251 251
252 int name_offset = sections[section].sh_name; 252 int name_offset = sections[section].sh_name;
253 const char* ptr = (char*)GetSectionDataPtr(header->e_shstrndx); 253 const char* ptr = reinterpret_cast<const char*>(GetSectionDataPtr(header->e_shstrndx));
254 254
255 if (ptr) 255 if (ptr)
256 return ptr + name_offset; 256 return ptr + name_offset;
@@ -347,10 +347,10 @@ bool ElfReader::LoadSymbols() {
347 SectionID sec = GetSectionByName(".symtab"); 347 SectionID sec = GetSectionByName(".symtab");
348 if (sec != -1) { 348 if (sec != -1) {
349 int stringSection = sections[sec].sh_link; 349 int stringSection = sections[sec].sh_link;
350 const char *stringBase = (const char *)GetSectionDataPtr(stringSection); 350 const char *stringBase = reinterpret_cast<const char*>(GetSectionDataPtr(stringSection));
351 351
352 //We have a symbol table! 352 //We have a symbol table!
353 Elf32_Sym* symtab = (Elf32_Sym *)(GetSectionDataPtr(sec)); 353 const Elf32_Sym* symtab = reinterpret_cast<const Elf32_Sym*>(GetSectionDataPtr(sec));
354 unsigned int numSymbols = sections[sec].sh_size / sizeof(Elf32_Sym); 354 unsigned int numSymbols = sections[sec].sh_size / sizeof(Elf32_Sym);
355 for (unsigned sym = 0; sym < numSymbols; sym++) { 355 for (unsigned sym = 0; sym < numSymbols; sym++) {
356 int size = symtab[sym].st_size; 356 int size = symtab[sym].st_size;