From cc4ad7a3990826ca44470dbca3a5b03c35548cab Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 28 Aug 2022 10:26:00 -0700 Subject: Remove unnecessary casts from malloc & free calls These are not needed in C89 and later Signed-off-by: Alan Coopersmith --- src/Poly.c | 4 ++-- src/Xrender.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Poly.c b/src/Poly.c index 69a2da6..c6be3b0 100644 --- a/src/Poly.c +++ b/src/Poly.c @@ -249,8 +249,8 @@ XRenderCompositeDoublePoly (Display *dpy, XFixed x, y, prevx = 0, prevy = 0, firstx = 0, firsty = 0; XFixed top = 0, bottom = 0; /* GCCism */ - edges = (Edge *) Xmalloc (npoints * sizeof (Edge) + - (npoints * npoints * sizeof (XTrapezoid))); + edges = Xmalloc ((npoints * sizeof (Edge)) + + (npoints * npoints * sizeof (XTrapezoid))); if (!edges) return; traps = (XTrapezoid *) (edges + npoints); diff --git a/src/Xrender.c b/src/Xrender.c index 71cf3e6..20134a6 100644 --- a/src/Xrender.c +++ b/src/Xrender.c @@ -194,7 +194,7 @@ XRenderExtAddDisplay (XRenderExtInfo *extinfo, { XRenderExtDisplayInfo *dpyinfo; - dpyinfo = (XRenderExtDisplayInfo *) Xmalloc (sizeof (XRenderExtDisplayInfo)); + dpyinfo = Xmalloc (sizeof (XRenderExtDisplayInfo)); if (!dpyinfo) return NULL; dpyinfo->display = dpy; dpyinfo->info = NULL; @@ -273,7 +273,7 @@ XRenderExtRemoveDisplay (XRenderExtInfo *extinfo, Display *dpy) if (dpyinfo == extinfo->cur) extinfo->cur = NULL; /* flush cache */ _XUnlockMutex(_Xglobal_lock); - Xfree ((char *) dpyinfo); + Xfree (dpyinfo); return 1; } -- cgit v1.2.1