Improve error messages

NULL error messages have been given a description.

Messages that weren't descriptive enough now also print the name of the
function that has failed.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
Antonio Niño Díaz
2018-01-16 22:38:20 +00:00
parent 975200834e
commit 311b412f5d
5 changed files with 27 additions and 22 deletions

View File

@@ -97,7 +97,7 @@ void script_SetCurrentSectionType(const char *type, uint32_t bank)
{
if (strcmp(type, "ROM0") == 0) {
if (bank != 0)
errx(1, "(Internal) Trying to assign a bank number to ROM0.\n");
errx(1, "Trying to assign a bank number to ROM0.\n");
current_bank = BANK_INDEX_ROM0;
current_real_bank = 0;
return;
@@ -121,8 +121,7 @@ void script_SetCurrentSectionType(const char *type, uint32_t bank)
return;
} else if (strcmp(type, "WRAM0") == 0) {
if (bank != 0) {
errx(1, "%s: Trying to assign a bank number to WRAM0.\n",
__func__);
errx(1, "Trying to assign a bank number to WRAM0.\n");
}
current_bank = BANK_INDEX_WRAM0;
current_real_bank = 0;