1
0
Fork 0

warning fixes

This commit is contained in:
torsten 2009-08-20 22:06:38 +00:00 committed by Tim Moore
parent 4d977e9411
commit c672f2aba5
4 changed files with 10 additions and 11 deletions

View file

@ -152,8 +152,8 @@ void FGAxisEvent::fire( FGEventData & eventData )
FGButtonEvent::FGButtonEvent( FGInputDevice * device, SGPropertyNode_ptr node ) : FGButtonEvent::FGButtonEvent( FGInputDevice * device, SGPropertyNode_ptr node ) :
FGInputEvent( device, node ), FGInputEvent( device, node ),
lastState(false), repeatable(false),
repeatable(false) lastState(false)
{ {
repeatable = node->getBoolValue("repeatable", repeatable); repeatable = node->getBoolValue("repeatable", repeatable);
} }
@ -223,7 +223,7 @@ FGEventInput::~FGEventInput()
void FGEventInput::init( ) void FGEventInput::init( )
{ {
SG_LOG(SG_INPUT, SG_DEBUG, "Initializing event bindings"); SG_LOG(SG_INPUT, SG_DEBUG, "Initializing event bindings");
SGPropertyNode * base = fgGetNode("/input/event", true); // SGPropertyNode * base = fgGetNode("/input/event", true);
} }

View file

@ -33,7 +33,7 @@
* To be extended for O/S specific implementation data * To be extended for O/S specific implementation data
*/ */
struct FGEventData { struct FGEventData {
FGEventData( double aValue, double aDt, int aModifiers ) : value(aValue), dt(aDt), modifiers(aModifiers) {} FGEventData( double aValue, double aDt, int aModifiers ) : modifiers(aModifiers), value(aValue), dt(aDt) {}
int modifiers; int modifiers;
double value; double value;
double dt; double dt;

View file

@ -234,7 +234,7 @@ void FGJoystickInput::postinit()
continue; continue;
} }
sprintf(buf, "%d", n_but); sprintf(buf, "%u", (unsigned)n_but);
SG_LOG(SG_INPUT, SG_DEBUG, "Initializing button " << n_but); SG_LOG(SG_INPUT, SG_DEBUG, "Initializing button " << n_but);
bindings[i].buttons[n_but].init(button_node, buf, module ); bindings[i].buttons[n_but].init(button_node, buf, module );

View file

@ -201,7 +201,7 @@ static struct EventTypes {
class EventNameByType : public map<TypeCode,const char*> { class EventNameByType : public map<TypeCode,const char*> {
public: public:
EventNameByType() { EventNameByType() {
for( int i = 0; i < sizeof(EVENT_TYPES)/sizeof(EVENT_TYPES[0]); i++ ) for( unsigned i = 0; i < sizeof(EVENT_TYPES)/sizeof(EVENT_TYPES[0]); i++ )
(*this)[EVENT_TYPES[i].typeCode] = EVENT_TYPES[i].name; (*this)[EVENT_TYPES[i].typeCode] = EVENT_TYPES[i].name;
} }
}; };
@ -217,7 +217,7 @@ struct ltstr {
class EventTypeByName : public map<const char *,TypeCode,ltstr> { class EventTypeByName : public map<const char *,TypeCode,ltstr> {
public: public:
EventTypeByName() { EventTypeByName() {
for( int i = 0; i < sizeof(EVENT_TYPES)/sizeof(EVENT_TYPES[0]); i++ ) for( unsigned i = 0; i < sizeof(EVENT_TYPES)/sizeof(EVENT_TYPES[0]); i++ )
(*this)[EVENT_TYPES[i].name] = EVENT_TYPES[i].typeCode; (*this)[EVENT_TYPES[i].name] = EVENT_TYPES[i].typeCode;
} }
}; };
@ -226,9 +226,8 @@ static EventTypeByName EVENT_TYPE_BY_NAME;
FGLinuxInputDevice::FGLinuxInputDevice( string aName, string aDevname ) : FGLinuxInputDevice::FGLinuxInputDevice( string aName, string aDevname ) :
FGInputDevice(aName), FGInputDevice(aName),
fd(-1), devname( aDevname ),
devname( aDevname ) fd(-1)
{ {
} }
@ -415,7 +414,7 @@ void FGLinuxEventInput::update( double dt )
// do no more than maxpolls in a single loop to prevent locking // do no more than maxpolls in a single loop to prevent locking
int maxpolls = 100; int maxpolls = 100;
while( maxpolls-- > 0 && ::poll( fds, i, 0 ) > 0 ) { while( maxpolls-- > 0 && ::poll( fds, i, 0 ) > 0 ) {
for( int i = 0; i < sizeof(fds)/sizeof(fds[0]); i++ ) { for( unsigned i = 0; i < sizeof(fds)/sizeof(fds[0]); i++ ) {
if( fds[i].revents & POLLIN ) { if( fds[i].revents & POLLIN ) {
// if this device reports data ready, it should be a input_event struct // if this device reports data ready, it should be a input_event struct