diff --git a/flips-w32.cpp b/flips-w32.cpp index 0944e19..5161c64 100644 --- a/flips-w32.cpp +++ b/flips-w32.cpp @@ -918,7 +918,7 @@ void GUILoadConfig() configbin.len -= size readconfig(&state, sizeof(state)); - if (strncmp(state.signature, "FlipscfgW", sizeof(state.signature)) || state.cfgversion!=mycfgversion) goto badconfig; + if (memcmp(state.signature, "FlipscfgW", sizeof(state.signature))!=0 || state.cfgversion!=mycfgversion) goto badconfig; int emulen; readconfig(&emulen, sizeof(emulen)); set_st_emulator_len(NULL, emulen); @@ -928,7 +928,7 @@ void GUILoadConfig() else { badconfig: - strncpy(state.signature, "FlipscfgW", sizeof(state.signature)); + memcpy(state.signature, "FlipscfgW", sizeof(state.signature)); state.cfgversion=mycfgversion; state.lastRomType=0; state.openInEmulatorOnAssoc=false; diff --git a/flips.cpp b/flips.cpp index 7078990..eb7d79c 100644 --- a/flips.cpp +++ b/flips.cpp @@ -555,7 +555,7 @@ static void CfgSumName(WCHAR* out, int type, const void* sum) } static bool CfgSumParseName(int* type, void* sum, LPCWSTR in) { - if (!!wcsncmp(in, TEXT("rom."), strlen("rom."))) + if (wcsncmp(in, TEXT("rom."), strlen("rom.")) != 0) return false; uint8_t* out = (uint8_t*)sum; for (int t=0;t profile/choice; break;; @@ -56,54 +64,16 @@ if [ -e profile/firefox-10.0esr.tar ]; then profile/download.sh || exit $? fi -#clean up rm flips flips.exe floating.zip obj/* -##create windows binary -#echo 'Windows/Resource (Wine warmup)' -#mingwver 5.3 -#wine windres flips.rc rc.o -# -#echo 'Windows (1/3)' -#rm flips.exe; wine mingw32-make TARGET=windows OPTFLAGS="$FLAGS -fprofile-generate -lgcov" -#[ -e flips.exe ] || exit -#echo 'Windows (2/3)' -#profile/profile.sh 'wine flips.exe' -#echo 'Windows (3/3)' -#rm flips.exe; wine mingw32-make TARGET=windows OPTFLAGS="$FLAGS -fprofile-use" -# -##verify there are no unexpected dependencies -#objdump -p flips.exe | grep 'DLL Name' | \ -# grep -Pvi '(msvcrt|advapi32|comctl32|comdlg32|gdi32|kernel32|shell32|user32)' && \ -# echo "Invalid dependency" && exit -# -##test cli binaries -#echo CLI -#rm flips; make TARGET=cli DIVSUF=no -#[ -e flips ] || exit - -#create linux binary if [ -e profile/firefox-10.0esr.tar ]; then echo 'GTK+ (1/3)' -rm flips; TARGET=gtk make OPTFLAGS="$FLAGS -fprofile-generate -lgcov" || exit $? +rm obj/* flips; TARGET=gtk make OPTFLAGS="$FLAGS$LINFLAGS -fprofile-generate -lgcov" || exit $? [ -e flips ] || exit 1 echo 'GTK+ (2/3)' profile/profile.sh ./flips echo 'GTK+ (3/3)' -rm flips; TARGET=gtk make OPTFLAGS="$FLAGS -fprofile-use" -#mv flips '~/bin/flips' +rm flips; TARGET=gtk make OPTFLAGS="$FLAGS$LINFLAGS -fprofile-use" else -rm flips; TARGET=gtk make OPTFLAGS="$FLAGS" || exit $? +rm flips; TARGET=gtk make OPTFLAGS="$FLAGS$LINFLAGS" || exit $? fi - -#echo Finishing -##compress source -#7z a floating.zip flips.exe -#zipcrush floating.zip -#echo Size: $(stat -c%s flips.exe)/96768 -#echo \(Linux: $(stat -c%s ~/bin/flips)\) -#echo \(Zipped: $(stat -c%s floating.zip)/59881\) -# -#./special.sh -# -#rm src.zip boring.zip