From 8c58b23e77b342e96ca3bd3ce96443d472e1088c Mon Sep 17 00:00:00 2001 From: ugetab Date: Sat, 8 May 2010 02:30:40 +0000 Subject: [PATCH] Further normalized all of the Open/Save dialog filters, and static_cast several annoying warnings into oblivion. --- src/drivers/win/cdlogger.cpp | 8 ++++---- src/drivers/win/input.cpp | 4 ++-- src/drivers/win/luaconsole.cpp | 2 +- src/drivers/win/memview.cpp | 2 +- src/drivers/win/memwatch.cpp | 4 ++-- src/drivers/win/palette.cpp | 2 +- src/drivers/win/replay.cpp | 6 +++--- src/drivers/win/tasedit.cpp | 10 +++++----- src/drivers/win/tracer.cpp | 2 +- src/drivers/win/wave.cpp | 2 +- src/drivers/win/window.cpp | 4 ++-- src/movie.cpp | 4 ++-- 12 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/drivers/win/cdlogger.cpp b/src/drivers/win/cdlogger.cpp index a2d3b881..6a6aa10c 100644 --- a/src/drivers/win/cdlogger.cpp +++ b/src/drivers/win/cdlogger.cpp @@ -219,7 +219,7 @@ void LoadCDLog (const char* nameo) } void LoadCDLogFile(){ - const char filter[]="Code Data Log File(*.CDL)\0*.cdl\0\0"; + const char filter[]="Code Data Log File (*.CDL)\0*.cdl\0\0"; char nameo[2048]; OPENFILENAME ofn; memset(&ofn,0,sizeof(ofn)); @@ -237,7 +237,7 @@ void LoadCDLogFile(){ } void SaveCDLogFileAs(){ - const char filter[]="Code Data Log File(*.CDL)\0*.cdl\0All Files (*.*)\0*.*\0\0"; + const char filter[]="Code Data Log File (*.CDL)\0*.cdl\0All Files (*.*)\0*.*\0\0"; char nameo[2048]; OPENFILENAME ofn; memset(&ofn,0,sizeof(ofn)); @@ -310,8 +310,8 @@ void UpdateCDLogger(){ void SaveStrippedRom(){ //this is based off of iNesSave() //todo: make this support nsfs - const char NESfilter[]="Stripped iNes Rom file(*.NES)\0*.nes\0All Files (*.*)\0*.*\0\0"; - const char NSFfilter[]="Stripped NSF file(*.NSF)\0*.nsf\0All Files (*.*)\0*.*\0\0"; + const char NESfilter[]="Stripped iNes Rom file (*.NES)\0*.nes\0All Files (*.*)\0*.*\0\0"; + const char NSFfilter[]="Stripped NSF file (*.NSF)\0*.nsf\0All Files (*.*)\0*.*\0\0"; char sromfilename[MAX_PATH]; FILE *fp; OPENFILENAME ofn; diff --git a/src/drivers/win/input.cpp b/src/drivers/win/input.cpp index 70423847..2cd516e3 100644 --- a/src/drivers/win/input.cpp +++ b/src/drivers/win/input.cpp @@ -1556,7 +1556,7 @@ void FCEUI_UseInputPreset(int preset) static void PresetExport(int preset) { - const char filter[]="Input Preset File(*.pre)\0*.pre\0All Files (*.*)\0*.*\0\0"; + const char filter[]="Input Preset File (*.pre)\0*.pre\0All Files (*.*)\0*.*\0\0"; char nameo[2048]; OPENFILENAME ofn; memset(&ofn,0,sizeof(ofn)); @@ -1597,7 +1597,7 @@ static void PresetExport(int preset) static void PresetImport(int preset) { - const char filter[]="Input Preset File(*.pre)\0*.pre\0\0"; + const char filter[]="Input Preset File (*.pre)\0*.pre\0\0"; char nameo[2048]; OPENFILENAME ofn; memset(&ofn,0,sizeof(ofn)); diff --git a/src/drivers/win/luaconsole.cpp b/src/drivers/win/luaconsole.cpp index 5d65a83b..eb9d3a10 100644 --- a/src/drivers/win/luaconsole.cpp +++ b/src/drivers/win/luaconsole.cpp @@ -275,7 +275,7 @@ INT_PTR CALLBACK DlgLuaScriptDialog(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l ZeroMemory( (LPVOID)&ofn, sizeof(OPENFILENAME) ); ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = hAppWnd; - ofn.lpstrFilter = "Lua scripts (*.lua)\0*.lua\0All files (*.*)\0*.*\0\0"; + ofn.lpstrFilter = "Lua scripts (*.lua)\0*.lua\0All Files (*.*)\0*.*\0\0"; ofn.lpstrFile = szFileName; ofn.lpstrDefExt = "lua"; ofn.nMaxFile = MAX_PATH; diff --git a/src/drivers/win/memview.cpp b/src/drivers/win/memview.cpp index 93681c36..15bdcb65 100644 --- a/src/drivers/win/memview.cpp +++ b/src/drivers/win/memview.cpp @@ -371,7 +371,7 @@ int LoadTable(const char* nameo) //should return -1, otherwise returns the line number it had the error on int LoadTableFile(){ - const char filter[]="Table Files (*.TBL)\0*.tbl\0All files (*.*)\0*.*\0\0"; + const char filter[]="Table Files (*.TBL)\0*.tbl\0All Files (*.*)\0*.*\0\0"; char nameo[2048]; //todo: possibly no need for this? can lpstrfilter point to loadedcdfile instead? OPENFILENAME ofn; memset(&ofn,0,sizeof(ofn)); diff --git a/src/drivers/win/memwatch.cpp b/src/drivers/win/memwatch.cpp index 8804e6e6..a098baaf 100644 --- a/src/drivers/win/memwatch.cpp +++ b/src/drivers/win/memwatch.cpp @@ -398,7 +398,7 @@ bool iftextchanged() //Save as... static void SaveMemWatch() { - const char filter[]="Memory address list(*.txt)\0*.txt\0All Files (*.*)\0*.*\0\0"; + const char filter[]="Memory address list (*.txt)\0*.txt\0All Files (*.*)\0*.*\0\0"; OPENFILENAME ofn; memset(&ofn,0,sizeof(ofn)); @@ -497,7 +497,7 @@ static void QuickSaveMemWatch() //Save rather than Save as //Open Memwatch File static void LoadMemWatch() { - const char filter[]="Memory address list(*.txt)\0*.txt\0All Files (*.*)\0*.*\0\0"; + const char filter[]="Memory address list (*.txt)\0*.txt\0All Files (*.*)\0*.*\0\0"; char watchfcontents[2048]; //Now clear last file used variable (memwLastFilename) diff --git a/src/drivers/win/palette.cpp b/src/drivers/win/palette.cpp index 60372e31..acbf26b4 100644 --- a/src/drivers/win/palette.cpp +++ b/src/drivers/win/palette.cpp @@ -31,7 +31,7 @@ bool SetPalette(const char* nameo) **/ int LoadPaletteFile() { - const char filter[]="All usable files(*.pal)\0*.pal\0All files (*.*)\0*.*\0\0"; + const char filter[]="All usable files (*.pal)\0*.pal\0All Files (*.*)\0*.*\0\0"; bool success = false; char nameo[2048]; diff --git a/src/drivers/win/replay.cpp b/src/drivers/win/replay.cpp index 5648beef..594d34e2 100644 --- a/src/drivers/win/replay.cpp +++ b/src/drivers/win/replay.cpp @@ -658,7 +658,7 @@ BOOL CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP memset(&ofn, 0, sizeof(ofn)); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = hwndDlg; - ofn.lpstrFilter = "FCEUX Movie Files (*.fm2)\0*.fm2\0Archive files(*.zip,*.rar,*.7z)\0*.zip;*.rar;*.7z\0All files(*.*)\0*.*\0\0"; + ofn.lpstrFilter = "FCEUX Movie Files (*.fm2)\0*.fm2\0Archive Files (*.zip,*.rar,*.7z)\0*.zip;*.rar;*.7z\0All Files (*.*)\0*.*\0\0"; ofn.lpstrFile = szFile; ofn.nMaxFile = sizeof(szFile); ofn.lpstrInitialDir = pn; @@ -873,7 +873,7 @@ static BOOL CALLBACK RecordDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP memset(&ofn, 0, sizeof(ofn)); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = hwndDlg; - ofn.lpstrFilter = "FCEU Save State(*.fc?)\0*.fc?\0\0"; + ofn.lpstrFilter = "FCEU Save State (*.fc?)\0*.fc?\0\0"; ofn.lpstrFile = szChoice; ofn.lpstrDefExt = "fcs"; ofn.nMaxFile = MAX_PATH; @@ -920,7 +920,7 @@ static BOOL CALLBACK RecordDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP memset(&ofn, 0, sizeof(ofn)); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = hwndDlg; - ofn.lpstrFilter = "FCEUX Movie File (*.fm2)\0*.fm2\0All files(*.*)\0*.*\0\0"; + ofn.lpstrFilter = "FCEUX Movie File (*.fm2)\0*.fm2\0All Files (*.*)\0*.*\0\0"; ofn.lpstrFile = szChoice; //ofn.lpstrDefExt = "fm2"; ofn.nMaxFile = MAX_PATH; diff --git a/src/drivers/win/tasedit.cpp b/src/drivers/win/tasedit.cpp index 7ffc21e6..4454af0e 100644 --- a/src/drivers/win/tasedit.cpp +++ b/src/drivers/win/tasedit.cpp @@ -163,7 +163,7 @@ void UpdateTasEdit() } static int old_movie_readonly=-1; - if (old_movie_readonly != movie_readonly) + if ((!old_movie_readonly) == movie_readonly) //Originally (old_movie_readonly = movie_readonly) { old_movie_readonly = movie_readonly; if (movie_readonly) @@ -267,7 +267,7 @@ bool JumpToFrame(int index) return false; } - if (index(index)0? index-1:0; - if (i>=currMovieData.records.size()) + if (static_cast(i)>=currMovieData.records.size()) i=currMovieData.records.size()-1; /* Search for an earlier frame, and try warping to the current. */ @@ -597,7 +597,7 @@ static bool Paste() // Extract number of frames sscanf (pGlobal+3, "%d", &range); - if (currMovieData.records.size()(pos+range)) { currMovieData.insertEmpty(currMovieData.records.size(),pos+range-currMovieData.records.size()); } @@ -938,7 +938,7 @@ static void Import() //Takes current inputlog and saves it as a .fm2 file static void Export() { - const char filter[]="FCEUX Movie File(*.fm2)\0*.fm2\0All Files (*.*)\0*.*\0\0"; + const char filter[]="FCEUX Movie File (*.fm2)\0*.fm2\0All Files (*.*)\0*.*\0\0"; char fname[2048] = {0}; OPENFILENAME ofn; memset(&ofn,0,sizeof(ofn)); diff --git a/src/drivers/win/tracer.cpp b/src/drivers/win/tracer.cpp index bcadb203..0d4cbb9b 100644 --- a/src/drivers/win/tracer.cpp +++ b/src/drivers/win/tracer.cpp @@ -583,7 +583,7 @@ int PromptForCDLogger(void){ } void ShowLogDirDialog(void){ - const char filter[]="6502 Trace Log File(*.log)\0*.log;*.txt\0" "6502 Trace Log File(*.txt)\0*.log;*.txt\0All Files (*.*)\0*.*\0\0"; //'" "' used to prevent octal conversion on the numbers + const char filter[]="6502 Trace Log File (*.log)\0*.log;*.txt\0" "6502 Trace Log File (*.txt)\0*.log;*.txt\0All Files (*.*)\0*.*\0\0"; //'" "' used to prevent octal conversion on the numbers char nameo[2048]; OPENFILENAME ofn; memset(&ofn,0,sizeof(ofn)); diff --git a/src/drivers/win/wave.cpp b/src/drivers/win/wave.cpp index cc73248f..0c487691 100644 --- a/src/drivers/win/wave.cpp +++ b/src/drivers/win/wave.cpp @@ -33,7 +33,7 @@ int CloseWave() /// @return Flag that indicates failure (0) or success (1). bool CreateSoundSave() { - const char filter[]="MS WAVE(*.wav)\0*.wav\0All Files (*.*)\0*.*\0\0"; + const char filter[]="MS WAVE (*.wav)\0*.wav\0All Files (*.*)\0*.*\0\0"; char nameo[2048]; OPENFILENAME ofn; diff --git a/src/drivers/win/window.cpp b/src/drivers/win/window.cpp index a0dd3ce9..1d8400f6 100644 --- a/src/drivers/win/window.cpp +++ b/src/drivers/win/window.cpp @@ -230,7 +230,7 @@ static void ConvertFCM(HWND hwndOwner) memset(&ofn, 0, sizeof(ofn)); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = hwndOwner; - ofn.lpstrFilter = "FCEU <2.0 Movie Files (*.fcm)\0*.fcm\0All files(*.*)\0*.*\0\0"; + ofn.lpstrFilter = "FCEU <2.0 Movie Files (*.fcm)\0*.fcm\0All Files (*.*)\0*.*\0\0"; ofn.lpstrFile = new char[640*1024]; //640K should be enough for anyone ofn.lpstrFile[0] = 0; ofn.nMaxFile = 640*1024; @@ -1077,7 +1077,7 @@ bool ALoad(char *nameo, char* innerFilename) /// @param initialdir Directory that's pre-selected in the Open File dialog. void LoadNewGamey(HWND hParent, const char *initialdir) { - const char filter[] = "All usable files(*.nes,*.nsf,*.fds,*.unf,*.zip,*.rar,*.7z,*.gz)\0*.nes;*.nsf;*.fds;*.unf;*.zip;*.rar;*.7z;*.gz\0All non-compressed usable files(*.nes,*.nsf,*.fds,*.unf)\0*.nes;*.nsf;*.fds;*.unf\0All files (*.*)\0*.*\0\0"; + const char filter[] = "All usable files (*.nes,*.nsf,*.fds,*.unf,*.zip,*.rar,*.7z,*.gz)\0*.nes;*.nsf;*.fds;*.unf;*.zip;*.rar;*.7z;*.gz\0All non-compressed usable files (*.nes,*.nsf,*.fds,*.unf)\0*.nes;*.nsf;*.fds;*.unf\0All Files (*.*)\0*.*\0\0"; char nameo[2048]; // Create the Open File dialog diff --git a/src/movie.cpp b/src/movie.cpp index da178591..fc05ff7d 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -126,7 +126,7 @@ void MovieData::TryDumpIncremental() if(movieMode == MOVIEMODE_TASEDIT) { //only log the savestate if we are appending to the green zone - if (turbo && pauseframe!=-1 && currFrameCounter(currFrameCounter)currFrameCounter && ((currFrameCounter-pauseframe)&0xff)) return; @@ -144,7 +144,7 @@ void MovieData::TryDumpIncremental() } else if (currFrameCounter < currMovieData.greenZoneCount || !movie_readonly) { MovieData::dumpSavestateTo(&currMovieData.records[currFrameCounter].savestate,Z_DEFAULT_COMPRESSION); - } else if (currFrameCounter > currMovieData.greenZoneCount && currMovieData.greenZoneCount currMovieData.greenZoneCount && static_cast(currMovieData.greenZoneCount)