[PATCH:xf86-input-acecad 1/6] Avoid “'ReverseConvertProc' defined but not used” warning.

Cyril Brulebois kibi at debian.org
Wed May 4 17:04:07 PDT 2011


Move this function next to its unique caller (AceCadPreInit), and only
declare/define it when the input ABI is strictly less than 12.

Signed-off-by: Cyril Brulebois <kibi at debian.org>
---
 src/acecad.c |   31 +++++++++++++++----------------
 src/acecad.h |    2 +-
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/src/acecad.c b/src/acecad.c
index 6259f21..f5a2213 100644
--- a/src/acecad.c
+++ b/src/acecad.c
@@ -370,6 +370,21 @@ SetupProc_fail:
     return NULL;
 }
 
+static Bool
+ReverseConvertProc (InputInfoPtr local,
+        int x, int  y,
+        int *valuators)
+{
+    AceCadPrivatePtr priv = (AceCadPrivatePtr)(local->private);
+
+    // xf86Msg(X_INFO, "%s: reverse coordinate conversion in : %d, %d\n", local->name, x, y);
+    valuators[0] = x * priv->acecadMaxX / screenInfo.screens[0]->width;
+    valuators[1] = y * priv->acecadMaxY / screenInfo.screens[0]->height;
+    // xf86Msg(X_INFO, "%s: reverse coordinate conversion out: %d, %d\n", local->name, valuators[0], valuators[1]);
+
+    return TRUE;
+}
+
 static int
 NewAceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags)
 #else
@@ -1071,22 +1086,6 @@ ConvertProc (InputInfoPtr local, int first, int num,
 }
 
 
-static Bool
-ReverseConvertProc (InputInfoPtr local,
-        int x, int  y,
-        int *valuators)
-{
-    AceCadPrivatePtr priv = (AceCadPrivatePtr)(local->private);
-
-    // xf86Msg(X_INFO, "%s: reverse coordinate conversion in : %d, %d\n", local->name, x, y);
-    valuators[0] = x * priv->acecadMaxX / screenInfo.screens[0]->width;
-    valuators[1] = y * priv->acecadMaxY / screenInfo.screens[0]->height;
-    // xf86Msg(X_INFO, "%s: reverse coordinate conversion out: %d, %d\n", local->name, valuators[0], valuators[1]);
-
-    return TRUE;
-}
-
-
 #define WriteString(str)\
     XisbWrite (priv->buffer, (unsigned char *)(str), strlen(str))
 
diff --git a/src/acecad.h b/src/acecad.h
index a2b5c66..bd8e997 100644
--- a/src/acecad.h
+++ b/src/acecad.h
@@ -102,12 +102,12 @@ static Bool DeviceClose (DeviceIntPtr);
 static Bool DeviceInit (DeviceIntPtr);
 static void ReadInput (InputInfoPtr);
 static Bool ConvertProc (InputInfoPtr, int, int, int, int, int, int, int, int, int *, int *);
-static Bool ReverseConvertProc(InputInfoPtr , int , int , int*);
 static Bool QueryHardware (AceCadPrivatePtr);
 static void NewPacket (AceCadPrivatePtr priv);
 static Bool AceCadGetPacket (AceCadPrivatePtr);
 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
 static InputInfoPtr AceCadPreInit(InputDriverPtr, IDevPtr , int);
+static Bool ReverseConvertProc(InputInfoPtr , int , int , int*);
 #else
 static int AceCadPreInit(InputDriverPtr, InputInfoPtr , int);
 #endif
-- 
1.7.4.4



More information about the xorg-devel mailing list