summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-19 10:29:07 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-19 10:29:07 -0800
commite56e1003ab225d383cda67eb61737bc14e92332c (patch)
tree44e1cc23afc2a02ad14eb5e997dae79ed1e44769
parentd10ec36c81a6b488d1f700a28c5bff4714287b78 (diff)
Remove unnecessary casts from malloc & free calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/Cursor.c2
-rw-r--r--src/Xfixes.c4
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;
}