diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2020-04-21 18:13:22 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2020-04-21 20:55:59 -0400 |
commit | 53b59ddfc114a55d26e9717a1b4822f1b18c40ca (patch) | |
tree | b93dc722a1fd51a24ef7635d5b0c58cce9f329a4 | |
parent | 68c72a7341b114277ab232f2499ee3bd035af8a0 (diff) |
reduce gcc-normal warnings using casts (no object change)
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
-rw-r--r-- | include/X11/Xlibint.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h index 84457168..654cd5c5 100644 --- a/include/X11/Xlibint.h +++ b/include/X11/Xlibint.h @@ -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 |