Skip to content

Commit

Permalink
Remove some unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
m45t3r committed Oct 20, 2020
1 parent ec65881 commit 9386995
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 47 deletions.
20 changes: 4 additions & 16 deletions menu/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,15 @@
#define FIXED_POINT_SHIFT 16

static struct MENU_OPTIONS mMenuOptions;
static int mEmuScreenHeight;
static int mEmuScreenWidth;
static char mRomName[SAL_MAX_PATH]={""};
static u32 mLastRate=0;

static s8 mFpsDisplay[16]={""};
static s8 mVolumeDisplay[16]={""};
static s8 mQuickStateDisplay[16]={""};
static u32 mFps=0;
static u32 mLastTimer=0;
static u32 mEnterMenu=0;
static u32 mLoadRequested=0;
static u32 mSaveRequested=0;
static u32 mQuickStateTimer=0;
static u32 mVolumeTimer=0;
static u32 mVolumeDisplayTimer=0;
static u32 mFramesCleared=0;
static u32 mInMenu=0;
Expand Down Expand Up @@ -215,7 +209,7 @@ bool8_32 S9xDeinitUpdate (int Width, int Height, bool8_32)
{
mFps++;
newTimer=sal_TimerRead();
if(newTimer-mLastTimer>Memory.ROMFramesPerSecond)
if(newTimer - mLastTimer > (u32)Memory.ROMFramesPerSecond)
{
mLastTimer=newTimer;
sprintf(mFpsDisplay,"%2d/%2d", mFps, Memory.ROMFramesPerSecond);
Expand Down Expand Up @@ -441,7 +435,6 @@ static u32 LastHz = 0;
static
int Run(int sound)
{
int i;
bool PAL = !!(Memory.FillRAM[0x2133] & 4);

sal_VideoEnterGame(mMenuOptions.fullScreen, PAL, Memory.ROMFramesPerSecond);
Expand All @@ -460,7 +453,9 @@ int Run(int sound)
Settings.SixteenBitSound=true;
#endif

if (LastAudioRate != mMenuOptions.soundRate || LastStereo != mMenuOptions.stereo || LastHz != Memory.ROMFramesPerSecond)
if (LastAudioRate != mMenuOptions.soundRate ||
LastStereo != mMenuOptions.stereo ||
LastHz != (u32)Memory.ROMFramesPerSecond)
{
if (LastAudioRate != 0)
{
Expand Down Expand Up @@ -516,11 +511,6 @@ static inline int RunNoSound(void)
static
int SnesRomLoad()
{
char filename[SAL_MAX_PATH+1];
int check;
char text[256];
FILE *stream=NULL;

MenuMessageBox("Loading ROM...",mRomName,"",MENU_MESSAGE_BOX_MODE_MSG);
if (!Memory.LoadROM (mRomName))
{
Expand Down Expand Up @@ -697,8 +687,6 @@ extern "C"

int mainEntry(int argc, char* argv[])
{
int ref = 0;

s32 event=EVENT_NONE;

sal_Init();
Expand Down
10 changes: 0 additions & 10 deletions menu/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

static u16 mMenuBackground[SAL_SCREEN_WIDTH * SAL_SCREEN_HEIGHT];

static s32 mMenutileXscroll=0;
static s32 mMenutileYscroll=0;
static s32 mTileCounter=0;
static s32 mQuickSavePresent=0;
static u32 mPreviewingState=0;

Expand Down Expand Up @@ -231,8 +228,6 @@ void freeRomLists()

void DefaultRomListItems()
{
s32 i;

strcpy(mRomList[ROM_SELECTOR_SAVE_DEFAULT_DIR].displayName,"Save default directory");
strcpy(mRomList[ROM_SELECTOR_MAIN_MENU].displayName,"Main menu");
mRomList[ROM_SELECTOR_DEFAULT_FOCUS].displayName[0]=0;
Expand Down Expand Up @@ -264,7 +259,6 @@ int FileScan()
{
s32 itemCount=0, fileCount=0, dirCount=0;
s32 x,a,b,startIndex=ROM_SELECTOR_DEFAULT_FOCUS+1;
s8 text[50];
s8 filename[SAL_MAX_PATH];
s8 path[SAL_MAX_PATH];
s8 ext[SAL_MAX_PATH];
Expand Down Expand Up @@ -439,7 +433,6 @@ s32 FileSelect()
s32 menuExit=0;
s32 scanstart=0,scanend=0;
u32 keys=0;
s32 size=0, check=SAL_OK;

previousRom[0] = '\0';

Expand Down Expand Up @@ -735,7 +728,6 @@ static s32 SaveStateSelect(s32 mode)
s8 text[128];
s32 action=11;
u32 keys=0;
u16 *pixTo,*pixFrom;

if(mRomName[0]==0)
{
Expand Down Expand Up @@ -1234,7 +1226,6 @@ void MenuReloadOptions()

void MenuInit(const char *systemDir, struct MENU_OPTIONS *menuOptions)
{
s8 filename[SAL_MAX_PATH];
u16 *pix;
s32 x;

Expand All @@ -1260,7 +1251,6 @@ s32 SettingsMenu(void)
{
s32 menuExit=0,menuCount=SETTINGS_MENU_COUNT,menufocus=0,menuSmooth=0;
s32 action=0;
s32 subaction=0;
u32 keys=0;

SettingsMenuUpdateTextAll();
Expand Down
8 changes: 4 additions & 4 deletions pocketsnes/snes9x/soundux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,6 @@ void DecodeBlock (Channel *ch)
uint8 interim_byte = 0;

compressed++;
signed short *raw = ch->block = ch->decoded;

// Seperate out the header parts used for decoding

Expand Down Expand Up @@ -1647,11 +1646,12 @@ static inline void MixMono (int sample_count)
}
else
{
for (;V > 0; V--)
for (;V > 0; V--) {
if ((noise_gen <<= 1) & 0x80000000L)
noise_gen ^= 0x0040001L;
ch->sample = (noise_gen << 17) >> 17;
ch->interpolate = 0;
}
ch->sample = (noise_gen << 17) >> 17;
ch->interpolate = 0;
}
V = (ch->sample * ch-> left_vol_level) / 128;
}
Expand Down
6 changes: 2 additions & 4 deletions sal/linux/sal.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@ SDL_Surface *mScreen = NULL;
#ifdef GCW_JOYSTICK
SDL_Joystick *mJoy = NULL;
#endif
static u32 mSoundThreadFlag=0;
static u32 mSoundLastCpuSpeed=0;
static u32 mPaletteBuffer[PALETTE_BUFFER_LENGTH];
static u32 *mPaletteCurr=(u32*)&mPaletteBuffer[0];
static u32 *mPaletteLast=(u32*)&mPaletteBuffer[0];
static u32 *mPaletteEnd=(u32*)&mPaletteBuffer[PALETTE_BUFFER_LENGTH];
static u32 mInputFirst=0;

s32 mCpuSpeedLookup[1]={0};

Expand Down Expand Up @@ -114,6 +110,8 @@ static u32 sal_Input(int held)
case SDLK_HOME:
extraKeys |= SAL_INPUT_MENU;
break;
default:
continue;
}
break;
#ifdef GCW_JOYSTICK
Expand Down
11 changes: 4 additions & 7 deletions sal/unzip.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,11 @@ local int unzlocal_getShort (pzlib_filefunc_def,filestream,pX)
voidpf filestream;
uLong *pX;
{
uLong x ;
int i;
int i = 0;
int err;

err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
x = (uLong)i;
uLong x = (uLong)i;

if (err==UNZ_OK)
err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
Expand All @@ -231,12 +230,11 @@ local int unzlocal_getLong (pzlib_filefunc_def,filestream,pX)
voidpf filestream;
uLong *pX;
{
uLong x ;
int i;
int i = 0;
int err;

err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
x = (uLong)i;
uLong x = (uLong)i;

if (err==UNZ_OK)
err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
Expand Down Expand Up @@ -1534,7 +1532,6 @@ extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf)
char *szComment;
uLong uSizeBuf;
{
int err=UNZ_OK;
unz_s* s;
uLong uReadThis ;
if (file==NULL)
Expand Down
10 changes: 4 additions & 6 deletions sal/zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,11 @@ local int ziplocal_getShort (pzlib_filefunc_def,filestream,pX)
voidpf filestream;
uLong *pX;
{
uLong x ;
int i;
int i = 0;
int err;

err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i);
x = (uLong)i;
uLong x = (uLong)i;

if (err==ZIP_OK)
err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i);
Expand All @@ -400,12 +399,11 @@ local int ziplocal_getLong (pzlib_filefunc_def,filestream,pX)
voidpf filestream;
uLong *pX;
{
uLong x ;
int i;
int i = 0;
int err;

err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i);
x = (uLong)i;
uLong x = (uLong)i;

if (err==ZIP_OK)
err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i);
Expand Down

0 comments on commit 9386995

Please sign in to comment.