From e56e1003ab225d383cda67eb61737bc14e92332c Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 19 Nov 2022 10:29:07 -0800 Subject: Remove unnecessary casts from malloc & free calls Signed-off-by: Alan Coopersmith --- src/Cursor.c | 2 +- src/Xfixes.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cursor.c b/src/Cursor.c index 33590b7..4742240 100644 --- a/src/Cursor.c +++ b/src/Cursor.c @@ -193,7 +193,7 @@ XFixesGetCursorName (Display *dpy, Cursor cursor, Atom *atom) return NULL; } *atom = rep.atom; - if ((name = (char *) Xmalloc(rep.nbytes+1))) { + if ((name = Xmalloc(rep.nbytes+1)) != NULL) { _XReadPad(dpy, name, (long)rep.nbytes); name[rep.nbytes] = '\0'; } else { diff --git a/src/Xfixes.c b/src/Xfixes.c index c32ee39..b8aca09 100644 --- a/src/Xfixes.c +++ b/src/Xfixes.c @@ -50,7 +50,7 @@ XFixesExtAddDisplay (XFixesExtInfo *extinfo, XFixesExtDisplayInfo *info; int ev; - info = (XFixesExtDisplayInfo *) Xmalloc (sizeof (XFixesExtDisplayInfo)); + info = Xmalloc (sizeof (XFixesExtDisplayInfo)); if (!info) return NULL; info->display = dpy; @@ -154,7 +154,7 @@ XFixesExtRemoveDisplay (XFixesExtInfo *extinfo, Display *dpy) if (info == extinfo->cur) extinfo->cur = NULL; /* flush cache */ _XUnlockMutex(_Xglobal_lock); - Xfree ((char *) info); + Xfree (info); return 1; } -- cgit v1.2.1