diff --git a/src/FastDelegate.h b/src/FastDelegate.h index a0a3150..9b13f7d 100644 --- a/src/FastDelegate.h +++ b/src/FastDelegate.h @@ -47,7 +47,7 @@ #ifndef FASTDELEGATE_H #define FASTDELEGATE_H -#if _MSC_VER > 1000 +#if defined(_MSC_VER) && _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 @@ -80,7 +80,7 @@ #if defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__VECTOR_C) && !defined(__ICL) && !defined(__BORLANDC__) #define FASTDLGT_ISMSVC -#if (_MSC_VER <1300) // Many workarounds are required for VC6. +#if defined(_MSC_VER) && _MSC_VER < 1300 // Many workarounds are required for VC6. #define FASTDLGT_VC6 #pragma warning(disable:4786) // disable this ridiculous warning #endif @@ -756,7 +756,7 @@ public: // support static_cast between void * and function pointers. template< class DerivedClass > - inline void CopyFrom (DerivedClass *pParent, const DelegateMemento &right) { + inline void CopyFrom (DerivedClass */*pParent*/, const DelegateMemento &right) { SetMementoFrom(right); } // For static functions, the 'static_function_invoker' class in the parent diff --git a/src/browsedialog.cpp b/src/browsedialog.cpp index 56e4b0e..4f24b70 100644 --- a/src/browsedialog.cpp +++ b/src/browsedialog.cpp @@ -82,7 +82,7 @@ BrowseDialog::Action BrowseDialog::getAction() return action; } -bool BrowseDialog::handleInput() +void BrowseDialog::handleInput() { BrowseDialog::Action action; @@ -196,6 +196,9 @@ void BrowseDialog::paint() buttonBox.paint(5); + // TODO(MtH): I have no idea what the right value of firstElement would be, + // but originally it was undefined and that is never a good idea. + firstElement = 0; if (selected>firstElement+numRows-1) firstElement = selected-numRows+1; else if (selected < firstElement) diff --git a/src/browsedialog.h b/src/browsedialog.h index f82cfc7..2a6a357 100644 --- a/src/browsedialog.h +++ b/src/browsedialog.h @@ -83,7 +83,7 @@ private: ButtonBox buttonBox; Action getAction(); - bool handleInput(); + void handleInput(); void paint(); diff --git a/src/cpu.cpp b/src/cpu.cpp index 5b30ae6..0d63d3e 100644 --- a/src/cpu.cpp +++ b/src/cpu.cpp @@ -71,7 +71,7 @@ void pll_init(unsigned int clock) }else { printf("sdram init fail!\n"); - while(1); + while(1) {} } } diff --git a/src/gmenu2x.cpp b/src/gmenu2x.cpp index 194b741..8d75a18 100644 --- a/src/gmenu2x.cpp +++ b/src/gmenu2x.cpp @@ -79,13 +79,13 @@ using namespace std; using namespace fastdelegate; -int main(int argc, char *argv[]) { +int main(int /*argc*/, char */*argv*/[]) { cout << "----" << endl; cout << "GMenu2X starting: If you read this message in the logs, check http://gmenu2x.sourceforge.net/page/Troubleshooting for a solution" << endl; cout << "----" << endl; signal(SIGINT,&exit); - GMenu2X app(argc,argv); + GMenu2X app(); return 0; } @@ -121,7 +121,7 @@ void GMenu2X::gp2x_deinit() { if (acHandle) fclose(acHandle); } -void GMenu2X::gp2x_tvout_on(bool pal) { +void GMenu2X::gp2x_tvout_on(bool /*pal*/) { #ifdef TARGET_GP2X /* if (gp2x_mem!=0) { // Ioctl_Dummy_t *msg; @@ -148,7 +148,7 @@ void GMenu2X::gp2x_tvout_off() { #endif } -GMenu2X::GMenu2X(int argc, char *argv[]) { +GMenu2X::GMenu2X() { //Detect firmware version and type if (fileExists("/etc/open2x")) { fwType = "open2x"; @@ -761,7 +761,7 @@ int GMenu2X::getBackLight() if (backlightHandle) { char valcstring[4]; - fscanf(backlightHandle,"%s",&valcstring); + fscanf(backlightHandle, "%s", &valcstring[0]); rewind(backlightHandle); val = atoi(valcstring); } @@ -1434,7 +1434,7 @@ void GMenu2X::editLink() { int linkClock = menu->selLinkApp()->clock(); int linkVolume = menu->selLinkApp()->volume(); //G - int linkGamma = menu->selLinkApp()->gamma(); + //int linkGamma = menu->selLinkApp()->gamma(); int linkBacklight = menu->selLinkApp()->backlight(); string diagTitle = tr.translate("Edit link: $1",linkTitle.c_str(),NULL); @@ -1739,7 +1739,7 @@ unsigned short GMenu2X::getBatteryLevel() { if (!batteryHandle) return 0; int battval = 0; char battvalcstr[5]; - fscanf(batteryHandle,"%s",&battvalcstr); + fscanf(batteryHandle, "%s", &battvalcstr[0]); rewind(batteryHandle); battval = atoi(battvalcstr); if (battval>90) return 5; @@ -1751,7 +1751,7 @@ unsigned short GMenu2X::getBatteryLevel() { if (!usbHandle) return 0; int usbval = 0; char usbvalcstr[5]; - fscanf(usbHandle,"%s",&usbvalcstr); + fscanf(usbHandle, "%s", &usbvalcstr[0]); rewind(usbHandle); usbval = atoi(usbvalcstr); if (usbval==1) return 6; @@ -1820,7 +1820,7 @@ void GMenu2X::setClock(unsigned mhz) { #endif } -void GMenu2X::setGamma(int gamma) { +void GMenu2X::setGamma(int /*gamma*/) { #ifdef TARGET_GP2X /* float fgamma = (float)constrain(gamma,1,100)/10; fgamma = 1 / fgamma; diff --git a/src/gmenu2x.h b/src/gmenu2x.h index 94c6282..343d905 100644 --- a/src/gmenu2x.h +++ b/src/gmenu2x.h @@ -143,7 +143,7 @@ private: const string &colorToString(enum color); public: - GMenu2X(int argc, char *argv[]); + GMenu2X(); ~GMenu2X(); void quit(); diff --git a/src/menusetting.cpp b/src/menusetting.cpp index 93a282f..4d589f4 100644 --- a/src/menusetting.cpp +++ b/src/menusetting.cpp @@ -20,8 +20,11 @@ #include "menusetting.h" MenuSetting::MenuSetting(GMenu2X *gmenu2x, const string &name, - const string &description) : gmenu2x(gmenu2x), name(name), - description(description), buttonBox(gmenu2x) + const string &description) + : gmenu2x(gmenu2x) + , buttonBox(gmenu2x) + , name(name) + , description(description) { }