fix a bunch of warnings from gcc7

This commit is contained in:
dinkc64 2018-10-07 13:49:20 +00:00
parent c7fe283cab
commit 2a7e4e5f07
15 changed files with 40 additions and 35 deletions

View File

@ -341,8 +341,8 @@ void CheatSearchExit()
nMemorySize = 0;
memset(CheatSearchShowResultAddresses, 0, CHEATSEARCH_SHOWRESULTS);
memset(CheatSearchShowResultValues, 0, CHEATSEARCH_SHOWRESULTS);
memset(CheatSearchShowResultAddresses, 0, sizeof(CheatSearchShowResultAddresses));
memset(CheatSearchShowResultValues, 0, sizeof(CheatSearchShowResultValues));
}
void CheatSearchStart()
@ -380,9 +380,9 @@ static void CheatSearchGetResults()
UINT32 nAddress;
UINT32 nResultsPos = 0;
memset(CheatSearchShowResultAddresses, 0, CHEATSEARCH_SHOWRESULTS);
memset(CheatSearchShowResultValues, 0, CHEATSEARCH_SHOWRESULTS);
memset(CheatSearchShowResultAddresses, 0, sizeof(CheatSearchShowResultAddresses));
memset(CheatSearchShowResultValues, 0, sizeof(CheatSearchShowResultValues));
for (nAddress = 0; nAddress < nMemorySize; nAddress++) {
if (MemoryStatus[nAddress] == IN_RESULTS) {
CheatSearchShowResultAddresses[nResultsPos] = nAddress;

View File

@ -85,10 +85,10 @@ UINT8 __fastcall hotdogstReadByte(UINT32 sekAddress)
void __fastcall hotdogstWriteByte(UINT32 sekAddress, UINT8 byteValue)
{
switch (sekAddress) {
if (~byteValue & 0x0100) {
case 0xd00000:
EEPROMWrite(byteValue & 0x04, byteValue & 0x02, byteValue & 0x08);
break;
{
EEPROMWrite(byteValue & 0x04, byteValue & 0x02, byteValue & 0x08);
break;
}
default: {
bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress);
@ -148,7 +148,10 @@ void __fastcall hotdogstWriteWord(UINT32 sekAddress, UINT16 wordValue)
CaveSpriteBuffer();
nCaveSpriteBank = wordValue;
return;
case 0xa8006c: // nop
return;
case 0xa8006e: {
DrvSoundLatch = wordValue;
ZetNmi();

View File

@ -92,11 +92,9 @@ UINT8 __fastcall metmqstrReadByte(UINT32 sekAddress)
void __fastcall metmqstrWriteByte(UINT32 sekAddress, UINT8 byteValue)
{
switch (sekAddress) {
if (~byteValue & 0x0100) {
case 0xd00000:
EEPROMWrite(byteValue & 0x04, byteValue & 0x02, byteValue & 0x08);
break;
}
default: {
bprintf(PRINT_NORMAL, _T("Attempt to write byte value %x to location %x\n"), byteValue, sekAddress);
@ -210,10 +208,10 @@ void __fastcall metmqstrWriteWord(UINT32 sekAddress, UINT16 wordValue)
case 0xd00000:
if (~wordValue & 0x0100) {
wordValue >>= 8;
EEPROMWrite(wordValue & 0x04, wordValue & 0x02, wordValue & 0x08);
break;
wordValue >>= 8;
EEPROMWrite(wordValue & 0x04, wordValue & 0x02, wordValue & 0x08);
}
break;
default: {
bprintf(PRINT_NORMAL, _T("Attempt to write word value %x to location %x\n"), wordValue, sekAddress);

View File

@ -4420,7 +4420,7 @@ static void KungfumRenderBgLayer(INT32 PriorityToRender, INT32 Cols, INT32 Rows,
Code |= (Colour & 0xc0) << 2;
Code &= (M62NumTiles - 1);
if ((TileIndex / 64) << 6 || ((Colour & 0x1f) >> 1) > 0x0c) {
if ((TileIndex / 64) < 6 || ((Colour & 0x1f) >> 1) > 0x0c) {
Priority = 1;
} else {
Priority = 0;

View File

@ -5472,8 +5472,8 @@ static INT32 CommonExit()
PlayTitleSample = 0;
TitleSamplePos = 0;
SpriteColourBase = 0;
memset(LayerColourBase, 0, 3);
memset(LayerPri, 0, 3);
memset(LayerColourBase, 0, sizeof(LayerColourBase));
memset(LayerPri, 0, sizeof(LayerPri));
PriorityFlag = 0;
DrvNvRamBank = 0;

View File

@ -436,8 +436,8 @@ void K052109Exit()
K052109RomMask = 0;
K052109Rom = NULL;
memset(K052109ScrollX, 0, 3);
memset(K052109ScrollY, 0, 3);
memset(K052109ScrollX, 0, sizeof(K052109ScrollX));
memset(K052109ScrollY, 0, sizeof(K052109ScrollY));
K052109ScrollCtrl = 0;
memset(K052109CharRomBank, 0, 4);
K052109RMRDLine = 0;

View File

@ -1956,11 +1956,11 @@ void GauntletSoundWrite(UINT16 Address, UINT8 Data)
case 0x103e:
case 0x103f:
{
// sound_ctl_w
// sound
switch (Address & 7)
{
case 0:
if (!Data&0x80) BurnYM2151Reset();
if (~Data&0x80) BurnYM2151Reset();
break;
case 1: /* speech write, bit D7, active low */

View File

@ -599,7 +599,7 @@ static INT32 DrvDoReset(INT32 clear_mem)
graphics_bank = 0;
question_rom = 0;
question_address = 0;
memset (remap_address, 0, 0x10);
memset (remap_address, 0, sizeof(remap_address));
return 0;
}

View File

@ -1253,7 +1253,7 @@ static INT32 DrvFrame()
}
{
memset (DrvInputs, 0xff, 0x04);
memset (DrvInputs, 0xff, 2 * sizeof(UINT16));
for (INT32 i = 0; i < 16; i++) {
DrvInputs[0] ^= (DrvJoy1[i] & 1) << i;
DrvInputs[1] ^= (DrvJoy2[i] & 1) << i;

View File

@ -2229,10 +2229,14 @@ static inline UINT16 get_palette_register(INT32 reg)
static inline void adjust_clip()
{
if (min_x > nScreenWidth) min_x = nScreenWidth-1; if (min_x < 0) min_x = 0;
if (max_x > nScreenWidth) max_x = nScreenWidth-1; if (max_x < 0) max_x = 0;
if (min_y > nScreenHeight) min_y = nScreenHeight-1; if (min_y < 0) min_y = 0;
if (max_y > nScreenHeight) max_y = nScreenHeight-1; if (max_y < 0) max_y = 0;
if (min_x > nScreenWidth) min_x = nScreenWidth-1;
if (min_x < 0) min_x = 0;
if (max_x > nScreenWidth) max_x = nScreenWidth-1;
if (max_x < 0) max_x = 0;
if (min_y > nScreenHeight) min_y = nScreenHeight-1;
if (min_y < 0) min_y = 0;
if (max_y > nScreenHeight) max_y = nScreenHeight-1;
if (max_y < 0) max_y = 0;
}
static void apply_clip()

View File

@ -45,7 +45,7 @@ static UINT8 DrvJoy2[8];
static UINT8 DrvJoy3[8];
static UINT8 DrvDips[3];
static UINT8 DrvReset;
static UINT16 DrvInputs[3];
static UINT8 DrvInputs[3];
static struct BurnInputInfo AngelkdsInputList[] = {
{"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" },

View File

@ -484,7 +484,7 @@ void TC0100SCNRenderCharLayer(INT32 Chip, INT32 Priority)
void TC0100SCNReset()
{
for (INT32 i = 0;i < TC0100SCNNum; i++) {
memset(TC0100SCNCtrl[i], 0, 8);
memset(TC0100SCNCtrl[i], 0, sizeof(TC0100SCNCtrl[i]));
memset(TC0100SCNChars[i], 0, 256 * 8 * 8);
BgScrollX[i] = 0;
@ -574,7 +574,7 @@ void TC0100SCNExit()
BurnFree(pTC0100SCNBgTempDraw[i]);
BurnFree(pTC0100SCNFgTempDraw[i]);
memset(TC0100SCNCtrl[i], 0, 8);
memset(TC0100SCNCtrl[i], 0, sizeof(TC0100SCNCtrl[i]));
BgScrollX[i] = 0;
BgScrollY[i] = 0;

View File

@ -162,7 +162,7 @@ void TC0280GRDCtrlWordWrite(UINT32 Offset, UINT16 Data)
void TC0280GRDReset()
{
memset(TC0280GRDCtrl, 0, 8);
memset(TC0280GRDCtrl, 0, sizeof(TC0280GRDCtrl));
TC0280GRDBaseColour = 0;
}
@ -205,7 +205,7 @@ void TC0280GRDExit()
BurnFree(TC0280GRDRam);
BurnFree(pRozTileMapData);
memset(TC0280GRDCtrl, 0, 8);
memset(TC0280GRDCtrl, 0, sizeof(TC0280GRDCtrl));
TC0280GRDBaseColour = 0;

View File

@ -828,7 +828,7 @@ void TC0480SCPRenderCharLayer()
void TC0480SCPReset()
{
memset(TC0480SCPChars, 0, 256 * 8 * 8);
memset(TC0480SCPCtrl, 0, 0x18);
memset(TC0480SCPCtrl, 0, sizeof(TC0480SCPCtrl));
BgScrollX[0] = BgScrollX[1] = BgScrollX[2] = BgScrollX[3] = 0;
BgScrollY[0] = BgScrollY[1] = BgScrollY[2] = BgScrollY[3] = 0;
CharScrollX = 0;
@ -881,7 +881,7 @@ void TC0480SCPExit()
BurnFree(TC0480SCPChars);
BurnFree(pTC0480SCPTempDraw);
memset(TC0480SCPCtrl, 0, 0x18);
memset(TC0480SCPCtrl, 0, sizeof(TC0480SCPCtrl));
BgScrollX[0] = BgScrollX[1] = BgScrollX[2] = BgScrollX[3] = 0;
BgScrollY[0] = BgScrollY[1] = BgScrollY[2] = BgScrollY[3] = 0;
CharScrollX = 0;

View File

@ -902,7 +902,7 @@ void AY8910Scan(INT32 nAction, INT32* pnMin)
}
for (i = 0; i < num; i++) {
char szName[16];
char szName[32];
sprintf(szName, "AY8910 #%d", i);