summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2014-12-21 23:26:51 +0100
committerSubv <subv2112@gmail.com>2014-12-21 23:26:51 +0100
commitb3cee192892e9ee770c42f203e5a14bca17d4ba0 (patch)
tree3bd0c394f0c0243fcd23d7222d77b61ac9a7b8ca /src/core/hle/service
parentCFG: Corrected the licenses in cfg_i.cpp and cfg_u.cpp (diff)
downloadyuzu-b3cee192892e9ee770c42f203e5a14bca17d4ba0.tar
yuzu-b3cee192892e9ee770c42f203e5a14bca17d4ba0.tar.gz
yuzu-b3cee192892e9ee770c42f203e5a14bca17d4ba0.tar.bz2
yuzu-b3cee192892e9ee770c42f203e5a14bca17d4ba0.tar.lz
yuzu-b3cee192892e9ee770c42f203e5a14bca17d4ba0.tar.xz
yuzu-b3cee192892e9ee770c42f203e5a14bca17d4ba0.tar.zst
yuzu-b3cee192892e9ee770c42f203e5a14bca17d4ba0.zip
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/cfg/cfg.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp
index d41e15285..2697f8036 100644
--- a/src/core/hle/service/cfg/cfg.cpp
+++ b/src/core/hle/service/cfg/cfg.cpp
@@ -69,19 +69,16 @@ ResultCode CreateConfigInfoBlk(u32 block_id, u32 size, u32 flags, const u8* data
// Insert the block header with offset 0 for now
config->block_entries[config->total_entries] = { block_id, 0, size, flags };
if (size > 4) {
- s32 total_entries = config->total_entries - 1;
u32 offset = config->data_entries_offset;
// Perform a search to locate the next offset for the new data
// use the offset and size of the previous block to determine the new position
- while (total_entries >= 0) {
+ for (int i = config->total_entries - 1; i >= 0; --i) {
// Ignore the blocks that don't have a separate data offset
- if (config->block_entries[total_entries].size > 4) {
- offset = config->block_entries[total_entries].offset_or_data +
- config->block_entries[total_entries].size;
+ if (config->block_entries[i].size > 4) {
+ offset = config->block_entries[i].offset_or_data +
+ config->block_entries[i].size;
break;
}
-
- --total_entries;
}
config->block_entries[config->total_entries].offset_or_data = offset;