From: torsten Date: Thu, 20 Aug 2009 22:06:38 +0000 (+0000) Subject: warning fixes X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c672f2aba559fd36469b6f9f9c4b81c45837aa99;p=flightgear.git warning fixes --- diff --git a/src/Input/FGEventInput.cxx b/src/Input/FGEventInput.cxx index 3acf7b93c..5731bc463 100644 --- a/src/Input/FGEventInput.cxx +++ b/src/Input/FGEventInput.cxx @@ -152,8 +152,8 @@ void FGAxisEvent::fire( FGEventData & eventData ) FGButtonEvent::FGButtonEvent( FGInputDevice * device, SGPropertyNode_ptr node ) : FGInputEvent( device, node ), - lastState(false), - repeatable(false) + repeatable(false), + lastState(false) { repeatable = node->getBoolValue("repeatable", repeatable); } @@ -223,7 +223,7 @@ FGEventInput::~FGEventInput() void FGEventInput::init( ) { SG_LOG(SG_INPUT, SG_DEBUG, "Initializing event bindings"); - SGPropertyNode * base = fgGetNode("/input/event", true); +// SGPropertyNode * base = fgGetNode("/input/event", true); } diff --git a/src/Input/FGEventInput.hxx b/src/Input/FGEventInput.hxx index a3896e1d4..09806976b 100644 --- a/src/Input/FGEventInput.hxx +++ b/src/Input/FGEventInput.hxx @@ -33,7 +33,7 @@ * To be extended for O/S specific implementation data */ 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; double value; double dt; diff --git a/src/Input/FGJoystickInput.cxx b/src/Input/FGJoystickInput.cxx index 75dc88700..5c3b82b2e 100644 --- a/src/Input/FGJoystickInput.cxx +++ b/src/Input/FGJoystickInput.cxx @@ -234,7 +234,7 @@ void FGJoystickInput::postinit() continue; } - sprintf(buf, "%d", n_but); + sprintf(buf, "%u", (unsigned)n_but); SG_LOG(SG_INPUT, SG_DEBUG, "Initializing button " << n_but); bindings[i].buttons[n_but].init(button_node, buf, module ); diff --git a/src/Input/FGLinuxEventInput.cxx b/src/Input/FGLinuxEventInput.cxx index ec0f23da2..9d7b804ce 100644 --- a/src/Input/FGLinuxEventInput.cxx +++ b/src/Input/FGLinuxEventInput.cxx @@ -201,7 +201,7 @@ static struct EventTypes { class EventNameByType : public map { public: 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; } }; @@ -217,7 +217,7 @@ struct ltstr { class EventTypeByName : public map { public: 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; } }; @@ -226,9 +226,8 @@ static EventTypeByName EVENT_TYPE_BY_NAME; FGLinuxInputDevice::FGLinuxInputDevice( string aName, string aDevname ) : 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 int maxpolls = 100; 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 this device reports data ready, it should be a input_event struct