[PATCH synaptics] Don't use libcwrappers for calloc and free.

Peter Hutterer peter.hutterer at who-t.net
Mon May 24 14:38:39 PDT 2010


The server has deprecated them now, so we get a lot of warnings for little
benefit.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/eventcomm.c |    2 +-
 src/ps2comm.c   |    2 +-
 src/synaptics.c |   24 ++++++++++++------------
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/eventcomm.c b/src/eventcomm.c
index 9f37673..6c85cc4 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -62,7 +62,7 @@ EventDeviceOnHook(LocalDevicePtr local, SynapticsParameters *para)
     BOOL *need_grab;
 
     if (!priv->proto_data)
-        priv->proto_data = xcalloc(1, sizeof(BOOL));
+        priv->proto_data = calloc(1, sizeof(BOOL));
 
     need_grab = (BOOL*)priv->proto_data;
 
diff --git a/src/ps2comm.c b/src/ps2comm.c
index ae2592f..241f6a6 100644
--- a/src/ps2comm.c
+++ b/src/ps2comm.c
@@ -460,7 +460,7 @@ PS2QueryHardware(LocalDevicePtr local)
     struct SynapticsHwInfo *synhw;
 
     if (!priv->proto_data)
-        priv->proto_data = xcalloc(1, sizeof(struct SynapticsHwInfo));
+        priv->proto_data = calloc(1, sizeof(struct SynapticsHwInfo));
     synhw = (struct SynapticsHwInfo*)priv->proto_data;
 
     /* is the synaptics touchpad active? */
diff --git a/src/synaptics.c b/src/synaptics.c
index c425ec8..589d04a 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -265,7 +265,7 @@ alloc_param_data(LocalDevicePtr local)
 	    return FALSE;
 	}
     } else {
-	priv->synshm = xcalloc(1, sizeof(SynapticsSHM));
+	priv->synshm = calloc(1, sizeof(SynapticsSHM));
 	if (!priv->synshm)
 	    return FALSE;
     }
@@ -288,7 +288,7 @@ free_param_data(SynapticsPrivate *priv)
 	if ((shmid = shmget(SHM_SYNAPTICS, 0, 0)) != -1)
 	    shmctl(shmid, IPC_RMID, NULL);
     } else {
-	xfree(priv->synshm);
+	free(priv->synshm);
     }
 
     priv->synshm = NULL;
@@ -556,22 +556,22 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
     SynapticsPrivate *priv;
 
     /* allocate memory for SynapticsPrivateRec */
-    priv = xcalloc(1, sizeof(SynapticsPrivate));
+    priv = calloc(1, sizeof(SynapticsPrivate));
     if (!priv)
 	return NULL;
 
     /* allocate now so we don't allocate in the signal handler */
     priv->timer = TimerSet(NULL, 0, 0, NULL, NULL);
     if (!priv->timer) {
-	xfree(priv);
+	free(priv);
 	return NULL;
     }
 
     /* Allocate a new InputInfoRec and add it to the head xf86InputDevs. */
     local = xf86AllocateInput(drv, 0);
     if (!local) {
-	xfree(priv->timer);
-	xfree(priv);
+	free(priv->timer);
+	free(priv);
 	return NULL;
     }
 
@@ -669,9 +669,9 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
     if (priv->comm.buffer)
 	XisbFree(priv->comm.buffer);
     free_param_data(priv);
-    xfree(priv->proto_data);
-    xfree(priv->timer);
-    xfree(priv);
+    free(priv->proto_data);
+    free(priv->timer);
+    free(priv);
     local->private = NULL;
     return local;
 }
@@ -686,10 +686,10 @@ static void SynapticsUnInit(InputDriverPtr drv,
 {
     SynapticsPrivate *priv = ((SynapticsPrivate *)local->private);
     if (priv && priv->timer)
-        xfree(priv->timer);
+        free(priv->timer);
     if (priv && priv->proto_data)
-        xfree(priv->proto_data);
-    xfree(local->private);
+        free(priv->proto_data);
+    free(local->private);
     local->private = NULL;
     xf86DeleteInput(local, 0);
 }
-- 
1.7.0.1



More information about the xorg-devel mailing list