FGButtonEvent::FGButtonEvent( FGInputDevice * device, SGPropertyNode_ptr node ) :
FGInputEvent( device, node ),
- lastState(false),
- repeatable(false)
+ repeatable(false),
+ lastState(false)
{
repeatable = node->getBoolValue("repeatable", repeatable);
}
void FGEventInput::init( )
{
SG_LOG(SG_INPUT, SG_DEBUG, "Initializing event bindings");
- SGPropertyNode * base = fgGetNode("/input/event", true);
+// SGPropertyNode * base = fgGetNode("/input/event", true);
}
* 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;
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 );
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;
}
};
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;
}
};
FGLinuxInputDevice::FGLinuxInputDevice( string aName, string aDevname ) :
FGInputDevice(aName),
- fd(-1),
- devname( aDevname )
-
+ devname( aDevname ),
+ fd(-1)
{
}
// 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