diff options
| author | 2015-01-07 01:30:32 +0000 | |
|---|---|---|
| committer | 2015-01-15 22:23:08 +0100 | |
| commit | df0d66c7cf518638112843b0bf0a8d7950b9041c (patch) | |
| tree | efc5136c95e8cf154b0ae13974d60e6412483f3a /src/core/loader/3dsx.cpp | |
| parent | Loader: Clean up the 3DSX AppLoader. (diff) | |
| download | yuzu-df0d66c7cf518638112843b0bf0a8d7950b9041c.tar.gz yuzu-df0d66c7cf518638112843b0bf0a8d7950b9041c.tar.xz yuzu-df0d66c7cf518638112843b0bf0a8d7950b9041c.zip | |
Loader: Clean up the ELF AppLoader.
Diffstat (limited to 'src/core/loader/3dsx.cpp')
| -rw-r--r-- | src/core/loader/3dsx.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/loader/3dsx.cpp b/src/core/loader/3dsx.cpp index c3ac1f417..958dd03e8 100644 --- a/src/core/loader/3dsx.cpp +++ b/src/core/loader/3dsx.cpp | |||
| @@ -130,7 +130,7 @@ static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr) | |||
| 130 | // Read the relocation headers | 130 | // Read the relocation headers |
| 131 | u32* relocs = (u32*)(loadinfo.seg_ptrs[2] + hdr.data_seg_size); | 131 | u32* relocs = (u32*)(loadinfo.seg_ptrs[2] + hdr.data_seg_size); |
| 132 | 132 | ||
| 133 | for (unsigned current_segment = 0; current_segment < 3; current_segment++) { | 133 | for (unsigned current_segment : {0, 1, 2}) { |
| 134 | size_t size = n_reloc_tables * 4; | 134 | size_t size = n_reloc_tables * 4; |
| 135 | if (file.ReadBytes(&relocs[current_segment * n_reloc_tables], size) != size) | 135 | if (file.ReadBytes(&relocs[current_segment * n_reloc_tables], size) != size) |
| 136 | return ERROR_READ; | 136 | return ERROR_READ; |
| @@ -148,7 +148,7 @@ static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr) | |||
| 148 | memset((char*)loadinfo.seg_ptrs[2] + hdr.data_seg_size - hdr.bss_size, 0, hdr.bss_size); | 148 | memset((char*)loadinfo.seg_ptrs[2] + hdr.data_seg_size - hdr.bss_size, 0, hdr.bss_size); |
| 149 | 149 | ||
| 150 | // Relocate the segments | 150 | // Relocate the segments |
| 151 | for (unsigned current_segment = 0; current_segment < 3; current_segment++) { | 151 | for (unsigned current_segment : {0, 1, 2}) { |
| 152 | for (unsigned current_segment_reloc_table = 0; current_segment_reloc_table < n_reloc_tables; current_segment_reloc_table++) { | 152 | for (unsigned current_segment_reloc_table = 0; current_segment_reloc_table < n_reloc_tables; current_segment_reloc_table++) { |
| 153 | u32 n_relocs = relocs[current_segment * n_reloc_tables + current_segment_reloc_table]; | 153 | u32 n_relocs = relocs[current_segment * n_reloc_tables + current_segment_reloc_table]; |
| 154 | if (current_segment_reloc_table >= 2) { | 154 | if (current_segment_reloc_table >= 2) { |