[PATCH 2/2] Janitor: compile warnings and "missing" symbols.
Paulo Cesar Pereira de Andrade
pcpa at mandriva.com.br
Thu Feb 5 10:13:13 PST 2009
The compile warnings are generated by both, gcc and sparse.
The "missing" symbols are just libm symbols that the driver will
"inherit" from the X Server.
Signed-off-by: Paulo Cesar Pereira de Andrade <pcpa at mandriva.com.br>
---
src/Makefile.am | 1 +
src/properties.c | 69 ++++++++++++++++++++++++++-------------------------
src/synaptics.c | 8 +-----
src/synapticsstr.h | 6 ++++
tools/synclient.c | 4 +-
tools/syndaemon.c | 6 ++--
6 files changed, 48 insertions(+), 46 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index d7eb08d..8c9ef37 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,6 +28,7 @@ AM_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS)
@DRIVER_NAME at _drv_la_LTLIBRARIES = @DRIVER_NAME at _drv.la
@DRIVER_NAME at _drv_la_LDFLAGS = -module -avoid-version
+ at DRIVER_NAME@_drv_la_LIBADD = -lm
@DRIVER_NAME at _drv_ladir = @inputdir@
INCLUDES=-I$(top_srcdir)/include/
diff --git a/src/properties.c b/src/properties.c
index 8b8334d..77919c9 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -44,40 +44,40 @@
#endif
static Atom float_type;
-Atom prop_edges = 0;
-Atom prop_finger = 0;
-Atom prop_tap_time = 0;
-Atom prop_tap_move = 0;
-Atom prop_tap_durations = 0;
-Atom prop_tap_fast = 0;
-Atom prop_middle_timeout = 0;
-Atom prop_twofinger_pressure = 0;
-Atom prop_scrolldist = 0;
-Atom prop_scrolledge = 0;
-Atom prop_scrolltwofinger = 0;
-Atom prop_speed = 0;
-Atom prop_edgemotion_pressure = 0;
-Atom prop_edgemotion_speed = 0;
-Atom prop_edgemotion_always = 0;
-Atom prop_buttonscroll = 0;
-Atom prop_buttonscroll_repeat = 0;
-Atom prop_buttonscroll_time = 0;
-Atom prop_off = 0;
-Atom prop_guestmouse = 0;
-Atom prop_lockdrags = 0;
-Atom prop_lockdrags_time = 0;
-Atom prop_tapaction = 0;
-Atom prop_clickaction = 0;
-Atom prop_circscroll = 0;
-Atom prop_circscroll_dist = 0;
-Atom prop_circscroll_trigger = 0;
-Atom prop_circpad = 0;
-Atom prop_palm = 0;
-Atom prop_palm_dim = 0;
-Atom prop_coastspeed = 0;
-Atom prop_pressuremotion = 0;
-Atom prop_pressuremotion_factor = 0;
-Atom prop_grab = 0;
+static Atom prop_edges = 0;
+static Atom prop_finger = 0;
+static Atom prop_tap_time = 0;
+static Atom prop_tap_move = 0;
+static Atom prop_tap_durations = 0;
+static Atom prop_tap_fast = 0;
+static Atom prop_middle_timeout = 0;
+static Atom prop_twofinger_pressure = 0;
+static Atom prop_scrolldist = 0;
+static Atom prop_scrolledge = 0;
+static Atom prop_scrolltwofinger = 0;
+static Atom prop_speed = 0;
+static Atom prop_edgemotion_pressure = 0;
+static Atom prop_edgemotion_speed = 0;
+static Atom prop_edgemotion_always = 0;
+static Atom prop_buttonscroll = 0;
+static Atom prop_buttonscroll_repeat = 0;
+static Atom prop_buttonscroll_time = 0;
+static Atom prop_off = 0;
+static Atom prop_guestmouse = 0;
+static Atom prop_lockdrags = 0;
+static Atom prop_lockdrags_time = 0;
+static Atom prop_tapaction = 0;
+static Atom prop_clickaction = 0;
+static Atom prop_circscroll = 0;
+static Atom prop_circscroll_dist = 0;
+static Atom prop_circscroll_trigger = 0;
+static Atom prop_circpad = 0;
+static Atom prop_palm = 0;
+static Atom prop_palm_dim = 0;
+static Atom prop_coastspeed = 0;
+static Atom prop_pressuremotion = 0;
+static Atom prop_pressuremotion_factor = 0;
+static Atom prop_grab = 0;
static Atom
InitAtom(DeviceIntPtr dev, char *name, int format, int nvalues, int *values)
@@ -105,6 +105,7 @@ InitAtom(DeviceIntPtr dev, char *name, int format, int nvalues, int *values)
case 8: converted = val_8; break;
case 16: converted = val_16; break;
case 32: converted = val_32; break;
+ default: return None;
}
atom = MakeAtom(name, strlen(name), TRUE);
diff --git a/src/synaptics.c b/src/synaptics.c
index 664d2fa..2dd9d81 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -124,12 +124,6 @@ static Bool DeviceClose(DeviceIntPtr);
static Bool QueryHardware(LocalDevicePtr);
static void ReadDevDimensions(LocalDevicePtr);
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
-void InitDeviceProperties(LocalDevicePtr local);
-int SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
- BOOL checkonly);
-#endif
-
InputDriverRec SYNAPTICS = {
1,
"synaptics",
@@ -544,7 +538,7 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
local->motion_history_proc = xf86GetMotionEvents;
local->history_size = 0;
#endif
- local->always_core_feedback = 0;
+ local->always_core_feedback = NULL;
xf86Msg(X_INFO, "Synaptics touchpad driver version %s\n", PACKAGE_VERSION);
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index 688167c..9921a08 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -148,4 +148,10 @@ typedef struct _SynapticsPrivateRec
Bool has_pressure; /* device reports pressure */
} SynapticsPrivate;
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
+extern void InitDeviceProperties(LocalDevicePtr local);
+extern int SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
+ BOOL checkonly);
+#endif
+
#endif /* _SYNAPTICSSTR_H_ */
diff --git a/tools/synclient.c b/tools/synclient.c
index 2677d63..c8c1aec 100644
--- a/tools/synclient.c
+++ b/tools/synclient.c
@@ -192,10 +192,10 @@ set_variables(SynapticsSHM *synshm, int argc, char *argv[], int first_cmd)
switch (par->type) {
case PT_INT:
- *(int*)((char*)synshm + par->offset) = (int)rint(val);
+ *(int*)((char*)synshm + par->offset) = rint(val);
break;
case PT_BOOL:
- *(Bool*)((char*)synshm + par->offset) = (Bool)rint(val);
+ *(Bool*)((char*)synshm + par->offset) = rint(val);
break;
case PT_DOUBLE:
*(double*)((char*)synshm + par->offset) = val;
diff --git a/tools/syndaemon.c b/tools/syndaemon.c
index 9acbbf8..0d5dd5d 100644
--- a/tools/syndaemon.c
+++ b/tools/syndaemon.c
@@ -264,7 +264,7 @@ struct xrecord_callback_results {
};
/* test if the xrecord extension is found */
-Bool check_xrecord(Display *display) {
+static Bool check_xrecord(Display *display) {
Bool found;
Status status;
@@ -285,7 +285,7 @@ Bool check_xrecord(Display *display) {
}
/* called by XRecordProcessReplies() */
-void xrecord_callback( XPointer closure, XRecordInterceptData* recorded_data) {
+static void xrecord_callback( XPointer closure, XRecordInterceptData* recorded_data) {
struct xrecord_callback_results *cbres;
xEvent *xev;
@@ -353,7 +353,7 @@ static int is_modifier_pressed(const struct xrecord_callback_results *cbres) {
return 0;
}
-void record_main_loop(Display* display, double idle_time) {
+static void record_main_loop(Display* display, double idle_time) {
struct xrecord_callback_results cbres;
XRecordContext context;
--
1.6.1
------=_20090205164843_96534--
More information about the xorg
mailing list