summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-10-25 10:45:27 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2010-10-25 11:41:44 +1000
commitabc107eeb8847b9bf2f303abefde5adaab9331bf (patch)
tree50f50a42951054a3d7f2793c57fdb77004357af8
parent782052d087fd59d673de6c45784c316c055a592d (diff)
Replace libc wrappers to xcalloc and friends with libc calls.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Tested-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/bsd_mouse.c22
-rw-r--r--src/hurd_mouse.c4
-rw-r--r--src/lnx_mouse.c8
-rw-r--r--src/mouse.c40
-rw-r--r--src/sun_mouse.c20
5 files changed, 47 insertions, 47 deletions
diff --git a/src/bsd_mouse.c b/src/bsd_mouse.c
index 83054eb..a519cdb 100644
--- a/src/bsd_mouse.c
+++ b/src/bsd_mouse.c
@@ -468,7 +468,7 @@ wsconsPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
else {
xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
- xfree(pMse);
+ free(pMse);
pInfo->private = NULL;
return FALSE;
}
@@ -545,7 +545,7 @@ usbMouseProc(DeviceIntPtr pPointer, int what)
else {
pMse->buffer = XisbNew(pInfo->fd, pUsbMse->packetSize);
if (!pMse->buffer) {
- xfree(pMse);
+ free(pMse);
xf86CloseSerial(pInfo->fd);
pInfo->fd = -1;
} else {
@@ -566,7 +566,7 @@ usbMouseProc(DeviceIntPtr pPointer, int what)
if (pInfo->fd != -1) {
RemoveEnabledDevice(pInfo->fd);
if (pUsbMse->packetSize > 8 && pUsbMse->buffer) {
- xfree(pUsbMse->buffer);
+ free(pUsbMse->buffer);
}
if (pMse->buffer) {
XisbFree(pMse->buffer);
@@ -642,10 +642,10 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
report_desc_t reportDesc;
int i;
- pUsbMse = xalloc(sizeof(UsbMseRec));
+ pUsbMse = malloc(sizeof(UsbMseRec));
if (pUsbMse == NULL) {
xf86Msg(X_ERROR, "%s: cannot allocate UsbMouseRec\n", pInfo->name);
- xfree(pMse);
+ free(pMse);
return FALSE;
}
@@ -663,8 +663,8 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
else {
xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
- xfree(pUsbMse);
- xfree(pMse);
+ free(pUsbMse);
+ free(pMse);
return FALSE;
}
}
@@ -687,12 +687,12 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
if (pUsbMse->packetSize <= 8) {
pUsbMse->buffer = pMse->protoBuf;
} else {
- pUsbMse->buffer = xalloc(pUsbMse->packetSize);
+ pUsbMse->buffer = malloc(pUsbMse->packetSize);
}
if (pUsbMse->buffer == NULL) {
xf86Msg(X_ERROR, "%s: cannot allocate buffer\n", pInfo->name);
- xfree(pUsbMse);
- xfree(pMse);
+ free(pUsbMse);
+ free(pMse);
xf86CloseSerial(pInfo->fd);
return FALSE;
}
@@ -773,7 +773,7 @@ xf86OSMouseInit(int flags)
{
OSMouseInfoPtr p;
- p = xcalloc(sizeof(OSMouseInfoRec), 1);
+ p = calloc(sizeof(OSMouseInfoRec), 1);
if (!p)
return NULL;
p->SupportedInterfaces = SupportedInterfaces;
diff --git a/src/hurd_mouse.c b/src/hurd_mouse.c
index 10b14e3..2d6970f 100644
--- a/src/hurd_mouse.c
+++ b/src/hurd_mouse.c
@@ -154,7 +154,7 @@ OsMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags)
xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
else {
xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
- xfree(pMse);
+ free(pMse);
return FALSE;
}
}
@@ -231,7 +231,7 @@ xf86OSMouseInit(int flags)
{
OSMouseInfoPtr p;
- p = xcalloc(sizeof(OSMouseInfoRec), 1);
+ p = calloc(sizeof(OSMouseInfoRec), 1);
if (!p)
return NULL;
p->SupportedInterfaces = SupportedInterfaces;
diff --git a/src/lnx_mouse.c b/src/lnx_mouse.c
index 2f74ddb..099e2a7 100644
--- a/src/lnx_mouse.c
+++ b/src/lnx_mouse.c
@@ -122,7 +122,7 @@ lnxMouseMagic(InputInfoPtr pInfo)
#ifdef DEBUG
ErrorF("readlink failed for %s (%s)\n", dev, strerror(errno));
#endif
- xfree(realdev);
+ free(realdev);
return NULL;
}
realdev[i] = '\0';
@@ -135,7 +135,7 @@ lnxMouseMagic(InputInfoPtr pInfo)
if (!strchr(realdev, '/')) {
char *tmp = xnfalloc(strlen(realdev) + 5 + 1);
sprintf(tmp, "/dev/%s", realdev);
- xfree(realdev);
+ free(realdev);
realdev = tmp;
}
}
@@ -148,7 +148,7 @@ lnxMouseMagic(InputInfoPtr pInfo)
proto = MOUSE_PROTO_MSC;
else if (strcmp(realdev, DEFAULT_GPM_CTL_DEV) == 0)
proto = MOUSE_PROTO_GPM;
- xfree(realdev);
+ free(realdev);
/*
* If the protocol can't be guessed from the device name,
* try to characterise it.
@@ -209,7 +209,7 @@ xf86OSMouseInit(int flags)
{
OSMouseInfoPtr p;
- p = xcalloc(sizeof(OSMouseInfoRec), 1);
+ p = calloc(sizeof(OSMouseInfoRec), 1);
if (!p)
return NULL;
p->SupportedInterfaces = SupportedInterfaces;
diff --git a/src/mouse.c b/src/mouse.c
index a296021..c7f28c7 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -337,7 +337,7 @@ MouseCommonOptions(InputInfoPtr pInfo)
if (pMse->pDragLock)
- xfree(pMse->pDragLock);
+ free(pMse->pDragLock);
pMse->pDragLock = NULL;
s = xf86SetStrOption(pInfo->options, "DragLockButtons", NULL);
@@ -350,7 +350,7 @@ MouseCommonOptions(InputInfoPtr pInfo)
char *s1; /* parse input string */
DragLockPtr pLock;
- pLock = pMse->pDragLock = xcalloc(1, sizeof(DragLockRec));
+ pLock = pMse->pDragLock = calloc(1, sizeof(DragLockRec));
/* init code */
/* initial string to be taken apart */
@@ -441,7 +441,7 @@ MouseCommonOptions(InputInfoPtr pInfo)
}
}
}
- xfree(s);
+ free(s);
}
s = xf86SetStrOption(pInfo->options, "ZAxisMapping", "4 5");
@@ -468,7 +468,7 @@ MouseCommonOptions(InputInfoPtr pInfo)
if (b3 > 0 && b3 <= MSE_MAXBUTTONS &&
b4 > 0 && b4 <= MSE_MAXBUTTONS) {
if (msg)
- xfree(msg);
+ free(msg);
msg = xstrdup("buttons XX, YY, ZZ and WW");
if (msg)
sprintf(msg, "buttons %d, %d, %d and %d", b1, b2, b3, b4);
@@ -482,12 +482,12 @@ MouseCommonOptions(InputInfoPtr pInfo)
}
if (msg) {
xf86Msg(X_CONFIG, "%s: ZAxisMapping: %s\n", pInfo->name, msg);
- xfree(msg);
+ free(msg);
} else {
xf86Msg(X_WARNING, "%s: Invalid ZAxisMapping value: \"%s\"\n",
pInfo->name, s);
}
- xfree(s);
+ free(s);
}
if (xf86SetBoolOption(pInfo->options, "EmulateWheel", FALSE)) {
Bool yFromConfig = FALSE;
@@ -541,9 +541,9 @@ MouseCommonOptions(InputInfoPtr pInfo)
}
if (msg) {
xf86Msg(X_CONFIG, "%s: XAxisMapping: %s\n", pInfo->name, msg);
- xfree(msg);
+ free(msg);
}
- xfree(s);
+ free(s);
}
s = xf86SetStrOption(pInfo->options, "YAxisMapping", NULL);
if (s) {
@@ -567,9 +567,9 @@ MouseCommonOptions(InputInfoPtr pInfo)
}
if (msg) {
xf86Msg(X_CONFIG, "%s: YAxisMapping: %s\n", pInfo->name, msg);
- xfree(msg);
+ free(msg);
}
- xfree(s);
+ free(s);
}
if (!yFromConfig) {
pMse->negativeY = 4;
@@ -602,7 +602,7 @@ MouseCommonOptions(InputInfoPtr pInfo)
pMse->buttonMap[n++] = 1 << (b-1);
if (b > pMse->buttons) pMse->buttons = b;
}
- xfree(s);
+ free(s);
}
/* get maximum of mapped buttons */
for (i = pMse->buttons-1; i >= 0; i--) {
@@ -638,9 +638,9 @@ MouseCommonOptions(InputInfoPtr pInfo)
}
if (msg) {
xf86Msg(X_CONFIG, "%s: DoubleClickButtons: %s\n", pInfo->name, msg);
- xfree(msg);
+ free(msg);
}
- xfree(s);
+ free(s);
}
}
/*
@@ -898,7 +898,7 @@ MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
* XXX This should be done by a function in the core server since the
* MouseDevRec is defined in the os-support layer.
*/
- if (!(pMse = xcalloc(sizeof(MouseDevRec), 1)))
+ if (!(pMse = calloc(sizeof(MouseDevRec), 1)))
return pInfo;
pInfo->private = pMse;
pMse->Ctrl = MouseCtrl;
@@ -1011,8 +1011,8 @@ MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
else {
xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
if (pMse->mousePriv)
- xfree(pMse->mousePriv);
- xfree(pMse);
+ free(pMse->mousePriv);
+ free(pMse);
pInfo->private = NULL;
return pInfo;
}
@@ -1020,7 +1020,7 @@ MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
xf86CloseSerial(pInfo->fd);
pInfo->fd = -1;
- if (!(mPriv = (pointer) xcalloc(sizeof(mousePrivRec), 1)))
+ if (!(mPriv = (pointer) calloc(sizeof(mousePrivRec), 1)))
return pInfo;
pMse->mousePriv = mPriv;
pMse->CommonOptions(pInfo);
@@ -1711,7 +1711,7 @@ MouseProc(DeviceIntPtr device, int what)
device->public.on = FALSE;
break;
case DEVICE_CLOSE:
- xfree(pMse->mousePriv);
+ free(pMse->mousePriv);
pMse->mousePriv = NULL;
break;
}
@@ -3149,7 +3149,7 @@ createProtoList(MouseDevPtr pMse, MouseProtocolID *protoList)
blocked = xf86BlockSIGIO ();
/* create a private copy first so we can write in the old list */
- if ((tmplist = xalloc(sizeof(MouseProtocolID) * NUM_AUTOPROBE_PROTOS))){
+ if ((tmplist = malloc(sizeof(MouseProtocolID) * NUM_AUTOPROBE_PROTOS))){
for (i = 0; protoList[i] != PROT_UNKNOWN; i++) {
tmplist[i] = protoList[i];
}
@@ -3259,7 +3259,7 @@ createProtoList(MouseDevPtr pMse, MouseProtocolID *protoList)
mPriv->protoList[k] = PROT_UNKNOWN;
- xfree(tmplist);
+ free(tmplist);
}
diff --git a/src/sun_mouse.c b/src/sun_mouse.c
index 42ab933..a5b38a5 100644
--- a/src/sun_mouse.c
+++ b/src/sun_mouse.c
@@ -205,10 +205,10 @@ vuidPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
VuidMsePtr pVuidMse;
int buttons, i;
- pVuidMse = xcalloc(sizeof(VuidMseRec), 1);
+ pVuidMse = calloc(sizeof(VuidMseRec), 1);
if (pVuidMse == NULL) {
xf86Msg(X_ERROR, "%s: cannot allocate VuidMouseRec\n", pInfo->name);
- xfree(pMse);
+ free(pMse);
return FALSE;
}
@@ -229,9 +229,9 @@ vuidPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
} else {
xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
- xfree(pVuidMse->strmod);
- xfree(pVuidMse);
- xfree(pMse);
+ free(pVuidMse->strmod);
+ free(pVuidMse);
+ free(pMse);
return FALSE;
}
} else {
@@ -247,9 +247,9 @@ vuidPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
pInfo->name, pVuidMse->strmod, strerror(errno));
xf86CloseSerial(pInfo->fd);
pInfo->fd = -1;
- xfree(pVuidMse->strmod);
- xfree(pVuidMse);
- xfree(pMse);
+ free(pVuidMse->strmod);
+ free(pVuidMse);
+ free(pMse);
return FALSE;
}
}
@@ -586,7 +586,7 @@ vuidMouseProc(DeviceIntPtr pPointer, int what)
xf86Msg(X_WARNING, "%s: cannot push module '%s' "
"onto mouse device: %s\n", pInfo->name,
pVuidMse->strmod, strerror(errno));
- xfree(pVuidMse->strmod);
+ free(pVuidMse->strmod);
pVuidMse->strmod = NULL;
}
}
@@ -795,7 +795,7 @@ xf86OSMouseInit(int flags)
{
OSMouseInfoPtr p;
- p = xcalloc(sizeof(OSMouseInfoRec), 1);
+ p = calloc(sizeof(OSMouseInfoRec), 1);
if (!p)
return NULL;
p->SupportedInterfaces = SupportedInterfaces;