1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-26 02:00:37 +02:00

Fixed most warnings.

This commit is contained in:
Maarten ter Huurne 2010-06-19 03:15:20 +02:00
parent d8dd0904b8
commit 9f05aaf6b9
7 changed files with 24 additions and 18 deletions

View File

@ -47,7 +47,7 @@
#ifndef FASTDELEGATE_H #ifndef FASTDELEGATE_H
#define FASTDELEGATE_H #define FASTDELEGATE_H
#if _MSC_VER > 1000 #if defined(_MSC_VER) && _MSC_VER > 1000
#pragma once #pragma once
#endif // _MSC_VER > 1000 #endif // _MSC_VER > 1000
@ -80,7 +80,7 @@
#if defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__VECTOR_C) && !defined(__ICL) && !defined(__BORLANDC__) #if defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__VECTOR_C) && !defined(__ICL) && !defined(__BORLANDC__)
#define FASTDLGT_ISMSVC #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 #define FASTDLGT_VC6
#pragma warning(disable:4786) // disable this ridiculous warning #pragma warning(disable:4786) // disable this ridiculous warning
#endif #endif
@ -756,7 +756,7 @@ public:
// support static_cast between void * and function pointers. // support static_cast between void * and function pointers.
template< class DerivedClass > template< class DerivedClass >
inline void CopyFrom (DerivedClass *pParent, const DelegateMemento &right) { inline void CopyFrom (DerivedClass */*pParent*/, const DelegateMemento &right) {
SetMementoFrom(right); SetMementoFrom(right);
} }
// For static functions, the 'static_function_invoker' class in the parent // For static functions, the 'static_function_invoker' class in the parent

View File

@ -82,7 +82,7 @@ BrowseDialog::Action BrowseDialog::getAction()
return action; return action;
} }
bool BrowseDialog::handleInput() void BrowseDialog::handleInput()
{ {
BrowseDialog::Action action; BrowseDialog::Action action;
@ -196,6 +196,9 @@ void BrowseDialog::paint()
buttonBox.paint(5); 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) if (selected>firstElement+numRows-1)
firstElement = selected-numRows+1; firstElement = selected-numRows+1;
else if (selected < firstElement) else if (selected < firstElement)

View File

@ -83,7 +83,7 @@ private:
ButtonBox buttonBox; ButtonBox buttonBox;
Action getAction(); Action getAction();
bool handleInput(); void handleInput();
void paint(); void paint();

View File

@ -71,7 +71,7 @@ void pll_init(unsigned int clock)
}else }else
{ {
printf("sdram init fail!\n"); printf("sdram init fail!\n");
while(1); while(1) {}
} }
} }

View File

@ -79,13 +79,13 @@
using namespace std; using namespace std;
using namespace fastdelegate; using namespace fastdelegate;
int main(int argc, char *argv[]) { int main(int /*argc*/, char */*argv*/[]) {
cout << "----" << endl; 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 << "GMenu2X starting: If you read this message in the logs, check http://gmenu2x.sourceforge.net/page/Troubleshooting for a solution" << endl;
cout << "----" << endl; cout << "----" << endl;
signal(SIGINT,&exit); signal(SIGINT,&exit);
GMenu2X app(argc,argv); GMenu2X app();
return 0; return 0;
} }
@ -121,7 +121,7 @@ void GMenu2X::gp2x_deinit() {
if (acHandle) fclose(acHandle); if (acHandle) fclose(acHandle);
} }
void GMenu2X::gp2x_tvout_on(bool pal) { void GMenu2X::gp2x_tvout_on(bool /*pal*/) {
#ifdef TARGET_GP2X #ifdef TARGET_GP2X
/* if (gp2x_mem!=0) { /* if (gp2x_mem!=0) {
// Ioctl_Dummy_t *msg; // Ioctl_Dummy_t *msg;
@ -148,7 +148,7 @@ void GMenu2X::gp2x_tvout_off() {
#endif #endif
} }
GMenu2X::GMenu2X(int argc, char *argv[]) { GMenu2X::GMenu2X() {
//Detect firmware version and type //Detect firmware version and type
if (fileExists("/etc/open2x")) { if (fileExists("/etc/open2x")) {
fwType = "open2x"; fwType = "open2x";
@ -761,7 +761,7 @@ int GMenu2X::getBackLight()
if (backlightHandle) if (backlightHandle)
{ {
char valcstring[4]; char valcstring[4];
fscanf(backlightHandle,"%s",&valcstring); fscanf(backlightHandle, "%s", &valcstring[0]);
rewind(backlightHandle); rewind(backlightHandle);
val = atoi(valcstring); val = atoi(valcstring);
} }
@ -1434,7 +1434,7 @@ void GMenu2X::editLink() {
int linkClock = menu->selLinkApp()->clock(); int linkClock = menu->selLinkApp()->clock();
int linkVolume = menu->selLinkApp()->volume(); int linkVolume = menu->selLinkApp()->volume();
//G //G
int linkGamma = menu->selLinkApp()->gamma(); //int linkGamma = menu->selLinkApp()->gamma();
int linkBacklight = menu->selLinkApp()->backlight(); int linkBacklight = menu->selLinkApp()->backlight();
string diagTitle = tr.translate("Edit link: $1",linkTitle.c_str(),NULL); string diagTitle = tr.translate("Edit link: $1",linkTitle.c_str(),NULL);
@ -1739,7 +1739,7 @@ unsigned short GMenu2X::getBatteryLevel() {
if (!batteryHandle) return 0; if (!batteryHandle) return 0;
int battval = 0; int battval = 0;
char battvalcstr[5]; char battvalcstr[5];
fscanf(batteryHandle,"%s",&battvalcstr); fscanf(batteryHandle, "%s", &battvalcstr[0]);
rewind(batteryHandle); rewind(batteryHandle);
battval = atoi(battvalcstr); battval = atoi(battvalcstr);
if (battval>90) return 5; if (battval>90) return 5;
@ -1751,7 +1751,7 @@ unsigned short GMenu2X::getBatteryLevel() {
if (!usbHandle) return 0; if (!usbHandle) return 0;
int usbval = 0; int usbval = 0;
char usbvalcstr[5]; char usbvalcstr[5];
fscanf(usbHandle,"%s",&usbvalcstr); fscanf(usbHandle, "%s", &usbvalcstr[0]);
rewind(usbHandle); rewind(usbHandle);
usbval = atoi(usbvalcstr); usbval = atoi(usbvalcstr);
if (usbval==1) return 6; if (usbval==1) return 6;
@ -1820,7 +1820,7 @@ void GMenu2X::setClock(unsigned mhz) {
#endif #endif
} }
void GMenu2X::setGamma(int gamma) { void GMenu2X::setGamma(int /*gamma*/) {
#ifdef TARGET_GP2X #ifdef TARGET_GP2X
/* float fgamma = (float)constrain(gamma,1,100)/10; /* float fgamma = (float)constrain(gamma,1,100)/10;
fgamma = 1 / fgamma; fgamma = 1 / fgamma;

View File

@ -143,7 +143,7 @@ private:
const string &colorToString(enum color); const string &colorToString(enum color);
public: public:
GMenu2X(int argc, char *argv[]); GMenu2X();
~GMenu2X(); ~GMenu2X();
void quit(); void quit();

View File

@ -20,8 +20,11 @@
#include "menusetting.h" #include "menusetting.h"
MenuSetting::MenuSetting(GMenu2X *gmenu2x, const string &name, MenuSetting::MenuSetting(GMenu2X *gmenu2x, const string &name,
const string &description) : gmenu2x(gmenu2x), name(name), const string &description)
description(description), buttonBox(gmenu2x) : gmenu2x(gmenu2x)
, buttonBox(gmenu2x)
, name(name)
, description(description)
{ {
} }