mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
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 <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
14
include/os.h
14
include/os.h
@@ -214,15 +214,15 @@ extern _X_EXPORT int set_font_authorizations(
|
||||
|
||||
#ifndef _HAVE_XALLOC_DECLS
|
||||
#define _HAVE_XALLOC_DECLS
|
||||
extern _X_EXPORT pointer Xalloc(unsigned long /*amount*/);
|
||||
extern _X_EXPORT pointer Xcalloc(unsigned long /*amount*/);
|
||||
extern _X_EXPORT pointer Xrealloc(pointer /*ptr*/, unsigned long /*amount*/);
|
||||
extern _X_EXPORT void Xfree(pointer /*ptr*/);
|
||||
extern _X_EXPORT void *Xalloc(unsigned long /*amount*/);
|
||||
extern _X_EXPORT void *Xcalloc(unsigned long /*amount*/);
|
||||
extern _X_EXPORT void *Xrealloc(void * /*ptr*/, unsigned long /*amount*/);
|
||||
extern _X_EXPORT void Xfree(void * /*ptr*/);
|
||||
#endif
|
||||
|
||||
extern _X_EXPORT pointer XNFalloc(unsigned long /*amount*/);
|
||||
extern _X_EXPORT pointer XNFcalloc(unsigned long /*amount*/);
|
||||
extern _X_EXPORT pointer XNFrealloc(pointer /*ptr*/, unsigned long /*amount*/);
|
||||
extern _X_EXPORT void *XNFalloc(unsigned long /*amount*/);
|
||||
extern _X_EXPORT void *XNFcalloc(unsigned long /*amount*/);
|
||||
extern _X_EXPORT void *XNFrealloc(void * /*ptr*/, unsigned long /*amount*/);
|
||||
|
||||
extern _X_EXPORT char *Xstrdup(const char *s);
|
||||
extern _X_EXPORT char *XNFstrdup(const char *s);
|
||||
|
||||
Reference in New Issue
Block a user