summaryrefslogtreecommitdiff
authorSascha Hlusiak <saschahlusiak@arcor.de>2012-09-25 08:57:46 (GMT)
committer Sascha Hlusiak <saschahlusiak@arcor.de>2012-09-25 08:57:46 (GMT)
commitacd398ac712689fb5239410d1da706752aa60a33 (patch) (side-by-side diff)
tree28a3f3f13cb5c15841c2e9744b7c6d69d9d0ec7f
parentbdf8fd3f650789d2012ec0cc915729dd1e91346d (diff)
downloadxf86-input-joystick-acd398ac712689fb5239410d1da706752aa60a33.zip
xf86-input-joystick-acd398ac712689fb5239410d1da706752aa60a33.tar.gz
silence compiler warnings
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/backend_evdev.c10
-rw-r--r--src/jstk.c4
-rw-r--r--src/jstk_properties.c6
3 files changed, 10 insertions, 10 deletions
diff --git a/src/backend_evdev.c b/src/backend_evdev.c
index c506167..d3c12c5 100644
--- a/src/backend_evdev.c
+++ b/src/backend_evdev.c
@@ -140,8 +140,8 @@ jstkOpenDevice_evdev(JoystickDevPtr joystick, Bool probe)
for (j = 0; j < ABS_MAX; j++)
if (test_bit(j, button_bits))
{
- struct input_absinfo abs;
- if (ioctl(joystick->fd, EVIOCGABS(j), &abs) == -1) {
+ struct input_absinfo absinfo;
+ if (ioctl(joystick->fd, EVIOCGABS(j), &absinfo) == -1) {
xf86Msg(X_ERROR, "Joystick: ioctl EVIOCGABS on '%s' failed: %s\n",
joystick->device, strerror(errno));
close(joystick->fd);
@@ -150,10 +150,10 @@ jstkOpenDevice_evdev(JoystickDevPtr joystick, Bool probe)
return -1;
}
evdevdata->axis[j].number = axes; /* physical -> logical mapping */
- evdevdata->axis[j].min = abs.minimum;
- evdevdata->axis[j].max = abs.maximum;
+ evdevdata->axis[j].min = absinfo.minimum;
+ evdevdata->axis[j].max = absinfo.maximum;
DBG(3, ErrorF("Axis %d: phys %d min %d max %d\n",
- axes, j, abs.minimum, abs.maximum));
+ axes, j, absinfo.minimum, absinfo.maximum));
axes++;
}
diff --git a/src/jstk.c b/src/jstk.c
index 772683f..b82481a 100644
--- a/src/jstk.c
+++ b/src/jstk.c
@@ -454,8 +454,8 @@ jstkCorePreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
char *s;
int i, j;
- s = xf86CheckStrOption(pInfo->options, "_source", "");
- if (strcmp(s, "_driver/joystick") == 0)
+ s = xf86CheckStrOption(pInfo->options, "_source", NULL);
+ if (s && strcmp(s, "_driver/joystick") == 0)
return jstkKeyboardPreInit(drv, pInfo, flags);
pInfo->device_control = jstkDeviceControlProc;
diff --git a/src/jstk_properties.c b/src/jstk_properties.c
index 413822d..3ff9e83 100644
--- a/src/jstk_properties.c
+++ b/src/jstk_properties.c
@@ -417,9 +417,9 @@ jstkInitProperties(DeviceIntPtr pJstk, JoystickDevPtr priv)
/* priv->button[].buttonnumber */
for (i=0;i<priv->num_buttons;i++) {
- int index = priv->button[i].buttonnumber;
- if (index>=0 && index<=MAXBUTTONS)
- button_values8[i] = (CARD8)index;
+ int idx = priv->button[i].buttonnumber;
+ if (idx>=0 && idx<=MAXBUTTONS)
+ button_values8[i] = (CARD8)idx;
else button_values8[i] = 0;
}
prop_button_buttonnumber = MakeAtom(JSTK_PROP_BUTTON_BUTTONNUMBER, strlen(JSTK_PROP_BUTTON_BUTTONNUMBER), TRUE);