summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-13 11:54:30 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-13 14:17:45 -0800
commita6059bdf3d3baea176c9a69ffd5b39a22b4af902 (patch)
treeceac85eef7931504b5e5425483e058009754370f
parent6baf8e4fa706b8fffc121d535bac398723118415 (diff)
Remove unnecessary casts
These were needed for pre-C89 systems that took char * arguments instead of void * arguments, but aren't needed for C89 & later. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xset.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/xset.c b/xset.c
index 8af9371..d950b70 100644
--- a/xset.c
+++ b/xset.c
@@ -905,7 +905,7 @@ set_font_path(Display *dpy, const char *path, int special, int before, int after
}
}
- directoryList = (char **)malloc(ndirs * sizeof(char *));
+ directoryList = malloc(ndirs * sizeof(char *));
if (!directoryList)
error("out of memory for font path directory list");
@@ -942,31 +942,28 @@ set_font_path(Display *dpy, const char *path, int special, int before, int after
/* if adding to list, build a superset */
if (before > 0 || after > 0) {
unsigned int nnew = ndirs + ncurrent;
- char **newList = (char **)malloc(nnew * sizeof(char *));
+ char **newList = malloc(nnew * sizeof(char *));
if (!newList)
error("out of memory");
if (before > 0) { /* new + current */
- memmove((char *)newList, (char *)directoryList,
- (ndirs * sizeof(char *)));
- memmove((char *)(newList + ndirs), (char *)currentList,
- (ncurrent * sizeof(char *)));
+ memmove(newList, directoryList, (ndirs * sizeof(char *)));
+ memmove((newList + ndirs), currentList, (ncurrent * sizeof(char *)));
XSetFontPath(dpy, newList, (int) nnew);
} else if (after > 0) {
- memmove((char *)newList, (char *)currentList,
- (ncurrent * sizeof(char *)));
- memmove((char *)(newList + ncurrent), (char *)directoryList,
+ memmove(newList, currentList, (ncurrent * sizeof(char *)));
+ memmove((newList + ncurrent), directoryList,
(ndirs * sizeof(char *)));
XSetFontPath(dpy, newList,(int) nnew);
}
- free((char *)newList);
+ free(newList);
}
/* if deleting from list, build one the same size */
if (before < 0 || after < 0) {
unsigned int i, j;
unsigned int nnew = 0;
- char **newList = (char **)malloc(ncurrent * sizeof(char *));
+ char **newList = malloc(ncurrent * sizeof(char *));
if (!newList)
error("out of memory");
@@ -985,12 +982,12 @@ set_font_path(Display *dpy, const char *path, int special, int before, int after
progName);
}
XSetFontPath(dpy, newList, (int) nnew);
- free((char *)newList);
+ free(newList);
}
free(directories);
if (directoryList)
- free((char *)directoryList);
+ free(directoryList);
if (currentList)
XFreeFontPath(currentList);
@@ -1201,7 +1198,7 @@ set_pixels(Display *dpy, unsigned long *pixels, caddr_t * colors,
}
}
- XFree((char *)vip);
+ XFree(vip);
return;
}