diff options
author | Trevor Woerner <twoerner@gmail.com> | 2010-10-19 15:09:55 -0400 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2010-10-21 11:06:17 +0200 |
commit | 8650db94573e73953ba9718a2cc2644b38adc306 (patch) | |
tree | 118cd63891ead7317957ff379322885a2e557f38 | |
parent | adc177e3af9dc5da982ceb7a93e9c5e3bc6aed59 (diff) |
Deprecated code cleanup.
Replace calls to deprecated dynamic memory wrapper functions
in driver code.
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | src/vmmouse.c | 23 |
2 files changed, 18 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac index 8c1322c..d5b89c6 100644 --- a/configure.ac +++ b/configure.ac @@ -127,6 +127,10 @@ PKG_CHECK_EXISTS([xorg-server >= 1.1.0], [AC_DEFINE([HAVE_XORG_SERVER_1_1_0], 1, [Has version 1.1.0 or greater of the Xserver])]) +PKG_CHECK_EXISTS([xorg-server > 1.4.99], + [AC_DEFINE([HAVE_XORG_SERVER_1_5_0], 1, + [Has version 1.5.0 or greater of the Xserver])]) + PKG_CHECK_EXISTS([xorg-server >= 1.3.99.0 xorg-server <= 1.4.0.90], [AC_DEFINE([CALL_CONVERSION_PROC], 1, [Call conversion_proc from within the driver, as diff --git a/src/vmmouse.c b/src/vmmouse.c index f5ad234..1dfe5be 100644 --- a/src/vmmouse.c +++ b/src/vmmouse.c @@ -75,6 +75,11 @@ #include "xisb.h" #include "mipointer.h" +#ifndef HAVE_XORG_SERVER_1_5_0 +#include <xf86_ansic.h> +#include <xf86_libc.h> +#endif + /***************************************************************************** * Local Headers ****************************************************************************/ @@ -249,7 +254,7 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags) } #endif - mPriv = xcalloc (1, sizeof (VMMousePrivRec)); + mPriv = calloc (1, sizeof (VMMousePrivRec)); if (!mPriv) { @@ -270,7 +275,7 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags) xf86Msg(X_ERROR, "VMWARE(0): vmmouse enable failed\n"); mPriv->vmmouseAvailable = FALSE; passthruMouse = (InputDriverRec *)LoaderSymbol("MOUSE"); - xfree(mPriv); + free(mPriv); if(passthruMouse != NULL){ return (passthruMouse->PreInit)(drv, dev, flags); } else { @@ -291,7 +296,7 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags) } if (!(pInfo = xf86AllocateInput(drv, 0))) { - xfree(mPriv); + free(mPriv); return NULL; } @@ -316,8 +321,8 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags) pInfo->conf_idev = dev; /* Allocate the MouseDevRec and initialise it. */ - if (!(pMse = xcalloc(sizeof(MouseDevRec), 1))) { - xfree(mPriv); + if (!(pMse = calloc(sizeof(MouseDevRec), 1))) { + free(mPriv); return pInfo; } @@ -340,8 +345,8 @@ VMMousePreInit(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; } @@ -645,7 +650,7 @@ 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); @@ -1201,7 +1206,7 @@ VMMousePlug(pointer module, if (!LoadSubModule(module, name, NULL, NULL, NULL, NULL, errmaj, errmin)) { LoaderErrorMsg(NULL, name, *errmaj, *errmin); } - xfree(name); + free(name); } #endif |