From f779b2e3c4eba5c15d20cc13ebd08276a66ac012 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 27 Jun 2016 12:12:31 +0200 Subject: os: Remove deprecated malloc/free wrappers, clean {X,XNF}{alloc,calloc,realloc,free,strdup} from pre-C89 baggage Backported from X.org: commit cad9b053d52f62432dfd70e42e0240de77027cae Author: Adam Jackson Date: Tue Jul 8 13:24:25 2014 -0400 os: Remove deprecated malloc/free wrappers Reviewed-by: Alex Deucher Signed-off-by: Adam Jackson commit e983848ab44b0769f97f6207f1aa8b4f127be6a9 Author: Mikhail Gusarov Date: Thu May 6 00:16:24 2010 +0700 Clean {X,XNF}{alloc,calloc,realloc,free,strdup} from pre-C89 baggage C89 guarantees alignment of pointers returned from malloc/calloc/realloc, so stop fiddling with alignment manually and just pass the arguments to library functions. Also convert silent error when negative size is passed into function into warning in log file. Signed-off-by: Mikhail Gusarov Reviewed-by: Peter Hutterer Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/include/os.h | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'nx-X11/programs/Xserver/include') diff --git a/nx-X11/programs/Xserver/include/os.h b/nx-X11/programs/Xserver/include/os.h index 342913b4a..aaff63811 100644 --- a/nx-X11/programs/Xserver/include/os.h +++ b/nx-X11/programs/Xserver/include/os.h @@ -79,15 +79,11 @@ typedef void * FID; typedef struct _FontPathRec *FontPathPtr; typedef struct _NewClientRec *NewClientPtr; -#ifndef xalloc +#ifndef xnfalloc #define xnfalloc(size) XNFalloc((unsigned long)(size)) #define xnfcalloc(_num, _size) XNFcalloc((unsigned long)(_num)*(unsigned long)(_size)) #define xnfrealloc(ptr, size) XNFrealloc((void *)(ptr), (unsigned long)(size)) -#define xalloc(size) Xalloc((unsigned long)(size)) -#define xcalloc(_num, _size) Xcalloc((unsigned long)(_num)*(unsigned long)(_size)) -#define xrealloc(ptr, size) Xrealloc((void *)(ptr), (unsigned long)(size)) -#define xfree(ptr) Xfree((void *)(ptr)) #define xstrdup(s) Xstrdup(s) #define xnfstrdup(s) XNFstrdup(s) #endif @@ -229,14 +225,6 @@ extern int set_font_authorizations( int * /*authlen */, void * /* client */); -#ifndef _HAVE_XALLOC_DECLS -#define _HAVE_XALLOC_DECLS -extern void * Xalloc(unsigned long /*amount*/); -extern void * Xcalloc(unsigned long /*amount*/); -extern void * Xrealloc(void * /*ptr*/, unsigned long /*amount*/); -extern void Xfree(void * /*ptr*/); -#endif - extern void * XNFalloc(unsigned long /*amount*/); extern void * XNFcalloc(unsigned long /*amount*/); extern void * XNFrealloc(void * /*ptr*/, unsigned long /*amount*/); -- cgit v1.2.3