mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 02:32:06 +00:00
Prefer pre-increment/decrement operators in for loops
This commit is contained in:
@@ -79,7 +79,7 @@ void out_AddSection(Section const §ion) {
|
||||
);
|
||||
}
|
||||
|
||||
for (uint32_t i = sections[section.type].size(); i < minNbBanks; i++) {
|
||||
for (uint32_t i = sections[section.type].size(); i < minNbBanks; ++i) {
|
||||
sections[section.type].emplace_back();
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ static void coverOverlayBanks(uint32_t nbOverlayBanks) {
|
||||
: 0;
|
||||
|
||||
if (nbUncoveredBanks > sections[SECTTYPE_ROMX].size()) {
|
||||
for (uint32_t i = sections[SECTTYPE_ROMX].size(); i < nbUncoveredBanks; i++) {
|
||||
for (uint32_t i = sections[SECTTYPE_ROMX].size(); i < nbUncoveredBanks; ++i) {
|
||||
sections[SECTTYPE_ROMX].emplace_back();
|
||||
}
|
||||
}
|
||||
@@ -189,7 +189,7 @@ static void
|
||||
continue;
|
||||
}
|
||||
// Skip bytes even with pipes
|
||||
for (uint16_t i = 0; i < section->size; i++) {
|
||||
for (uint16_t i = 0; i < section->size; ++i) {
|
||||
getc(overlayFile);
|
||||
}
|
||||
}
|
||||
@@ -255,7 +255,7 @@ static void writeROM() {
|
||||
sectionTypeInfo[SECTTYPE_ROM0].size
|
||||
);
|
||||
|
||||
for (uint32_t i = 0; i < sections[SECTTYPE_ROMX].size(); i++) {
|
||||
for (uint32_t i = 0; i < sections[SECTTYPE_ROMX].size(); ++i) {
|
||||
writeBank(
|
||||
§ions[SECTTYPE_ROMX][i].sections,
|
||||
sectionTypeInfo[SECTTYPE_ROMX].startAddr,
|
||||
@@ -498,7 +498,7 @@ static void writeMapBank(SortedSections const §List, SectionType type, uint3
|
||||
static void writeMapSummary() {
|
||||
fputs("SUMMARY:\n", mapFile);
|
||||
|
||||
for (uint8_t i = 0; i < SECTTYPE_INVALID; i++) {
|
||||
for (uint8_t i = 0; i < SECTTYPE_INVALID; ++i) {
|
||||
SectionType type = typeMap[i];
|
||||
uint32_t nbBanks = sections[type].size();
|
||||
|
||||
@@ -514,7 +514,7 @@ static void writeMapSummary() {
|
||||
|
||||
uint32_t usedTotal = 0;
|
||||
|
||||
for (uint32_t bank = 0; bank < nbBanks; bank++) {
|
||||
for (uint32_t bank = 0; bank < nbBanks; ++bank) {
|
||||
usedTotal += forEachSection(sections[type][bank], [](Section const &) {});
|
||||
}
|
||||
|
||||
@@ -552,10 +552,10 @@ static void writeSym() {
|
||||
|
||||
fputs("; File generated by rgblink\n", symFile);
|
||||
|
||||
for (uint8_t i = 0; i < SECTTYPE_INVALID; i++) {
|
||||
for (uint8_t i = 0; i < SECTTYPE_INVALID; ++i) {
|
||||
SectionType type = typeMap[i];
|
||||
|
||||
for (uint32_t bank = 0; bank < sections[type].size(); bank++) {
|
||||
for (uint32_t bank = 0; bank < sections[type].size(); ++bank) {
|
||||
writeSymBank(sections[type][bank], type, bank);
|
||||
}
|
||||
}
|
||||
@@ -602,10 +602,10 @@ static void writeMap() {
|
||||
|
||||
writeMapSummary();
|
||||
|
||||
for (uint8_t i = 0; i < SECTTYPE_INVALID; i++) {
|
||||
for (uint8_t i = 0; i < SECTTYPE_INVALID; ++i) {
|
||||
SectionType type = typeMap[i];
|
||||
|
||||
for (uint32_t bank = 0; bank < sections[type].size(); bank++) {
|
||||
for (uint32_t bank = 0; bank < sections[type].size(); ++bank) {
|
||||
writeMapBank(sections[type][bank], type, bank);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user