mirror of
https://gitlab.freedesktop.org/xorg/lib/libx11.git
synced 2026-05-04 23:28:08 +02:00
reduce gcc-normal warnings using casts (no object change)
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
This commit is contained in:
parent
68c72a7341
commit
53b59ddfc1
1 changed files with 6 additions and 6 deletions
|
|
@ -447,15 +447,15 @@ extern LockInfoPtr _Xglobal_lock;
|
|||
*/
|
||||
#if defined(MALLOC_0_RETURNS_NULL) || defined(__clang_analyzer__)
|
||||
|
||||
# define Xmalloc(size) malloc(((size) == 0 ? 1 : (size)))
|
||||
# define Xrealloc(ptr, size) realloc((ptr), ((size) == 0 ? 1 : (size)))
|
||||
# define Xcalloc(nelem, elsize) calloc(((nelem) == 0 ? 1 : (nelem)), (elsize))
|
||||
# define Xmalloc(size) malloc((size_t)((size) == 0 ? 1 : (size)))
|
||||
# define Xrealloc(ptr, size) realloc((ptr), (size_t)((size) == 0 ? 1 : (size)))
|
||||
# define Xcalloc(nelem, elsize) calloc((size_t)((nelem) == 0 ? 1 : (nelem)), (size_t)(elsize))
|
||||
|
||||
#else
|
||||
|
||||
# define Xmalloc(size) malloc((size))
|
||||
# define Xrealloc(ptr, size) realloc((ptr), (size))
|
||||
# define Xcalloc(nelem, elsize) calloc((nelem), (elsize))
|
||||
# define Xmalloc(size) malloc((size_t)(size))
|
||||
# define Xrealloc(ptr, size) realloc((ptr), (size_t)(size))
|
||||
# define Xcalloc(nelem, elsize) calloc((size_t)(nelem), (size_t)(elsize))
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue