]> git.mxchange.org Git - flightgear.git/commitdiff
warning fixes
authortorsten <torsten>
Thu, 20 Aug 2009 22:06:38 +0000 (22:06 +0000)
committerTim Moore <timoore@redhat.com>
Sun, 23 Aug 2009 19:43:09 +0000 (21:43 +0200)
src/Input/FGEventInput.cxx
src/Input/FGEventInput.hxx
src/Input/FGJoystickInput.cxx
src/Input/FGLinuxEventInput.cxx

index 3acf7b93c0c870b2164e19c86033457beef84218..5731bc463968d8f09a8ca243cc5ebe51b33e1c8c 100644 (file)
@@ -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);
 
 }
 
index a3896e1d47a06497771dbe27b2c9fb6261160f29..09806976bcd8f489ce2060b9026c5b96b649fd72 100644 (file)
@@ -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;
index 75dc88700a1a2b93c6f4e4caf5b34dfa5d3c1434..5c3b82b2e13a01d6acb1d0f81fbe842ea47861bf 100644 (file)
@@ -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 );
 
index ec0f23da2c6b4843a751c80ddf09e48ac419e675..9d7b804ce243d880f55314d1fbe92769c4b3269f 100644 (file)
@@ -201,7 +201,7 @@ static struct EventTypes {
 class EventNameByType : public map<TypeCode,const char*> {
 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<const char *,TypeCode,ltstr> {
 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