Remove warnings when calculating banks

getsymbank() is used for more things than just when the code explicitly
has a BANK() operator, which causes a lot of noise when building code
that has more than one object file and places variables on HRAM or OAM.

Signed-off-by: AntonioND <antonio_nd@outlook.com>
This commit is contained in:
AntonioND
2017-04-04 21:56:18 +01:00
parent 720ae59af8
commit 07cc4fb8fd

View File

@@ -68,14 +68,8 @@ getsymbank(SLONG symid)
errx(1, "*INTERNAL* UNKNOWN SYMBOL TYPE"); errx(1, "*INTERNAL* UNKNOWN SYMBOL TYPE");
} }
if (nBank == BANK_WRAM0 || nBank == BANK_ROM0) { if (nBank == BANK_WRAM0 || nBank == BANK_ROM0 || nBank == BANK_OAM ||
/* This can have practical uses. */ nBank == BANK_HRAM) {
return 0;
} else if (nBank == BANK_OAM) {
warnx("Trying to calculate BANK() of label in OAM.");
return 0;
} else if (nBank == BANK_HRAM) {
warnx("Trying to calculate BANK() of label in HRAM.");
return 0; return 0;
} else if (nBank >= BANK_WRAMX && nBank < (BANK_WRAMX + BANK_COUNT_WRAMX)) { } else if (nBank >= BANK_WRAMX && nBank < (BANK_WRAMX + BANK_COUNT_WRAMX)) {
return nBank - BANK_WRAMX + 1; return nBank - BANK_WRAMX + 1;