Some refactoring

This commit is contained in:
Rangi42
2023-12-18 15:51:13 -05:00
parent fdd45ab1dc
commit 09dbc50447
2 changed files with 14 additions and 18 deletions

View File

@@ -297,22 +297,19 @@ static void placeSection(struct Section *section)
if (section->isBankFixed && nbbanks(section->type) != 1) {
if (section->isAddressFixed)
snprintf(where, 64, "at $%02" PRIx32 ":%04" PRIx16,
snprintf(where, sizeof(where), "at $%02" PRIx32 ":%04" PRIx16,
section->bank, section->org);
else if (section->isAlignFixed)
snprintf(where, 64, "in bank $%02" PRIx32 " with align mask %" PRIx16,
snprintf(where, sizeof(where), "in bank $%02" PRIx32 " with align mask %" PRIx16,
section->bank, (uint16_t)~section->alignMask);
else
snprintf(where, 64, "in bank $%02" PRIx32,
section->bank);
snprintf(where, sizeof(where), "in bank $%02" PRIx32, section->bank);
} else {
if (section->isAddressFixed)
snprintf(where, 64, "at address $%04" PRIx16,
section->org);
snprintf(where, sizeof(where), "at address $%04" PRIx16, section->org);
else if (section->isAlignFixed)
snprintf(where, 64, "with align mask %" PRIx16 " and offset %" PRIx16,
(uint16_t)~section->alignMask,
section->alignOfs);
snprintf(where, sizeof(where), "with align mask %" PRIx16 " and offset %" PRIx16,
(uint16_t)~section->alignMask, section->alignOfs);
else
strcpy(where, "anywhere");
}