Cleaned up a few annoying compiler warnings.

This commit is contained in:
mjbudd77 2021-12-30 20:36:45 -05:00
parent 309f417c6d
commit dbcc485e24
6 changed files with 93 additions and 63 deletions

View File

@ -3775,7 +3775,17 @@ void PianoRollScrollBar::wheelEvent(QWheelEvent *event)
if ( zDelta != 0 )
{
setValue( ofs + (6 * zDelta) );
ofs = ofs + (6 * zDelta);
if ( ofs < 0 )
{
ofs = 0;
}
else if ( ofs > maximum() )
{
ofs = maximum();
}
setValue( ofs );
}
event->accept();
}

View File

@ -160,8 +160,7 @@ class markerDragPopup : public QDialog
void dropAbort(void);
protected:
bool eventFilter(QObject *obj, QEvent *event) override;
void paintEvent(QPaintEvent *event);
void paintEvent(QPaintEvent *event) override;
int alpha;
int rowIndex;

View File

@ -144,8 +144,8 @@ static uint8 g_keyState[SDL_NUM_SCANCODES];
static int keyModifier = 0;
//static int DIPS = 0;
static uint8 keyonce[SDL_NUM_SCANCODES];
#define KEY(__a) g_keyState[MKK(__a)]
//static uint8 keyonce[SDL_NUM_SCANCODES];
//#define KEY(__a) g_keyState[MKK(__a)]
int getKeyState(int k)
{
@ -157,38 +157,38 @@ int getKeyState(int k)
return 0;
}
static int
_keyonly(int a)
{
int sc;
if (a < 0)
{
return 0;
}
sc = SDL_GetScancodeFromKey(a);
// check for valid key
if (sc >= SDL_NUM_SCANCODES || sc < 0)
{
return 0;
}
if (g_keyState[sc])
{
if (!keyonce[sc])
{
keyonce[sc] = 1;
return 1;
}
}
else
{
keyonce[sc] = 0;
}
return 0;
}
//static int
//_keyonly(int a)
//{
// int sc;
//
// if (a < 0)
// {
// return 0;
// }
//
// sc = SDL_GetScancodeFromKey(a);
//
// // check for valid key
// if (sc >= SDL_NUM_SCANCODES || sc < 0)
// {
// return 0;
// }
//
// if (g_keyState[sc])
// {
// if (!keyonce[sc])
// {
// keyonce[sc] = 1;
// return 1;
// }
// }
// else
// {
// keyonce[sc] = 0;
// }
// return 0;
//}
uint32 GetGamepadPressedImmediate(void)
{

View File

@ -464,7 +464,7 @@ FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode, bool silen
FCEU_CloseGame();
GameInfo = new FCEUGI();
memset(GameInfo, 0, sizeof(FCEUGI));
memset( (void*)GameInfo, 0, sizeof(FCEUGI));
GameInfo->filename = strdup(fp->filename.c_str());
if (fp->archiveFilename != "")
@ -1345,6 +1345,10 @@ bool FCEU_IsValidUI(EFCEUI ui) {
case FCEUI_INPUT_BARCODE:
if (!GameInfo) return false;
if (!FCEUMOV_Mode(MOVIEMODE_INACTIVE)) return false;
break;
default:
// Unhandled falls out to end of function
break;
}
return true;
@ -1406,10 +1410,16 @@ virtual void Power() {
}
};
void FCEUXGameInterface(GI command) {
switch (command) {
case GI_POWER:
cart->Power();
void FCEUXGameInterface(GI command)
{
switch (command)
{
case GI_POWER:
cart->Power();
break;
default:
// Unhandled cases
break;
}
}

View File

@ -102,9 +102,15 @@ static uint8 mapperFDS_diskaccess; // disk needs to be accessed at least once b
#define DC_INC 1
void FDSGI(GI h) {
switch (h) {
case GI_CLOSE: FDSClose(); break;
case GI_POWER: FDSInit(); break;
switch (h)
{
case GI_CLOSE: FDSClose(); break;
case GI_POWER: FDSInit(); break;
// Unhandled Cases
case GI_RESETM2:
case GI_RESETSAVE:
break;
}
}

View File

@ -134,25 +134,30 @@ void NSFGI(GI h)
{
switch(h)
{
case GI_CLOSE:
if(NSFDATA) {free(NSFDATA);NSFDATA=0;}
if(ExWRAM) {free(ExWRAM);ExWRAM=0;}
if(NSFHeader.SoundChip&1) {
// NSFVRC6_Init();
} else if(NSFHeader.SoundChip&2) {
// NSFVRC7_Init();
} else if(NSFHeader.SoundChip&4) {
// FDSSoundReset();
} else if(NSFHeader.SoundChip&8) {
NSFMMC5_Close();
} else if(NSFHeader.SoundChip&0x10) {
// NSFN106_Init();
} else if(NSFHeader.SoundChip&0x20) {
// NSFAY_Init();
}
case GI_CLOSE:
if(NSFDATA) {free(NSFDATA);NSFDATA=0;}
if(ExWRAM) {free(ExWRAM);ExWRAM=0;}
if(NSFHeader.SoundChip&1) {
// NSFVRC6_Init();
} else if(NSFHeader.SoundChip&2) {
// NSFVRC7_Init();
} else if(NSFHeader.SoundChip&4) {
// FDSSoundReset();
} else if(NSFHeader.SoundChip&8) {
NSFMMC5_Close();
} else if(NSFHeader.SoundChip&0x10) {
// NSFN106_Init();
} else if(NSFHeader.SoundChip&0x20) {
// NSFAY_Init();
}
break;
case GI_RESETM2:
case GI_POWER:
NSF_init();
break;
default:
//Unhandled cases
break;
case GI_RESETM2:
case GI_POWER: NSF_init();break;
}
}