From 07cc4fb8fd95fe33954958667ebe9ce186d2d1da Mon Sep 17 00:00:00 2001 From: AntonioND Date: Tue, 4 Apr 2017 21:56:18 +0100 Subject: [PATCH] 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 --- src/link/patch.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/link/patch.c b/src/link/patch.c index 4a6e88e8..6beb29d5 100644 --- a/src/link/patch.c +++ b/src/link/patch.c @@ -68,14 +68,8 @@ getsymbank(SLONG symid) 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;