[PATCH proto/kbproto] Use stdlib functions instead of the X wrappers.

Tomas Carnecky tom at dbservice.com
Wed Jun 16 13:10:58 PDT 2010

Replace xalloc/xfree/xrealloc/xcalloc with stdlib equivalents,
and bzero with memset.

Signed-off-by: Tomas Carnecky <tom at dbservice.com>

This is a reroll of the earlier patch, incorporating the suggestions.
I changed the subject because the patch is also changing bzero
to memset.

 XKBsrv.h |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/XKBsrv.h b/XKBsrv.h
index 26a4ed8..3451ac4 100644
--- a/XKBsrv.h
+++ b/XKBsrv.h
@@ -294,15 +294,15 @@ extern pointer	XkbLastRepeatEvent;
 extern CARD32	xkbDebugFlags;
 extern CARD32	xkbDebugCtrls;
-#define	_XkbAlloc(s)		xalloc((s))
-#define	_XkbCalloc(n,s)		Xcalloc((n)*(s))
-#define	_XkbRealloc(o,s)	Xrealloc((o),(s))
-#define	_XkbTypedAlloc(t)	((t *)xalloc(sizeof(t)))
-#define	_XkbTypedCalloc(n,t)	((t *)Xcalloc((n)*sizeof(t)))
+#define	_XkbAlloc(s)		malloc((s))
+#define	_XkbCalloc(n,s)		calloc((n),(s))
+#define	_XkbRealloc(o,s)	realloc((o),(s))
+#define	_XkbTypedAlloc(t)	(malloc(sizeof(t)))
+#define	_XkbTypedCalloc(n,t)	(calloc((n),sizeof(t)))
 #define	_XkbTypedRealloc(o,n,t) \
-	((o)?(t *)Xrealloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t))
-#define	_XkbClearElems(a,f,l,t)	bzero(&(a)[f],((l)-(f)+1)*sizeof(t))
-#define	_XkbFree(p)		Xfree(p)
+	((o)?(t *)realloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t))
+#define	_XkbClearElems(a,f,l,t)	memset(&(a)[f],0,((l)-(f)+1)*sizeof(t))
+#define	_XkbFree(p)		free(p)
 #define	_XkbLibError(c,l,d) \
 	{ _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); }

More information about the xorg-devel mailing list