Silence warnings that happen on newer GCCs

(code is presumably correct)

Change-Id: I3ee11b6a10dc87eb6f6178d6182397f0c7f686d5
This commit is contained in:
Solomon Peachy 2020-10-13 20:09:14 -04:00
parent 26bebd77ab
commit cddd8d66e2
2 changed files with 20 additions and 15 deletions

View file

@ -270,6 +270,8 @@ static int outlet_eventno;
/* set a stack limit (on each incoming event that can set off messages) /* set a stack limit (on each incoming event that can set off messages)
for the outlet functions to check to prevent stack overflow from message for the outlet functions to check to prevent stack overflow from message
recursion */ recursion */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
void outlet_setstacklim(void) void outlet_setstacklim(void)
{ {
char c; char c;
@ -277,6 +279,7 @@ void outlet_setstacklim(void)
stacklimit = (&c) - STACKSIZE; stacklimit = (&c) - STACKSIZE;
outlet_eventno++; outlet_eventno++;
} }
#pragma GCC diagnostic pop
/* get a number unique to the (clock, MIDI, GUI, etc.) event we're on */ /* get a number unique to the (clock, MIDI, GUI, etc.) event we're on */
int sched_geteventno( void) int sched_geteventno( void)

View file

@ -28,6 +28,8 @@ struct ram ram;
* make the old maps potentially invalid. * make the old maps potentially invalid.
*/ */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
void mem_updatemap(void) void mem_updatemap(void)
{ {
int n; int n;
@ -46,27 +48,27 @@ void mem_updatemap(void)
map[0x7] = rom.bank[mbc.rombank] - 0x4000; map[0x7] = rom.bank[mbc.rombank] - 0x4000;
} }
else map[0x4] = map[0x5] = map[0x6] = map[0x7] = NULL; else map[0x4] = map[0x5] = map[0x6] = map[0x7] = NULL;
if (R_VBK & 1) if (0 && (R_STAT & 0x03) == 0x03)
{ {
map[0x8] = lcd.vbank[1] - 0x8000; map[0x8] = NULL;
map[0x9] = lcd.vbank[1] - 0x8000; map[0x9] = NULL;
} }
else else
{ {
map[0x8] = lcd.vbank[0]/*[R_VBK & 1]*/ - 0x8000; map[0x8] = lcd.vbank[R_VBK & 1] - 0x8000;
map[0x9] = lcd.vbank[0]/*[R_VBK & 1]*/ - 0x8000; map[0x9] = lcd.vbank[R_VBK & 1] - 0x8000;
}
}
if (mbc.enableram && !(rtc.sel&8)) if (mbc.enableram && !(rtc.sel&8))
{ {
map[0xA] = ram.sbank[mbc.rambank] - 0xA000; map[0xA] = ram.sbank[mbc.rambank] - 0xA000;
map[0xB] = ram.sbank[mbc.rambank] - 0xA000; map[0xB] = ram.sbank[mbc.rambank] - 0xA000;
} }
else map[0xA] = map[0xB] = NULL; else map[0xA] = map[0xB] = NULL;
map[0xC] = ram.ibank[0] - 0xC000; map[0xC] = ram.ibank[0] - 0xC000; // XXX
n = R_SVBK & 0x07; n = R_SVBK & 0x07;
map[0xD] = ram.ibank[n?n:1] - 0xD000; map[0xD] = ram.ibank[n?n:1] - 0xD000;
map[0xE] = ram.ibank[0] - 0xE000; map[0xE] = ram.ibank[0] - 0xE000; // XXX
map[0xF] = NULL; map[0xF] = NULL;
map = mbc.wmap; map = mbc.wmap;
@ -79,13 +81,13 @@ void mem_updatemap(void)
map[0xB] = ram.sbank[mbc.rambank] - 0xA000; map[0xB] = ram.sbank[mbc.rambank] - 0xA000;
} }
else map[0xA] = map[0xB] = NULL; else map[0xA] = map[0xB] = NULL;
map[0xC] = ram.ibank[0] - 0xC000; map[0xC] = ram.ibank[0] - 0xC000; // XXX
n = R_SVBK & 0x07; n = R_SVBK & 0x07;
map[0xD] = ram.ibank[n?n:1] - 0xD000; map[0xD] = ram.ibank[n?n:1] - 0xD000;
map[0xE] = ram.ibank[0] - 0xE000; map[0xE] = ram.ibank[0] - 0xE000; // XXX
map[0xF] = NULL; map[0xF] = NULL;
} }
#pragma GCC diagnostic pop
/* /*
* ioreg_write handles output to io registers in the FF00-FF7F,FFFF * ioreg_write handles output to io registers in the FF00-FF7F,FFFF