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 ) 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(); event->accept();
} }

View File

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

View File

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

View File

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

View File

@ -152,7 +152,12 @@ void NSFGI(GI h)
} }
break; break;
case GI_RESETM2: case GI_RESETM2:
case GI_POWER: NSF_init();break; case GI_POWER:
NSF_init();
break;
default:
//Unhandled cases
break;
} }
} }