ref: 07cc4fb8fd95fe33954958667ebe9ce186d2d1da
parent: 720ae59af856641babb2da019cc64b2dbfeabe92
author: AntonioND <[email protected]>
date: Tue Apr 4 17:56:18 EDT 2017
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 <[email protected]>
--- a/src/link/patch.c
+++ b/src/link/patch.c
@@ -68,14 +68,8 @@
errx(1, "*INTERNAL* UNKNOWN SYMBOL TYPE");
}
- if (nBank == BANK_WRAM0 || nBank == BANK_ROM0) {
- /* This can have practical uses. */
- 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.");
+ if (nBank == BANK_WRAM0 || nBank == BANK_ROM0 || nBank == BANK_OAM ||
+ nBank == BANK_HRAM) {
return 0;
} else if (nBank >= BANK_WRAMX && nBank < (BANK_WRAMX + BANK_COUNT_WRAMX)) {
return nBank - BANK_WRAMX + 1;