summaryrefslogtreecommitdiff
path: root/src/core/loader/elf.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2016-01-25 02:34:37 -0500
committerGravatar Lioncash2016-01-25 02:36:57 -0500
commita89e32b15740795bbbf03f3f0b677eb7996ef9a1 (patch)
treee7c8760765d4396c3680cb874ae17f60c8ff49d9 /src/core/loader/elf.cpp
parentMerge pull request #1371 from lioncash/return (diff)
downloadyuzu-a89e32b15740795bbbf03f3f0b677eb7996ef9a1.tar.gz
yuzu-a89e32b15740795bbbf03f3f0b677eb7996ef9a1.tar.xz
yuzu-a89e32b15740795bbbf03f3f0b677eb7996ef9a1.zip
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;