Hi,

here are a few janitorial patches for the synaptics driver. The patches to 
the tools directory eliminate warnings flagged up by sparse. The patch to 
the driver code reduces the dependency on the mi code, which only needed to 
support an ancient XInput ABI version.

Regards,

Magnus Kessler

[sparse] Fix warnings about using plain integer as NULL pointer

Signed-off-by: Magnus Kessler <[EMAIL PROTECTED]>

diff --git a/tools/synclient.c b/tools/synclient.c
index f9e4330..2677d63 100644
--- a/tools/synclient.c
+++ b/tools/synclient.c
@@ -123,7 +123,7 @@ static struct Parameter params[] = {
     DEFINE_PAR("PressureMotionMinFactor", press_motion_min_factor, PT_DOUBLE, 0, 10.0),
     DEFINE_PAR("PressureMotionMaxFactor", press_motion_max_factor, PT_DOUBLE, 0, 10.0),
     DEFINE_PAR("GrabEventDevice",      grab_event_device,       PT_BOOL,   0, 1),
-    { 0, 0, 0, 0, 0 }
+    { NULL, 0, 0, 0, 0 }
 };
 
 static void
diff --git a/tools/syndaemon.c b/tools/syndaemon.c
index 8fd958b..7aa8238 100644
--- a/tools/syndaemon.c
+++ b/tools/syndaemon.c
@@ -113,7 +113,7 @@ install_signal_handler(void)
 #endif
 
     for (i = 0; i < sizeof(signals) / sizeof(int); i++) {
-	if (sigaction(signals[i], &act, 0) == -1) {
+	if (sigaction(signals[i], &act, NULL) == -1) {
 	    perror("sigaction");
 	    exit(2);
 	}
[sparse] Fix warnings about non-ANSI function declarations

Signed-off-by: Magnus Kessler <[EMAIL PROTECTED]>

diff --git a/tools/synclient.c b/tools/synclient.c
index 7977d89..f9e4330 100644
--- a/tools/synclient.c
+++ b/tools/synclient.c
@@ -240,7 +240,7 @@ is_equal(SynapticsSHM *s1, SynapticsSHM *s2)
 }
 
 static double
-get_time()
+get_time(void)
 {
     struct timeval tv;
     gettimeofday(&tv, NULL);
@@ -285,7 +285,7 @@ monitor(SynapticsSHM *synshm, int delay)
 }
 
 static void
-usage()
+usage(void)
 {
     fprintf(stderr, "Usage: synclient [-m interval] [-h] [-l] [-V] [-?] [var1=value1 [var2=value2] ...]\n");
     fprintf(stderr, "  -m monitor changes to the touchpad state.\n"
diff --git a/tools/syndaemon.c b/tools/syndaemon.c
index 9e3ad98..8fd958b 100644
--- a/tools/syndaemon.c
+++ b/tools/syndaemon.c
@@ -52,7 +52,7 @@ static const char *pid_file;
 static unsigned char keyboard_mask[KEYMAP_SIZE];
 
 static void
-usage()
+usage(void)
 {
     fprintf(stderr, "Usage: syndaemon [-i idle-time] [-m poll-delay] [-d] [-t] [-k]\n");
     fprintf(stderr, "  -i How many seconds to wait after the last key press before\n");
@@ -68,7 +68,7 @@ usage()
 }
 
 static int
-enable_touchpad()
+enable_touchpad(void)
 {
     int ret = 0;
     if (pad_disabled) {
@@ -89,7 +89,7 @@ signal_handler(int signum)
 }
 
 static void
-install_signal_handler()
+install_signal_handler(void)
 {
     static int signals[] = {
 	SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT,
@@ -156,7 +156,7 @@ keyboard_activity(Display *display)
  * Return non-zero if any physical touchpad button is currently pressed.
  */
 static int
-touchpad_buttons_active()
+touchpad_buttons_active(void)
 {
     int i;
 
@@ -171,7 +171,7 @@ touchpad_buttons_active()
 }
 
 static double
-get_time()
+get_time(void)
 {
     struct timeval tv;
     gettimeofday(&tv, NULL);
Only include mipointer.h if supporting ancient XInput ABI version

Signed-off-by: Magnus Kessler <[EMAIL PROTECTED]>

diff --git a/src/synaptics.c b/src/synaptics.c
index 4b3a022..50bb6de 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -66,9 +66,12 @@
 #include <stdio.h>
 #include <xf86_OSproc.h>
 #include <xf86Xinput.h>
-#include "mipointer.h"
 #include <exevents.h>
 
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
+#include "mipointer.h"
+#endif
+
 #include "synaptics.h"
 #include "synapticsstr.h"
 #include "synaptics-properties.h"

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Reply via email to