Wstringop-overflow

This commit is contained in:
tildearrow 2024-04-07 23:06:53 -05:00
parent e118da5d40
commit 2020aba481
2 changed files with 6 additions and 2 deletions

View file

@ -1233,7 +1233,11 @@ void OPLL_writeReg(OPLL *opll, uint32_t reg, uint8_t data) {
reg -= 9;
}
opll->reg[reg] = (uint8_t)data;
// is the compiler stupid or what?
// -Wstringop-overflow seems to be the buggiest thing known to humanity...
if (reg<0x40) {
opll->reg[reg] = (uint8_t)data;
}
switch (reg) {
case 0x00:

View file

@ -96,7 +96,7 @@ typedef struct __OPLL {
double out_step;
double out_time;
uint8_t reg[0x40];
uint8_t reg[64];
uint8_t test_flag;
uint32_t slot_key_status;
uint8_t rhythm_mode;