Commit 26256188 authored by Alan Coopersmith's avatar Alan Coopersmith Committed by Ulrich Sibiller

Remove unnecessary casts of pointers to (char *) in calls to Xfree()

Left one cast behind that is necessary to change from const char * to char * in nx-X11/lib/X11/lcCharSet.c. Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent d33cf044
...@@ -126,7 +126,7 @@ static void ResizeTable(DB db) ...@@ -126,7 +126,7 @@ static void ResizeTable(DB db)
*head = entry; *head = entry;
} }
} }
Xfree((char *) otable); Xfree(otable);
} }
static void _XFreeContextDB(Display *display) static void _XFreeContextDB(Display *display)
...@@ -140,12 +140,12 @@ static void _XFreeContextDB(Display *display) ...@@ -140,12 +140,12 @@ static void _XFreeContextDB(Display *display)
for (i = db->mask + 1, pentry = db->table ; --i >= 0; pentry++) { for (i = db->mask + 1, pentry = db->table ; --i >= 0; pentry++) {
for (entry = *pentry; entry; entry = next) { for (entry = *pentry; entry; entry = next) {
next = entry->next; next = entry->next;
Xfree((char *)entry); Xfree(entry);
} }
} }
Xfree((char *) db->table); Xfree(db->table);
_XFreeMutex(&db->linfo); _XFreeMutex(&db->linfo);
Xfree((char *) db); Xfree(db);
} }
} }
...@@ -186,7 +186,7 @@ int XSaveContext( ...@@ -186,7 +186,7 @@ int XSaveContext(
db->mask = INITHASHMASK; db->mask = INITHASHMASK;
db->table = Xcalloc(db->mask + 1, sizeof(TableEntry)); db->table = Xcalloc(db->mask + 1, sizeof(TableEntry));
if (!db->table) { if (!db->table) {
Xfree((char *)db); Xfree(db);
return XCNOMEM; return XCNOMEM;
} }
db->numentries = 0; db->numentries = 0;
...@@ -289,7 +289,7 @@ int XDeleteContext(Display *display, XID rid, XContext context) ...@@ -289,7 +289,7 @@ int XDeleteContext(Display *display, XID rid, XContext context)
prev = &entry->next) { prev = &entry->next) {
if (entry->rid == rid && entry->context == context) { if (entry->rid == rid && entry->context == context) {
*prev = entry->next; *prev = entry->next;
Xfree((char *) entry); Xfree(entry);
db->numentries--; db->numentries--;
if (db->numentries < db->mask && db->mask > INITHASHMASK) if (db->numentries < db->mask && db->mask > INITHASHMASK)
ResizeTable(db); ResizeTable(db);
......
...@@ -987,13 +987,13 @@ XcmsConvertColors( ...@@ -987,13 +987,13 @@ XcmsConvertColors(
nColors * sizeof(XcmsColor)); nColors * sizeof(XcmsColor));
} }
if (nColors > 1) { if (nColors > 1) {
Xfree((char *)pColors_tmp); Xfree(pColors_tmp);
} }
return(retval); return(retval);
Failure: Failure:
if (nColors > 1) { if (nColors > 1) {
Xfree((char *)pColors_tmp); Xfree(pColors_tmp);
} }
return(XcmsFailure); return(XcmsFailure);
} }
......
...@@ -58,7 +58,7 @@ Status XFetchName ( ...@@ -58,7 +58,7 @@ Status XFetchName (
*name = (char *)data; *name = (char *)data;
return(1); return(1);
} }
if (data) Xfree ((char *)data); if (data) Xfree (data);
*name = NULL; *name = NULL;
return(0); return(0);
} }
...@@ -89,7 +89,7 @@ Status XGetIconName ( ...@@ -89,7 +89,7 @@ Status XGetIconName (
*icon_name = (char*)data; *icon_name = (char*)data;
return(1); return(1);
} }
if (data) Xfree ((char *)data); if (data) Xfree (data);
*icon_name = NULL; *icon_name = NULL;
return(0); return(0);
} }
...@@ -166,13 +166,13 @@ XFreeFont( ...@@ -166,13 +166,13 @@ XFreeFont(
#ifdef USE_XF86BIGFONT #ifdef USE_XF86BIGFONT
_XF86BigfontFreeFontMetrics(fs); _XF86BigfontFreeFontMetrics(fs);
#else #else
Xfree ((char *) fs->per_char); Xfree (fs->per_char);
#endif #endif
} }
_XFreeExtData(fs->ext_data); _XFreeExtData(fs->ext_data);
if (fs->properties) if (fs->properties)
Xfree ((char *) fs->properties); Xfree (fs->properties);
Xfree ((char *) fs); Xfree (fs);
return 1; return 1;
} }
...@@ -249,7 +249,7 @@ _XQueryFont ( ...@@ -249,7 +249,7 @@ _XQueryFont (
fs->properties = Xmalloc (pbytes); fs->properties = Xmalloc (pbytes);
} }
if (! fs->properties) { if (! fs->properties) {
Xfree((char *) fs); Xfree(fs);
_XEatDataWords(dpy, reply_left); _XEatDataWords(dpy, reply_left);
return (XFontStruct *)NULL; return (XFontStruct *)NULL;
} }
...@@ -271,8 +271,8 @@ _XQueryFont ( ...@@ -271,8 +271,8 @@ _XQueryFont (
} }
} }
if (! fs->per_char) { if (! fs->per_char) {
if (fs->properties) Xfree((char *) fs->properties); if (fs->properties) Xfree(fs->properties);
Xfree((char *) fs); Xfree(fs);
_XEatDataWords(dpy, reply_left); _XEatDataWords(dpy, reply_left);
return (XFontStruct *)NULL; return (XFontStruct *)NULL;
} }
...@@ -493,7 +493,7 @@ _XF86BigfontQueryFont ( ...@@ -493,7 +493,7 @@ _XF86BigfontQueryFont (
fs->properties = Xmalloc (pbytes); fs->properties = Xmalloc (pbytes);
} }
if (! fs->properties) { if (! fs->properties) {
Xfree((char *) fs); Xfree(fs);
_XEatDataWords(dpy, reply_left); _XEatDataWords(dpy, reply_left);
return (XFontStruct *)NULL; return (XFontStruct *)NULL;
} }
...@@ -507,8 +507,8 @@ _XF86BigfontQueryFont ( ...@@ -507,8 +507,8 @@ _XF86BigfontQueryFont (
any real font needs, so the combined total doesn't overflow either */ any real font needs, so the combined total doesn't overflow either */
if (reply.nUniqCharInfos > ((ULONG_MAX / 2) / SIZEOF(xCharInfo)) || if (reply.nUniqCharInfos > ((ULONG_MAX / 2) / SIZEOF(xCharInfo)) ||
reply.nCharInfos > ((ULONG_MAX / 2) / sizeof(CARD16))) { reply.nCharInfos > ((ULONG_MAX / 2) / sizeof(CARD16))) {
Xfree((char *) fs->properties); Xfree(fs->properties);
Xfree((char *) fs); Xfree(fs);
_XEatDataWords(dpy, reply_left); _XEatDataWords(dpy, reply_left);
return (XFontStruct *)NULL; return (XFontStruct *)NULL;
} }
...@@ -524,15 +524,15 @@ _XF86BigfontQueryFont ( ...@@ -524,15 +524,15 @@ _XF86BigfontQueryFont (
+ (reply.nCharInfos+1)/2 * 2 * sizeof(CARD16); + (reply.nCharInfos+1)/2 * 2 * sizeof(CARD16);
pUniqCI = Xmalloc (nbytes); pUniqCI = Xmalloc (nbytes);
if (!pUniqCI) { if (!pUniqCI) {
if (fs->properties) Xfree((char *) fs->properties); if (fs->properties) Xfree(fs->properties);
Xfree((char *) fs); Xfree(fs);
_XEatDataWords(dpy, reply_left); _XEatDataWords(dpy, reply_left);
return (XFontStruct *)NULL; return (XFontStruct *)NULL;
} }
if (! (fs->per_char = Xmalloc (reply.nCharInfos * sizeof(XCharStruct)))) { if (! (fs->per_char = Xmalloc (reply.nCharInfos * sizeof(XCharStruct)))) {
Xfree((char *) pUniqCI); Xfree(pUniqCI);
if (fs->properties) Xfree((char *) fs->properties); if (fs->properties) Xfree(fs->properties);
Xfree((char *) fs); Xfree(fs);
_XEatDataWords(dpy, reply_left); _XEatDataWords(dpy, reply_left);
return (XFontStruct *)NULL; return (XFontStruct *)NULL;
} }
...@@ -541,15 +541,15 @@ _XF86BigfontQueryFont ( ...@@ -541,15 +541,15 @@ _XF86BigfontQueryFont (
for (i = 0; i < reply.nCharInfos; i++) { for (i = 0; i < reply.nCharInfos; i++) {
if (pIndex2UniqIndex[i] >= reply.nUniqCharInfos) { if (pIndex2UniqIndex[i] >= reply.nUniqCharInfos) {
fprintf(stderr, "_XF86BigfontQueryFont: server returned wrong data\n"); fprintf(stderr, "_XF86BigfontQueryFont: server returned wrong data\n");
Xfree((char *) pUniqCI); Xfree(pUniqCI);
if (fs->properties) Xfree((char *) fs->properties); if (fs->properties) Xfree(fs->properties);
Xfree((char *) fs); Xfree(fs);
return (XFontStruct *)NULL; return (XFontStruct *)NULL;
} }
/* XXX the next statement won't work if short isn't 16 bits */ /* XXX the next statement won't work if short isn't 16 bits */
fs->per_char[i] = * (XCharStruct *) &pUniqCI[pIndex2UniqIndex[i]]; fs->per_char[i] = * (XCharStruct *) &pUniqCI[pIndex2UniqIndex[i]];
} }
Xfree((char *) pUniqCI); Xfree(pUniqCI);
} else { } else {
#ifdef HAS_SHM #ifdef HAS_SHM
XExtData *pData; XExtData *pData;
...@@ -558,8 +558,8 @@ _XF86BigfontQueryFont ( ...@@ -558,8 +558,8 @@ _XF86BigfontQueryFont (
pData = Xmalloc(sizeof(XExtData)); pData = Xmalloc(sizeof(XExtData));
if (!pData) { if (!pData) {
if (fs->properties) Xfree((char *) fs->properties); if (fs->properties) Xfree(fs->properties);
Xfree((char *) fs); Xfree(fs);
return (XFontStruct *)NULL; return (XFontStruct *)NULL;
} }
...@@ -577,9 +577,9 @@ _XF86BigfontQueryFont ( ...@@ -577,9 +577,9 @@ _XF86BigfontQueryFont (
if ((addr = shmat(reply.shmid, NULL, SHM_RDONLY)) == (char *)-1) { if ((addr = shmat(reply.shmid, NULL, SHM_RDONLY)) == (char *)-1) {
if (extcodes->serverCapabilities & CAP_VerifiedLocal) if (extcodes->serverCapabilities & CAP_VerifiedLocal)
fprintf(stderr, "_XF86BigfontQueryFont: could not attach shm segment\n"); fprintf(stderr, "_XF86BigfontQueryFont: could not attach shm segment\n");
Xfree((char *) pData); Xfree(pData);
if (fs->properties) Xfree((char *) fs->properties); if (fs->properties) Xfree(fs->properties);
Xfree((char *) fs); Xfree(fs);
/* Stop requesting shared memory transport from now on. */ /* Stop requesting shared memory transport from now on. */
extcodes->serverCapabilities &= ~ XF86Bigfont_CAP_LocalShm; extcodes->serverCapabilities &= ~ XF86Bigfont_CAP_LocalShm;
return (XFontStruct *)NULL; return (XFontStruct *)NULL;
...@@ -592,9 +592,9 @@ _XF86BigfontQueryFont ( ...@@ -592,9 +592,9 @@ _XF86BigfontQueryFont (
&& buf.shm_segsz >= reply.shmsegoffset + reply.nCharInfos * sizeof(XCharStruct) + sizeof(CARD32) && buf.shm_segsz >= reply.shmsegoffset + reply.nCharInfos * sizeof(XCharStruct) + sizeof(CARD32)
&& *(CARD32 *)(addr + reply.shmsegoffset + reply.nCharInfos * sizeof(XCharStruct)) == extcodes->serverSignature)) { && *(CARD32 *)(addr + reply.shmsegoffset + reply.nCharInfos * sizeof(XCharStruct)) == extcodes->serverSignature)) {
shmdt(addr); shmdt(addr);
Xfree((char *) pData); Xfree(pData);
if (fs->properties) Xfree((char *) fs->properties); if (fs->properties) Xfree(fs->properties);
Xfree((char *) fs); Xfree(fs);
/* Stop requesting shared memory transport from now on. */ /* Stop requesting shared memory transport from now on. */
extcodes->serverCapabilities &= ~ XF86Bigfont_CAP_LocalShm; extcodes->serverCapabilities &= ~ XF86Bigfont_CAP_LocalShm;
return (XFontStruct *)NULL; return (XFontStruct *)NULL;
...@@ -611,8 +611,8 @@ _XF86BigfontQueryFont ( ...@@ -611,8 +611,8 @@ _XF86BigfontQueryFont (
fs->per_char = (XCharStruct *) (addr + reply.shmsegoffset); fs->per_char = (XCharStruct *) (addr + reply.shmsegoffset);
#else #else
fprintf(stderr, "_XF86BigfontQueryFont: try recompiling libX11 with HasShm, Xserver has shm support\n"); fprintf(stderr, "_XF86BigfontQueryFont: try recompiling libX11 with HasShm, Xserver has shm support\n");
if (fs->properties) Xfree((char *) fs->properties); if (fs->properties) Xfree(fs->properties);
Xfree((char *) fs); Xfree(fs);
/* Stop requesting shared memory transport from now on. */ /* Stop requesting shared memory transport from now on. */
extcodes->serverCapabilities &= ~ XF86Bigfont_CAP_LocalShm; extcodes->serverCapabilities &= ~ XF86Bigfont_CAP_LocalShm;
return (XFontStruct *)NULL; return (XFontStruct *)NULL;
...@@ -638,9 +638,9 @@ _XF86BigfontFreeFontMetrics (XFontStruct *fs) ...@@ -638,9 +638,9 @@ _XF86BigfontFreeFontMetrics (XFontStruct *fs)
XF86BigfontNumber))) XF86BigfontNumber)))
shmdt ((char *) pData->private_data); shmdt ((char *) pData->private_data);
else else
Xfree ((char *) fs->per_char); Xfree (fs->per_char);
#else #else
Xfree ((char *) fs->per_char); Xfree (fs->per_char);
#endif #endif
} }
...@@ -693,14 +693,14 @@ int _XF86LoadQueryLocaleFont( ...@@ -693,14 +693,14 @@ int _XF86LoadQueryLocaleFont(
#ifdef USE_XF86BIGFONT #ifdef USE_XF86BIGFONT
_XF86BigfontFreeFontMetrics(fs); _XF86BigfontFreeFontMetrics(fs);
#else #else
Xfree ((char *) fs->per_char); Xfree (fs->per_char);
#endif #endif
} }
_XFreeExtData(fs->ext_data); _XFreeExtData(fs->ext_data);
if (fs->properties) if (fs->properties)
Xfree ((char *) fs->properties); Xfree (fs->properties);
*fidp = fs->fid; *fidp = fs->fid;
Xfree ((char *) fs); Xfree (fs);
} else { } else {
XFreeFont(dpy, fs); XFreeFont(dpy, fs);
} }
......
...@@ -107,7 +107,7 @@ XFontStruct **info) /* RETURN */ ...@@ -107,7 +107,7 @@ XFontStruct **info) /* RETURN */
if (! (finfo = Xmalloc(sizeof(XFontStruct) * size))) if (! (finfo = Xmalloc(sizeof(XFontStruct) * size)))
goto clearwire; goto clearwire;
if (! (flist = Xmalloc(sizeof(char *) * (size+1)))) { if (! (flist = Xmalloc(sizeof(char *) * (size+1)))) {
Xfree((char *) finfo); Xfree(finfo);
goto clearwire; goto clearwire;
} }
} }
...@@ -152,7 +152,7 @@ XFontStruct **info) /* RETURN */ ...@@ -152,7 +152,7 @@ XFontStruct **info) /* RETURN */
nbytes++; /* make first string 1 byte longer, to match XListFonts */ nbytes++; /* make first string 1 byte longer, to match XListFonts */
flist[i] = Xmalloc (nbytes); flist[i] = Xmalloc (nbytes);
if (! flist[i]) { if (! flist[i]) {
if (finfo[i].properties) Xfree((char *) finfo[i].properties); if (finfo[i].properties) Xfree(finfo[i].properties);
goto badmem; goto badmem;
} }
if (!i) { if (!i) {
...@@ -177,10 +177,10 @@ XFontStruct **info) /* RETURN */ ...@@ -177,10 +177,10 @@ XFontStruct **info) /* RETURN */
if (j == 0) if (j == 0)
flist[j]--; /* was incremented above */ flist[j]--; /* was incremented above */
Xfree(flist[j]); Xfree(flist[j]);
if (finfo[j].properties) Xfree((char *) finfo[j].properties); if (finfo[j].properties) Xfree(finfo[j].properties);
} }
if (flist) Xfree((char *) flist); if (flist) Xfree(flist);
if (finfo) Xfree((char *) finfo); if (finfo) Xfree(finfo);
clearwire: clearwire:
/* Clear the wire. */ /* Clear the wire. */
...@@ -208,7 +208,7 @@ XFreeFontInfo ( ...@@ -208,7 +208,7 @@ XFreeFontInfo (
for (i = 1; i < actualCount; i++) { for (i = 1; i < actualCount; i++) {
Xfree (names[i]); Xfree (names[i]);
} }
Xfree((char *) names); Xfree(names);
} }
if (info) { if (info) {
for (i = 0; i < actualCount; i++) { for (i = 0; i < actualCount; i++) {
...@@ -216,12 +216,12 @@ XFreeFontInfo ( ...@@ -216,12 +216,12 @@ XFreeFontInfo (
#ifdef USE_XF86BIGFONT #ifdef USE_XF86BIGFONT
_XF86BigfontFreeFontMetrics(&info[i]); _XF86BigfontFreeFontMetrics(&info[i]);
#else #else
Xfree ((char *) info[i].per_char); Xfree (info[i].per_char);
#endif #endif
if (info[i].properties) if (info[i].properties)
Xfree ((char *) info[i].properties); Xfree (info[i].properties);
} }
Xfree((char *) info); Xfree(info);
} }
return 1; return 1;
} }
...@@ -73,7 +73,7 @@ int *actualCount) /* RETURN */ ...@@ -73,7 +73,7 @@ int *actualCount) /* RETURN */
} }
if ((! flist) || (! ch)) { if ((! flist) || (! ch)) {
if (flist) Xfree((char *) flist); if (flist) Xfree(flist);
if (ch) Xfree(ch); if (ch) Xfree(ch);
_XEatDataWords(dpy, rep.length); _XEatDataWords(dpy, rep.length);
*actualCount = 0; *actualCount = 0;
...@@ -116,7 +116,7 @@ XFreeFontNames(char **list) ...@@ -116,7 +116,7 @@ XFreeFontNames(char **list)
Xfree (*names); Xfree (*names);
} }
Xfree (list[0]-1); Xfree (list[0]-1);
Xfree ((char *)list); Xfree (list);
} }
return 1; return 1;
} }
...@@ -36,9 +36,9 @@ _XFreeExtData (XExtData *extension) ...@@ -36,9 +36,9 @@ _XFreeExtData (XExtData *extension)
while (extension) { while (extension) {
if (extension->free_private) if (extension->free_private)
(*extension->free_private)(extension); (*extension->free_private)(extension);
else Xfree ((char *)extension->private_data); else Xfree (extension->private_data);
temp = extension->next; temp = extension->next;
Xfree ((char *)extension); Xfree (extension);
extension = temp; extension = temp;
} }
return 0; return 0;
......
...@@ -44,7 +44,7 @@ XFreeGC ( ...@@ -44,7 +44,7 @@ XFreeGC (
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
_XFreeExtData(gc->ext_data); _XFreeExtData(gc->ext_data);
Xfree ((char *) gc); Xfree (gc);
return 1; return 1;
} }
...@@ -57,7 +57,7 @@ char **XGetFontPath( ...@@ -57,7 +57,7 @@ char **XGetFontPath(
} }
if ((! flist) || (! ch)) { if ((! flist) || (! ch)) {
if (flist) Xfree((char *) flist); if (flist) Xfree(flist);
if (ch) Xfree(ch); if (ch) Xfree(ch);
_XEatDataWords(dpy, rep.length); _XEatDataWords(dpy, rep.length);
UnlockDisplay(dpy); UnlockDisplay(dpy);
...@@ -93,7 +93,7 @@ XFreeFontPath (char **list) ...@@ -93,7 +93,7 @@ XFreeFontPath (char **list)
{ {
if (list != NULL) { if (list != NULL) {
Xfree (list[0]-1); Xfree (list[0]-1);
Xfree ((char *)list); Xfree (list);
} }
return 1; return 1;
} }
...@@ -75,7 +75,7 @@ Status XGetSizeHints ( ...@@ -75,7 +75,7 @@ Status XGetSizeHints (
if ((actual_type != XA_WM_SIZE_HINTS) || if ((actual_type != XA_WM_SIZE_HINTS) ||
(nitems < OldNumPropSizeElements) || (actual_format != 32)) { (nitems < OldNumPropSizeElements) || (actual_format != 32)) {
if (prop != NULL) Xfree ((char *)prop); if (prop != NULL) Xfree (prop);
return(0); return(0);
} }
hints->flags = (prop->flags & (USPosition|USSize|PAllHints)); hints->flags = (prop->flags & (USPosition|USSize|PAllHints));
...@@ -93,7 +93,7 @@ Status XGetSizeHints ( ...@@ -93,7 +93,7 @@ Status XGetSizeHints (
hints->min_aspect.y = cvtINT32toInt (prop->minAspectY); hints->min_aspect.y = cvtINT32toInt (prop->minAspectY);
hints->max_aspect.x = cvtINT32toInt (prop->maxAspectX); hints->max_aspect.x = cvtINT32toInt (prop->maxAspectX);
hints->max_aspect.y = cvtINT32toInt (prop->maxAspectY); hints->max_aspect.y = cvtINT32toInt (prop->maxAspectY);
Xfree((char *)prop); Xfree(prop);
return(1); return(1);
} }
...@@ -124,7 +124,7 @@ XWMHints *XGetWMHints ( ...@@ -124,7 +124,7 @@ XWMHints *XGetWMHints (
if ((actual_type != XA_WM_HINTS) || if ((actual_type != XA_WM_HINTS) ||
(nitems < (NumPropWMHintsElements - 1)) || (actual_format != 32)) { (nitems < (NumPropWMHintsElements - 1)) || (actual_format != 32)) {
if (prop != NULL) Xfree ((char *)prop); if (prop != NULL) Xfree (prop);
return(NULL); return(NULL);
} }
/* static copies not allowed in library, due to reentrancy constraint*/ /* static copies not allowed in library, due to reentrancy constraint*/
...@@ -142,7 +142,7 @@ XWMHints *XGetWMHints ( ...@@ -142,7 +142,7 @@ XWMHints *XGetWMHints (
else else
hints->window_group = 0; hints->window_group = 0;
} }
Xfree ((char *)prop); Xfree (prop);
return(hints); return(hints);
} }
...@@ -196,7 +196,7 @@ Status XGetIconSizes ( ...@@ -196,7 +196,7 @@ Status XGetIconSizes (
(nitems < NumPropIconSizeElements) || (nitems < NumPropIconSizeElements) ||
(nitems % NumPropIconSizeElements != 0) || (nitems % NumPropIconSizeElements != 0) ||
(actual_format != 32)) { (actual_format != 32)) {
if (prop != NULL) Xfree ((char *)prop); if (prop != NULL) Xfree (prop);
return(0); return(0);
} }
...@@ -204,7 +204,7 @@ Status XGetIconSizes ( ...@@ -204,7 +204,7 @@ Status XGetIconSizes (
nitems /= NumPropIconSizeElements; nitems /= NumPropIconSizeElements;
if (! (hp = hints = Xcalloc (nitems, sizeof(XIconSize)))) { if (! (hp = hints = Xcalloc (nitems, sizeof(XIconSize)))) {
if (prop) Xfree ((char *) prop); if (prop) Xfree (prop);
return 0; return 0;
} }
...@@ -221,7 +221,7 @@ Status XGetIconSizes ( ...@@ -221,7 +221,7 @@ Status XGetIconSizes (
} }
*count = nitems; *count = nitems;
*size_list = hints; *size_list = hints;
Xfree ((char *)prop); Xfree (prop);
return(1); return(1);
} }
...@@ -239,7 +239,7 @@ Status XGetCommand ( ...@@ -239,7 +239,7 @@ Status XGetCommand (
if (!XGetTextProperty (dpy, w, &tp, XA_WM_COMMAND)) return 0; if (!XGetTextProperty (dpy, w, &tp, XA_WM_COMMAND)) return 0;
if (tp.encoding != XA_STRING || tp.format != 8) { if (tp.encoding != XA_STRING || tp.format != 8) {
if (tp.value) Xfree ((char *) tp.value); if (tp.value) Xfree (tp.value);
return 0; return 0;
} }
...@@ -254,11 +254,11 @@ Status XGetCommand ( ...@@ -254,11 +254,11 @@ Status XGetCommand (
* create a string list and return if successful * create a string list and return if successful
*/ */
if (!XTextPropertyToStringList (&tp, &argv, &argc)) { if (!XTextPropertyToStringList (&tp, &argv, &argc)) {
if (tp.value) Xfree ((char *) tp.value); if (tp.value) Xfree (tp.value);
return (0); return (0);
} }
if (tp.value) Xfree ((char *) tp.value); if (tp.value) Xfree (tp.value);
*argvp = argv; *argvp = argv;
*argcp = argc; *argcp = argc;
return 1; return 1;
...@@ -317,7 +317,7 @@ XGetClassHint( ...@@ -317,7 +317,7 @@ XGetClassHint(
if ( (actual_type == XA_STRING) && (actual_format == 8) ) { if ( (actual_type == XA_STRING) && (actual_format == 8) ) {
len_name = strlen((char *) data); len_name = strlen((char *) data);
if (! (classhint->res_name = Xmalloc(len_name + 1))) { if (! (classhint->res_name = Xmalloc(len_name + 1))) {
Xfree((char *) data); Xfree(data);
return (0); return (0);
} }
strcpy(classhint->res_name, (char *) data); strcpy(classhint->res_name, (char *) data);
...@@ -326,7 +326,7 @@ XGetClassHint( ...@@ -326,7 +326,7 @@ XGetClassHint(
if (! (classhint->res_class = Xmalloc(len_class + 1))) { if (! (classhint->res_class = Xmalloc(len_class + 1))) {
Xfree(classhint->res_name); Xfree(classhint->res_name);
classhint->res_name = (char *) NULL; classhint->res_name = (char *) NULL;
Xfree((char *) data); Xfree(data);
return (0); return (0);
} }
strcpy(classhint->res_class, (char *) (data+len_name+1)); strcpy(classhint->res_class, (char *) (data+len_name+1));
......
...@@ -83,7 +83,7 @@ Status XGetWMSizeHints ( ...@@ -83,7 +83,7 @@ Status XGetWMSizeHints (
if ((actual_type != XA_WM_SIZE_HINTS) || if ((actual_type != XA_WM_SIZE_HINTS) ||
(nitems < OldNumPropSizeElements) || (actual_format != 32)) { (nitems < OldNumPropSizeElements) || (actual_format != 32)) {
if (prop != NULL) Xfree ((char *)prop); if (prop != NULL) Xfree (prop);
return False; return False;
} }
...@@ -112,7 +112,7 @@ Status XGetWMSizeHints ( ...@@ -112,7 +112,7 @@ Status XGetWMSizeHints (
*supplied |= (PBaseSize | PWinGravity); *supplied |= (PBaseSize | PWinGravity);
} }
hints->flags &= (*supplied); /* get rid of unwanted bits */ hints->flags &= (*supplied); /* get rid of unwanted bits */
Xfree((char *)prop); Xfree(prop);
return True; return True;
} }
......
...@@ -63,7 +63,7 @@ Status XGetRGBColormaps ( ...@@ -63,7 +63,7 @@ Status XGetRGBColormaps (
/* if wrong type or format, or too small for us, then punt */ /* if wrong type or format, or too small for us, then punt */
if ((actual_type != XA_RGB_COLOR_MAP) || (actual_format != 32) || if ((actual_type != XA_RGB_COLOR_MAP) || (actual_format != 32) ||
(nitems < OldNumPropStandardColormapElements)) { (nitems < OldNumPropStandardColormapElements)) {
if (data) Xfree ((char *) data); if (data) Xfree (data);
return False; return False;
} }
...@@ -78,7 +78,7 @@ Status XGetRGBColormaps ( ...@@ -78,7 +78,7 @@ Status XGetRGBColormaps (
Screen *sp = _XScreenOfWindow (dpy, w); Screen *sp = _XScreenOfWindow (dpy, w);
if (!sp) { if (!sp) {
if (data) Xfree ((char *) data); if (data) Xfree (data);
return False; return False;
} }
def_visual = sp->root_visual->visualid; def_visual = sp->root_visual->visualid;
...@@ -90,7 +90,7 @@ Status XGetRGBColormaps ( ...@@ -90,7 +90,7 @@ Status XGetRGBColormaps (
ncmaps = (nitems / NumPropStandardColormapElements); ncmaps = (nitems / NumPropStandardColormapElements);
if ((((unsigned long) ncmaps) * NumPropStandardColormapElements) != if ((((unsigned long) ncmaps) * NumPropStandardColormapElements) !=
nitems) { nitems) {
if (data) Xfree ((char *) data); if (data) Xfree (data);
return False; return False;
} }
} }
...@@ -101,7 +101,7 @@ Status XGetRGBColormaps ( ...@@ -101,7 +101,7 @@ Status XGetRGBColormaps (
*/ */
cmaps = Xmalloc (ncmaps * sizeof (XStandardColormap)); cmaps = Xmalloc (ncmaps * sizeof (XStandardColormap));
if (!cmaps) { if (!cmaps) {
if (data) Xfree ((char *) data); if (data) Xfree (data);
return False; return False;
} }
...@@ -126,7 +126,7 @@ Status XGetRGBColormaps ( ...@@ -126,7 +126,7 @@ Status XGetRGBColormaps (
map->killid = (old_style ? None : prop->killid); map->killid = (old_style ? None : prop->killid);
} }
} }
Xfree ((char *) data); Xfree (data);
*stdcmap = cmaps; *stdcmap = cmaps;
*count = ncmaps; *count = ncmaps;
return True; return True;
......
...@@ -81,7 +81,7 @@ Status XGetStandardColormap ( ...@@ -81,7 +81,7 @@ Status XGetStandardColormap (
int i; int i;
if (!sp) { if (!sp) {
if (stdcmaps) Xfree ((char *) stdcmaps); if (stdcmaps) Xfree (stdcmaps);
return False; return False;
} }
vid = sp->root_visual->visualid; vid = sp->root_visual->visualid;
...@@ -91,7 +91,7 @@ Status XGetStandardColormap ( ...@@ -91,7 +91,7 @@ Status XGetStandardColormap (
} }
if (i == nstdcmaps) { /* not found */ if (i == nstdcmaps) { /* not found */
Xfree ((char *) stdcmaps); Xfree (stdcmaps);
return False; return False;
} }
use = &stdcmaps[i]; use = &stdcmaps[i];
...@@ -111,7 +111,7 @@ Status XGetStandardColormap ( ...@@ -111,7 +111,7 @@ Status XGetStandardColormap (
cmap->blue_mult = use->blue_mult; cmap->blue_mult = use->blue_mult;
cmap->base_pixel = use->base_pixel; cmap->base_pixel = use->base_pixel;
Xfree ((char *) stdcmaps); /* don't need alloced memory */ Xfree (stdcmaps); /* don't need alloced memory */
} }
return stat; return stat;
} }
...@@ -77,7 +77,7 @@ Status XGetWMColormapWindows ( ...@@ -77,7 +77,7 @@ Status XGetWMColormapWindows (
return False; return False;
if (actual_type != XA_WINDOW || actual_format != 32) { if (actual_type != XA_WINDOW || actual_format != 32) {
if (data) Xfree ((char *) data); if (data) Xfree (data);
return False; return False;
} }
......
...@@ -77,7 +77,7 @@ Status XGetWMProtocols ( ...@@ -77,7 +77,7 @@ Status XGetWMProtocols (
return False; return False;
if (actual_type != XA_ATOM || actual_format != 32) { if (actual_type != XA_ATOM || actual_format != 32) {
if (data) Xfree ((char *) data); if (data) Xfree (data);
return False; return False;
} }
......
...@@ -186,7 +186,7 @@ XSetIMValues(XIM im, ...) ...@@ -186,7 +186,7 @@ XSetIMValues(XIM im, ...)
va_end(var); va_end(var);
ret = (*im->methods->set_values) (im, args); ret = (*im->methods->set_values) (im, args);
if (args) Xfree((char *)args); if (args) Xfree(args);
return ret; return ret;
} }
...@@ -213,7 +213,7 @@ XGetIMValues(XIM im, ...) ...@@ -213,7 +213,7 @@ XGetIMValues(XIM im, ...)
va_end(var); va_end(var);
ret = (*im->methods->get_values) (im, args); ret = (*im->methods->get_values) (im, args);
if (args) Xfree((char *)args); if (args) Xfree(args);
return ret; return ret;
} }
...@@ -245,7 +245,7 @@ XCreateIC(XIM im, ...) ...@@ -245,7 +245,7 @@ XCreateIC(XIM im, ...)
va_end(var); va_end(var);
ic = (XIC) (*im->methods->create_ic) (im, args); ic = (XIC) (*im->methods->create_ic) (im, args);
if (args) Xfree((char *)args); if (args) Xfree(args);
if (ic) { if (ic) {
ic->core.next = im->core.ic_chain; ic->core.next = im->core.ic_chain;
im->core.ic_chain = ic; im->core.ic_chain = ic;
...@@ -271,7 +271,7 @@ XDestroyIC(XIC ic) ...@@ -271,7 +271,7 @@ XDestroyIC(XIC ic)
} }
} }
} }
Xfree ((char *) ic); Xfree (ic);
} }
char * char *
...@@ -300,7 +300,7 @@ XGetICValues(XIC ic, ...) ...@@ -300,7 +300,7 @@ XGetICValues(XIC ic, ...)
va_end(var); va_end(var);
ret = (*ic->methods->get_values) (ic, args); ret = (*ic->methods->get_values) (ic, args);
if (args) Xfree((char *)args); if (args) Xfree(args);
return ret; return ret;
} }
...@@ -330,7 +330,7 @@ XSetICValues(XIC ic, ...) ...@@ -330,7 +330,7 @@ XSetICValues(XIC ic, ...)
va_end(var); va_end(var);
ret = (*ic->methods->set_values) (ic, args); ret = (*ic->methods->set_values) (ic, args);
if (args) Xfree((char *)args); if (args) Xfree(args);
return ret; return ret;
} }
......
...@@ -134,7 +134,7 @@ XCloseIM(XIM im) ...@@ -134,7 +134,7 @@ XCloseIM(XIM im)
s = (im->methods->close) (im); s = (im->methods->close) (im);
for (ic = im->core.ic_chain; ic; ic = ic->core.next) for (ic = im->core.ic_chain; ic; ic = ic->core.next)
ic->core.im = (XIM)NULL; ic->core.im = (XIM)NULL;
Xfree ((char *) im); Xfree (im);
_XCloseLC (lcd); _XCloseLC (lcd);
return (s); return (s);
} }
......
...@@ -434,9 +434,9 @@ Status XInitImage (XImage *image) ...@@ -434,9 +434,9 @@ Status XInitImage (XImage *image)
static int _XDestroyImage (XImage *ximage) static int _XDestroyImage (XImage *ximage)
{ {
if (ximage->data != NULL) Xfree((char *)ximage->data); if (ximage->data != NULL) Xfree(ximage->data);
if (ximage->obdata != NULL) Xfree((char *)ximage->obdata); if (ximage->obdata != NULL) Xfree(ximage->obdata);
Xfree((char *)ximage); Xfree(ximage);
return 1; return 1;
} }
...@@ -869,7 +869,7 @@ static XImage *_XSubImage ( ...@@ -869,7 +869,7 @@ static XImage *_XSubImage (
dsize = subimage->bytes_per_line * height; dsize = subimage->bytes_per_line * height;
if (subimage->format == XYPixmap) dsize = dsize * subimage->depth; if (subimage->format == XYPixmap) dsize = dsize * subimage->depth;
if (((data = Xcalloc (1, dsize)) == NULL) && (dsize > 0)) { if (((data = Xcalloc (1, dsize)) == NULL) && (dsize > 0)) {
Xfree((char *) subimage); Xfree(subimage);
return (XImage *) NULL; return (XImage *) NULL;
} }
subimage->data = data; subimage->data = data;
......
...@@ -51,7 +51,7 @@ XExtCodes *XInitExtension ( ...@@ -51,7 +51,7 @@ XExtCodes *XInitExtension (
LockDisplay (dpy); LockDisplay (dpy);
if (! (ext = Xcalloc (1, sizeof (_XExtension))) || if (! (ext = Xcalloc (1, sizeof (_XExtension))) ||
! (ext->name = strdup(name))) { ! (ext->name = strdup(name))) {
if (ext) Xfree((char *) ext); if (ext) Xfree(ext);
UnlockDisplay(dpy); UnlockDisplay(dpy);
return (XExtCodes *) NULL; return (XExtCodes *) NULL;
} }
......
...@@ -47,9 +47,9 @@ _XFreeAtomTable(Display *dpy) ...@@ -47,9 +47,9 @@ _XFreeAtomTable(Display *dpy)
table = dpy->atoms->table; table = dpy->atoms->table;
for (i = TABLESIZE; --i >= 0; ) { for (i = TABLESIZE; --i >= 0; ) {
if ((e = *table++) && (e != RESERVED)) if ((e = *table++) && (e != RESERVED))
Xfree((char *)e); Xfree(e);
} }
Xfree((char *)dpy->atoms); Xfree(dpy->atoms);
} }
} }
...@@ -153,7 +153,7 @@ _XUpdateAtomCache( ...@@ -153,7 +153,7 @@ _XUpdateAtomCache(
e->atom = atom; e->atom = atom;
strcpy(EntryName(e), name); strcpy(EntryName(e), name);
if ((oe = dpy->atoms->table[idx]) && (oe != RESERVED)) if ((oe = dpy->atoms->table[idx]) && (oe != RESERVED))
Xfree((char *)oe); Xfree(oe);
dpy->atoms->table[idx] = e; dpy->atoms->table[idx] = e;
} }
} }
......
...@@ -239,7 +239,7 @@ XRefreshKeyboardMapping(register XMappingEvent *event) ...@@ -239,7 +239,7 @@ XRefreshKeyboardMapping(register XMappingEvent *event)
*/ */
LockDisplay(event->display); LockDisplay(event->display);
if (event->display->keysyms) { if (event->display->keysyms) {
Xfree ((char *)event->display->keysyms); Xfree (event->display->keysyms);
event->display->keysyms = NULL; event->display->keysyms = NULL;
} }
UnlockDisplay(event->display); UnlockDisplay(event->display);
...@@ -277,7 +277,7 @@ _XKeyInitialize( ...@@ -277,7 +277,7 @@ _XKeyInitialize(
LockDisplay(dpy); LockDisplay(dpy);
if (dpy->keysyms) if (dpy->keysyms)
Xfree ((char *)dpy->keysyms); Xfree (dpy->keysyms);
dpy->keysyms = keysyms; dpy->keysyms = keysyms;
dpy->keysyms_per_keycode = per; dpy->keysyms_per_keycode = per;
if (dpy->modifiermap) if (dpy->modifiermap)
...@@ -974,8 +974,8 @@ _XFreeKeyBindings( ...@@ -974,8 +974,8 @@ _XFreeKeyBindings(
for (p = dpy->key_bindings; p; p = np) { for (p = dpy->key_bindings; p; p = np) {
np = p->next; np = p->next;
Xfree(p->string); Xfree(p->string);
Xfree((char *)p->modifiers); Xfree(p->modifiers);
Xfree((char *)p); Xfree(p);
} }
} }
...@@ -1002,8 +1002,8 @@ XRebindKeysym ( ...@@ -1002,8 +1002,8 @@ XRebindKeysym (
((! (p->modifiers = Xmalloc(nb))) && (nb > 0))) { ((! (p->modifiers = Xmalloc(nb))) && (nb > 0))) {
if (p) { if (p) {
if (p->string) Xfree(p->string); if (p->string) Xfree(p->string);
if (p->modifiers) Xfree((char *) p->modifiers); if (p->modifiers) Xfree(p->modifiers);
Xfree((char *) p); Xfree(p);
} }
UnlockDisplay(dpy); UnlockDisplay(dpy);
return 0; return 0;
......
...@@ -511,7 +511,7 @@ LINEAR_RGB_InitSCCData( ...@@ -511,7 +511,7 @@ LINEAR_RGB_InitSCCData(
*pValue++ = (long)_XcmsGetElement(format_return, &pChar, *pValue++ = (long)_XcmsGetElement(format_return, &pChar,
&nitems) / (XcmsFloat)XDCCC_NUMBER; &nitems) / (XcmsFloat)XDCCC_NUMBER;
} }
Xfree ((char *)property_return); Xfree (property_return);
pPerScrnInfo->screenWhitePt.spec.CIEXYZ.X = pPerScrnInfo->screenWhitePt.spec.CIEXYZ.X =
pScreenData->RGBtoXYZmatrix[0][0] + pScreenData->RGBtoXYZmatrix[0][0] +
pScreenData->RGBtoXYZmatrix[0][1] + pScreenData->RGBtoXYZmatrix[0][1] +
...@@ -662,7 +662,7 @@ LINEAR_RGB_InitSCCData( ...@@ -662,7 +662,7 @@ LINEAR_RGB_InitSCCData(
/* Create, initialize, and add map */ /* Create, initialize, and add map */
if (!(pNewMap = (XcmsIntensityMap *) if (!(pNewMap = (XcmsIntensityMap *)
Xcalloc (1, sizeof(XcmsIntensityMap)))) { Xcalloc (1, sizeof(XcmsIntensityMap)))) {
Xfree((char *)pScreenData); Xfree(pScreenData);
goto Free_property_return; goto Free_property_return;
} }
pNewMap->visualID = visualID; pNewMap->visualID = visualID;
...@@ -782,7 +782,7 @@ LINEAR_RGB_InitSCCData( ...@@ -782,7 +782,7 @@ LINEAR_RGB_InitSCCData(
#endif /* ALLDEBUG */ #endif /* ALLDEBUG */
} }
Xfree ((char *)property_return); Xfree (property_return);
/* Free the old memory and use the new structure created. */ /* Free the old memory and use the new structure created. */
LINEAR_RGB_FreeSCCData(pPerScrnInfo->screenData); LINEAR_RGB_FreeSCCData(pPerScrnInfo->screenData);
...@@ -796,28 +796,28 @@ LINEAR_RGB_InitSCCData( ...@@ -796,28 +796,28 @@ LINEAR_RGB_InitSCCData(
return(XcmsSuccess); return(XcmsSuccess);
FreeBlueTblElements: FreeBlueTblElements:
Xfree((char *)pScreenData->pBlueTbl->pBase); Xfree(pScreenData->pBlueTbl->pBase);
FreeBlueTbl: FreeBlueTbl:
Xfree((char *)pScreenData->pBlueTbl); Xfree(pScreenData->pBlueTbl);
FreeGreenTblElements: FreeGreenTblElements:
Xfree((char *)pScreenData->pGreenTbl->pBase); Xfree(pScreenData->pGreenTbl->pBase);
FreeGreenTbl: FreeGreenTbl:
Xfree((char *)pScreenData->pGreenTbl); Xfree(pScreenData->pGreenTbl);
FreeRedTblElements: FreeRedTblElements:
Xfree((char *)pScreenData->pRedTbl->pBase); Xfree(pScreenData->pRedTbl->pBase);
FreeRedTbl: FreeRedTbl:
Xfree((char *)pScreenData->pRedTbl); Xfree(pScreenData->pRedTbl);
Free_property_return: Free_property_return:
Xfree ((char *)property_return); Xfree (property_return);
FreeSCCData: FreeSCCData:
Xfree((char *)pScreenDefaultData); Xfree(pScreenDefaultData);
pPerScrnInfo->state = XcmsInitNone; pPerScrnInfo->state = XcmsInitNone;
return(XcmsFailure); return(XcmsFailure);
} }
...@@ -849,30 +849,30 @@ LINEAR_RGB_FreeSCCData( ...@@ -849,30 +849,30 @@ LINEAR_RGB_FreeSCCData(
if (pScreenData->pRedTbl->pBase != if (pScreenData->pRedTbl->pBase !=
pScreenData->pGreenTbl->pBase) { pScreenData->pGreenTbl->pBase) {
if (pScreenData->pGreenTbl->pBase) { if (pScreenData->pGreenTbl->pBase) {
Xfree ((char *)pScreenData->pGreenTbl->pBase); Xfree (pScreenData->pGreenTbl->pBase);
} }
} }
if (pScreenData->pGreenTbl != pScreenData->pRedTbl) { if (pScreenData->pGreenTbl != pScreenData->pRedTbl) {
Xfree ((char *)pScreenData->pGreenTbl); Xfree (pScreenData->pGreenTbl);
} }
} }
if (pScreenData->pBlueTbl) { if (pScreenData->pBlueTbl) {
if (pScreenData->pRedTbl->pBase != if (pScreenData->pRedTbl->pBase !=
pScreenData->pBlueTbl->pBase) { pScreenData->pBlueTbl->pBase) {
if (pScreenData->pBlueTbl->pBase) { if (pScreenData->pBlueTbl->pBase) {
Xfree ((char *)pScreenData->pBlueTbl->pBase); Xfree (pScreenData->pBlueTbl->pBase);
} }
} }
if (pScreenData->pBlueTbl != pScreenData->pRedTbl) { if (pScreenData->pBlueTbl != pScreenData->pRedTbl) {
Xfree ((char *)pScreenData->pBlueTbl); Xfree (pScreenData->pBlueTbl);
} }
} }
if (pScreenData->pRedTbl->pBase) { if (pScreenData->pRedTbl->pBase) {
Xfree ((char *)pScreenData->pRedTbl->pBase); Xfree (pScreenData->pRedTbl->pBase);
} }
Xfree ((char *)pScreenData->pRedTbl); Xfree (pScreenData->pRedTbl);
} }
Xfree ((char *)pScreenData); Xfree (pScreenData);
} }
} }
......
...@@ -62,8 +62,8 @@ char **XListExtensions( ...@@ -62,8 +62,8 @@ char **XListExtensions(
} }
if ((!list) || (!ch)) { if ((!list) || (!ch)) {
if (list) Xfree((char *) list); if (list) Xfree(list);
if (ch) Xfree((char *) ch); if (ch) Xfree(ch);
_XEatDataWords(dpy, rep.length); _XEatDataWords(dpy, rep.length);
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
...@@ -99,7 +99,7 @@ XFreeExtensionList (char **list) ...@@ -99,7 +99,7 @@ XFreeExtensionList (char **list)
{ {
if (list != NULL) { if (list != NULL) {
Xfree (list[0]-1); Xfree (list[0]-1);
Xfree ((char *)list); Xfree (list);
} }
return 1; return 1;
} }
...@@ -50,7 +50,7 @@ XGetModifierMapping(register Display *dpy) ...@@ -50,7 +50,7 @@ XGetModifierMapping(register Display *dpy)
} else } else
res = NULL; res = NULL;
if ((! res) || (! res->modifiermap)) { if ((! res) || (! res->modifiermap)) {
if (res) Xfree((char *) res); if (res) Xfree(res);
res = (XModifierKeymap *) NULL; res = (XModifierKeymap *) NULL;
_XEatDataWords(dpy, rep.length); _XEatDataWords(dpy, rep.length);
} else { } else {
...@@ -102,7 +102,7 @@ XNewModifiermap(int keyspermodifier) ...@@ -102,7 +102,7 @@ XNewModifiermap(int keyspermodifier)
Xmalloc(8 * keyspermodifier) Xmalloc(8 * keyspermodifier)
: (KeyCode *) NULL); : (KeyCode *) NULL);
if (keyspermodifier && (res->modifiermap == NULL)) { if (keyspermodifier && (res->modifiermap == NULL)) {
Xfree((char *) res); Xfree(res);
return (XModifierKeymap *) NULL; return (XModifierKeymap *) NULL;
} }
} }
...@@ -115,8 +115,8 @@ XFreeModifiermap(XModifierKeymap *map) ...@@ -115,8 +115,8 @@ XFreeModifiermap(XModifierKeymap *map)
{ {
if (map) { if (map) {
if (map->modifiermap) if (map->modifiermap)
Xfree((char *) map->modifiermap); Xfree(map->modifiermap);
Xfree((char *) map); Xfree(map);
} }
return 1; return 1;
} }
......
...@@ -866,7 +866,7 @@ void _XFreeDisplayStructure(Display *dpy) ...@@ -866,7 +866,7 @@ void _XFreeDisplayStructure(Display *dpy)
dpy->ext_procs = ext->next; dpy->ext_procs = ext->next;
if (ext->name) if (ext->name)
Xfree (ext->name); Xfree (ext->name);
Xfree ((char *)ext); Xfree (ext);
} }
if (dpy->im_filters) if (dpy->im_filters)
(*dpy->free_funcs->im_filters)(dpy); (*dpy->free_funcs->im_filters)(dpy);
...@@ -908,17 +908,17 @@ void _XFreeDisplayStructure(Display *dpy) ...@@ -908,17 +908,17 @@ void _XFreeDisplayStructure(Display *dpy)
for (k = 0; k < dp->nvisuals; k++) for (k = 0; k < dp->nvisuals; k++)
_XFreeExtData (dp->visuals[k].ext_data); _XFreeExtData (dp->visuals[k].ext_data);
Xfree ((char *) dp->visuals); Xfree (dp->visuals);
} }
} }
Xfree ((char *) sp->depths); Xfree (sp->depths);
} }
_XFreeExtData (sp->ext_data); _XFreeExtData (sp->ext_data);
} }
Xfree ((char *)dpy->screens); Xfree (dpy->screens);
} }
if (dpy->pixmap_format) { if (dpy->pixmap_format) {
...@@ -926,7 +926,7 @@ void _XFreeDisplayStructure(Display *dpy) ...@@ -926,7 +926,7 @@ void _XFreeDisplayStructure(Display *dpy)
for (i = 0; i < dpy->nformats; i++) for (i = 0; i < dpy->nformats; i++)
_XFreeExtData (dpy->pixmap_format[i].ext_data); _XFreeExtData (dpy->pixmap_format[i].ext_data);
Xfree ((char *)dpy->pixmap_format); Xfree (dpy->pixmap_format);
} }
if (dpy->display_name) if (dpy->display_name)
...@@ -937,15 +937,15 @@ void _XFreeDisplayStructure(Display *dpy) ...@@ -937,15 +937,15 @@ void _XFreeDisplayStructure(Display *dpy)
if (dpy->buffer) if (dpy->buffer)
Xfree (dpy->buffer); Xfree (dpy->buffer);
if (dpy->keysyms) if (dpy->keysyms)
Xfree ((char *) dpy->keysyms); Xfree (dpy->keysyms);
if (dpy->xdefaults) if (dpy->xdefaults)
Xfree (dpy->xdefaults); Xfree (dpy->xdefaults);
if (dpy->error_vec) if (dpy->error_vec)
Xfree ((char *)dpy->error_vec); Xfree (dpy->error_vec);
_XFreeExtData (dpy->ext_data); _XFreeExtData (dpy->ext_data);
if (dpy->free_funcs) if (dpy->free_funcs)
Xfree ((char *)dpy->free_funcs); Xfree (dpy->free_funcs);
if (dpy->scratch_buffer) if (dpy->scratch_buffer)
Xfree (dpy->scratch_buffer); Xfree (dpy->scratch_buffer);
FreeDisplayLock(dpy); FreeDisplayLock(dpy);
...@@ -955,7 +955,7 @@ void _XFreeDisplayStructure(Display *dpy) ...@@ -955,7 +955,7 @@ void _XFreeDisplayStructure(Display *dpy)
while (qelt) { while (qelt) {
register _XQEvent *qnxt = qelt->next; register _XQEvent *qnxt = qelt->next;
Xfree ((char *) qelt); Xfree (qelt);
qelt = qnxt; qelt = qnxt;
} }
} }
...@@ -978,7 +978,7 @@ void _XFreeDisplayStructure(Display *dpy) ...@@ -978,7 +978,7 @@ void _XFreeDisplayStructure(Display *dpy)
_XFreeX11XCBStructure(dpy); _XFreeX11XCBStructure(dpy);
#endif /* USE_XCB */ #endif /* USE_XCB */
Xfree ((char *)dpy); Xfree (dpy);
} }
/* OutOfMemory is called if malloc fails. XOpenDisplay returns NULL /* OutOfMemory is called if malloc fails. XOpenDisplay returns NULL
......
...@@ -378,7 +378,7 @@ FreeStorage( ...@@ -378,7 +378,7 @@ FreeStorage(
while (pSLLBlock) while (pSLLBlock)
{ {
tmpSLLBlock = pSLLBlock->next; tmpSLLBlock = pSLLBlock->next;
Xfree((char *)pSLLBlock); Xfree(pSLLBlock);
pSLLBlock = tmpSLLBlock; pSLLBlock = tmpSLLBlock;
} }
} }
...@@ -627,9 +627,9 @@ XPolygonRegion( ...@@ -627,9 +627,9 @@ XPolygonRegion(
(void) PtsToRegion(numFullPtBlocks, iPts, &FirstPtBlock, region); (void) PtsToRegion(numFullPtBlocks, iPts, &FirstPtBlock, region);
for (curPtBlock = FirstPtBlock.next; --numFullPtBlocks >= 0;) { for (curPtBlock = FirstPtBlock.next; --numFullPtBlocks >= 0;) {
tmpPtBlock = curPtBlock->next; tmpPtBlock = curPtBlock->next;
Xfree((char *)curPtBlock); Xfree(curPtBlock);
curPtBlock = tmpPtBlock; curPtBlock = tmpPtBlock;
} }
Xfree((char *)pETEs); Xfree(pETEs);
return(region); return(region);
} }
...@@ -794,7 +794,7 @@ SendZImage( ...@@ -794,7 +794,7 @@ SendZImage(
((req_yoffset + req->height) < (unsigned)image->height))) { ((req_yoffset + req->height) < (unsigned)image->height))) {
Data(dpy, (char *)src, length); Data(dpy, (char *)src, length);
if (shifted_src) if (shifted_src)
Xfree((char *)shifted_src); Xfree(shifted_src);
return; return;
} }
...@@ -804,7 +804,7 @@ SendZImage( ...@@ -804,7 +804,7 @@ SendZImage(
else else
if ((dest = (unsigned char *) if ((dest = (unsigned char *)
_XAllocScratch(dpy, length)) == NULL) { _XAllocScratch(dpy, length)) == NULL) {
if (shifted_src) Xfree((char *) shifted_src); if (shifted_src) Xfree(shifted_src);
UnGetReq(PutImage); UnGetReq(PutImage);
return; return;
} }
...@@ -832,7 +832,7 @@ SendZImage( ...@@ -832,7 +832,7 @@ SendZImage(
_XSend(dpy, (char *)dest, length); _XSend(dpy, (char *)dest, length);
if (shifted_src) if (shifted_src)
Xfree((char *)shifted_src); Xfree(shifted_src);
} }
static void static void
......
...@@ -64,7 +64,7 @@ _XQueryColors( ...@@ -64,7 +64,7 @@ _XQueryColors(
def->blue = rgb->blue; def->blue = rgb->blue;
def->flags = DoRed | DoGreen | DoBlue; def->flags = DoRed | DoGreen | DoBlue;
} }
Xfree((char *)color); Xfree(color);
} }
else else
_XEatDataWords(dpy, rep.length); _XEatDataWords(dpy, rep.length);
......
...@@ -230,7 +230,7 @@ ExpandQuarkTable(void) ...@@ -230,7 +230,7 @@ ExpandQuarkTable(void)
} }
} }
if (oldmask) if (oldmask)
Xfree((char *)oldentries); Xfree(oldentries);
return True; return True;
} }
......
...@@ -137,7 +137,7 @@ XReadBitmapFileData ( ...@@ -137,7 +137,7 @@ XReadBitmapFileData (
/* error cleanup and return macro */ /* error cleanup and return macro */
#define RETURN(code) \ #define RETURN(code) \
{ if (bits) Xfree ((char *)bits); fclose (fstream); return code; } { if (bits) Xfree (bits); fclose (fstream); return code; }
while (fgets(line, MAX_SIZE, fstream)) { while (fgets(line, MAX_SIZE, fstream)) {
if (strlen(line) == MAX_SIZE-1) if (strlen(line) == MAX_SIZE-1)
...@@ -254,7 +254,7 @@ XReadBitmapFile ( ...@@ -254,7 +254,7 @@ XReadBitmapFile (
if (res != BitmapSuccess) if (res != BitmapSuccess)
return res; return res;
*pixmap = XCreateBitmapFromData(display, d, (char *)data, *width, *height); *pixmap = XCreateBitmapFromData(display, d, (char *)data, *width, *height);
Xfree((char *)data); Xfree(data);
if (*pixmap == None) if (*pixmap == None)
return (BitmapNoMemory); return (BitmapNoMemory);
return (BitmapSuccess); return (BitmapSuccess);
......
...@@ -142,7 +142,7 @@ XCreateRegion(void) ...@@ -142,7 +142,7 @@ XCreateRegion(void)
if (! (temp = Xmalloc(sizeof( REGION )))) if (! (temp = Xmalloc(sizeof( REGION ))))
return (Region) NULL; return (Region) NULL;
if (! (temp->rects = Xmalloc(sizeof( BOX )))) { if (! (temp->rects = Xmalloc(sizeof( BOX )))) {
Xfree((char *) temp); Xfree(temp);
return (Region) NULL; return (Region) NULL;
} }
temp->numRects = 0; temp->numRects = 0;
...@@ -994,11 +994,11 @@ miRegionOp( ...@@ -994,11 +994,11 @@ miRegionOp(
* the region is empty * the region is empty
*/ */
newReg->size = 1; newReg->size = 1;
Xfree((char *) newReg->rects); Xfree(newReg->rects);
newReg->rects = Xmalloc(sizeof(BoxRec)); newReg->rects = Xmalloc(sizeof(BoxRec));
} }
} }
Xfree ((char *) oldRects); Xfree (oldRects);
return; return;
} }
......
...@@ -66,7 +66,7 @@ _XFreeIMFilters( ...@@ -66,7 +66,7 @@ _XFreeIMFilters(
while ((fl = display->im_filters)) { while ((fl = display->im_filters)) {
display->im_filters = fl->next; display->im_filters = fl->next;
Xfree((char *)fl); Xfree(fl);
} }
} }
...@@ -148,7 +148,7 @@ _XUnregisterFilter( ...@@ -148,7 +148,7 @@ _XUnregisterFilter(
if (fl->window == window && if (fl->window == window &&
fl->filter == filter && fl->client_data == client_data) { fl->filter == filter && fl->client_data == client_data) {
*prev = fl->next; *prev = fl->next;
Xfree((char *)fl); Xfree(fl);
} else } else
prev = &fl->next; prev = &fl->next;
} }
......
...@@ -65,7 +65,7 @@ XSetFontPath ( ...@@ -65,7 +65,7 @@ XSetFontPath (
p += length + 1; p += length + 1;
} }
Data (dpy, tmp, nbytes); Data (dpy, tmp, nbytes);
Xfree ((char *) tmp); Xfree (tmp);
retCode = 1; retCode = 1;
} }
else else
......
...@@ -251,7 +251,7 @@ _XcmsSetGetColors( ...@@ -251,7 +251,7 @@ _XcmsSetGetColors(
*/ */
if ((retval = XcmsConvertColors(ccc, pColors_in_out, nColors, XcmsRGBFormat, if ((retval = XcmsConvertColors(ccc, pColors_in_out, nColors, XcmsRGBFormat,
pCompressed)) == XcmsFailure) { pCompressed)) == XcmsFailure) {
Xfree((char *)pXColors_in_out); Xfree(pXColors_in_out);
return(XcmsFailure); return(XcmsFailure);
} }
...@@ -268,12 +268,12 @@ Query: ...@@ -268,12 +268,12 @@ Query:
/* Note: XQueryColors and XStoreColors do not return any Status */ /* Note: XQueryColors and XStoreColors do not return any Status */
(*xColorProc)(ccc->dpy, cmap, pXColors_in_out, nColors); (*xColorProc)(ccc->dpy, cmap, pXColors_in_out, nColors);
} else { } else {
Xfree((char *)pXColors_in_out); Xfree(pXColors_in_out);
return(XcmsFailure); return(XcmsFailure);
} }
if (*xColorProc == XStoreColors) { if (*xColorProc == XStoreColors) {
Xfree((char *)pXColors_in_out); Xfree(pXColors_in_out);
return(retval); return(retval);
} }
...@@ -281,7 +281,7 @@ Query: ...@@ -281,7 +281,7 @@ Query:
* Now, convert the returned XColor (i.e., rgb) to XcmsColor structures * Now, convert the returned XColor (i.e., rgb) to XcmsColor structures
*/ */
_XColor_to_XcmsRGB(ccc, pXColors_in_out, pColors_in_out, nColors); _XColor_to_XcmsRGB(ccc, pXColors_in_out, pColors_in_out, nColors);
Xfree((char *)pXColors_in_out); Xfree(pXColors_in_out);
/* /*
* Then, convert XcmsColor structures to the original specification * Then, convert XcmsColor structures to the original specification
......
...@@ -198,7 +198,7 @@ XSetIconSizes ( ...@@ -198,7 +198,7 @@ XSetIconSizes (
XChangeProperty (dpy, w, XA_WM_ICON_SIZE, XA_WM_ICON_SIZE, 32, XChangeProperty (dpy, w, XA_WM_ICON_SIZE, XA_WM_ICON_SIZE, 32,
PropModeReplace, (unsigned char *) prop, PropModeReplace, (unsigned char *) prop,
count * NumPropIconSizeElements); count * NumPropIconSizeElements);
Xfree ((char *)prop); Xfree (prop);
} }
return 1; return 1;
} }
......
...@@ -95,6 +95,6 @@ void XSetRGBColormaps ( ...@@ -95,6 +95,6 @@ void XSetRGBColormaps (
XChangeProperty (dpy, w, property, XA_RGB_COLOR_MAP, 32, XChangeProperty (dpy, w, property, XA_RGB_COLOR_MAP, 32,
PropModeReplace, (unsigned char *) data, PropModeReplace, (unsigned char *) data,
(int) (count * NumPropStandardColormapElements)); (int) (count * NumPropStandardColormapElements));
Xfree ((char *) data); Xfree (data);
} }
} }
...@@ -74,7 +74,7 @@ char *XFetchBuffer ( ...@@ -74,7 +74,7 @@ char *XFetchBuffer (
*nbytes = nitems; *nbytes = nitems;
return((char *)data); return((char *)data);
} }
if ((char *) data != NULL) Xfree ((char *)data); if ((char *) data != NULL) Xfree (data);
return(NULL); return(NULL);
} }
......
...@@ -102,7 +102,7 @@ XcmsStoreColors( ...@@ -102,7 +102,7 @@ XcmsStoreColors(
* Free copies as needed. * Free copies as needed.
*/ */
if (nColors > 1) { if (nColors > 1) {
Xfree((char *)pColors_tmp); Xfree(pColors_tmp);
} }
/* /*
......
...@@ -77,7 +77,7 @@ Status XTextPropertyToStringList ( ...@@ -77,7 +77,7 @@ Status XTextPropertyToStringList (
start = Xmalloc ((datalen + 1) * sizeof (char)); /* for <NUL> */ start = Xmalloc ((datalen + 1) * sizeof (char)); /* for <NUL> */
if (!start) { if (!start) {
Xfree ((char *) list); Xfree (list);
return False; return False;
} }
...@@ -111,7 +111,7 @@ void XFreeStringList (char **list) ...@@ -111,7 +111,7 @@ void XFreeStringList (char **list)
{ {
if (list) { if (list) {
if (list[0]) Xfree (list[0]); if (list[0]) Xfree (list[0]);
Xfree ((char *) list); Xfree (list);
list = NULL; list = NULL;
} }
} }
......
...@@ -133,7 +133,7 @@ XVisualInfo *XGetVisualInfo( ...@@ -133,7 +133,7 @@ XVisualInfo *XGetVisualInfo(
total += 10; total += 10;
if (! (vip_base = Xrealloc(vip_base, if (! (vip_base = Xrealloc(vip_base,
sizeof(XVisualInfo) * total))) { sizeof(XVisualInfo) * total))) {
Xfree((char *) old_vip_base); Xfree(old_vip_base);
UnlockDisplay(dpy); UnlockDisplay(dpy);
return (XVisualInfo *) NULL; return (XVisualInfo *) NULL;
} }
...@@ -170,7 +170,7 @@ XVisualInfo *XGetVisualInfo( ...@@ -170,7 +170,7 @@ XVisualInfo *XGetVisualInfo(
return vip_base; return vip_base;
} }
Xfree((char *) vip_base); Xfree(vip_base);
*nitems = 0; *nitems = 0;
return NULL; return NULL;
} }
......
...@@ -531,7 +531,7 @@ static void MoveValues( ...@@ -531,7 +531,7 @@ static void MoveValues(
fentry->next = tentry; fentry->next = tentry;
} }
} }
Xfree((char *)ftable->buckets); Xfree(ftable->buckets);
} }
/* move all tables from ftable to ttable, and free ftable. /* move all tables from ftable to ttable, and free ftable.
...@@ -558,7 +558,7 @@ static void MoveTables( ...@@ -558,7 +558,7 @@ static void MoveTables(
fentry->next = tentry; fentry->next = tentry;
} }
} }
Xfree((char *)ftable); Xfree(ftable);
} }
/* grow the table, based on current number of entries */ /* grow the table, based on current number of entries */
...@@ -649,7 +649,7 @@ static void MergeValues( ...@@ -649,7 +649,7 @@ static void MergeValues(
fentry = *prev; fentry = *prev;
*prev = tentry->next; *prev = tentry->next;
/* free the overridden entry */ /* free the overridden entry */
Xfree((char *)tentry); Xfree(tentry);
/* get next tentry */ /* get next tentry */
tentry = *prev; tentry = *prev;
} else { } else {
...@@ -658,7 +658,7 @@ static void MergeValues( ...@@ -658,7 +658,7 @@ static void MergeValues(
tentry = fentry; /* use as a temp var */ tentry = fentry; /* use as a temp var */
fentry = fentry->next; fentry = fentry->next;
/* free the overpowered entry */ /* free the overpowered entry */
Xfree((char *)tentry); Xfree(tentry);
/* get next tentry */ /* get next tentry */
tentry = *prev; tentry = *prev;
} }
...@@ -676,8 +676,8 @@ static void MergeValues( ...@@ -676,8 +676,8 @@ static void MergeValues(
} }
} }
} }
Xfree((char *)ftable->buckets); Xfree(ftable->buckets);
Xfree((char *)ftable); Xfree(ftable);
/* resize if necessary, now that we're all done */ /* resize if necessary, now that we're all done */
GROW(pprev); GROW(pprev);
} }
...@@ -751,7 +751,7 @@ static void MergeTables( ...@@ -751,7 +751,7 @@ static void MergeTables(
} }
} }
} }
Xfree((char *)ftable); Xfree(ftable);
/* resize if necessary, now that we're all done */ /* resize if necessary, now that we're all done */
GROW(pprev); GROW(pprev);
} }
...@@ -801,7 +801,7 @@ void XrmCombineDatabase( ...@@ -801,7 +801,7 @@ void XrmCombineDatabase(
(from->methods->destroy)(from->mbstate); (from->methods->destroy)(from->mbstate);
_XUnlockMutex(&from->linfo); _XUnlockMutex(&from->linfo);
_XFreeMutex(&from->linfo); _XFreeMutex(&from->linfo);
Xfree((char *)from); Xfree(from);
_XUnlockMutex(&(*into)->linfo); _XUnlockMutex(&(*into)->linfo);
} }
} }
...@@ -929,7 +929,7 @@ static void PutEntry( ...@@ -929,7 +929,7 @@ static void PutEntry(
} }
/* splice out and free old entry */ /* splice out and free old entry */
*vprev = entry->next; *vprev = entry->next;
Xfree((char *)entry); Xfree(entry);
(*pprev)->entries--; (*pprev)->entries--;
} }
/* this is where to insert */ /* this is where to insert */
...@@ -2605,11 +2605,11 @@ static void DestroyLTable( ...@@ -2605,11 +2605,11 @@ static void DestroyLTable(
for (i = table->table.mask; i >= 0; i--, buckets++) { for (i = table->table.mask; i >= 0; i--, buckets++) {
for (next = *buckets; (entry = next); ) { for (next = *buckets; (entry = next); ) {
next = entry->next; next = entry->next;
Xfree((char *)entry); Xfree(entry);
} }
} }
Xfree((char *)table->buckets); Xfree(table->buckets);
Xfree((char *)table); Xfree(table);
} }
/* destroy all contained tables, plus table itself */ /* destroy all contained tables, plus table itself */
...@@ -2630,7 +2630,7 @@ static void DestroyNTable( ...@@ -2630,7 +2630,7 @@ static void DestroyNTable(
DestroyNTable(entry); DestroyNTable(entry);
} }
} }
Xfree((char *)table); Xfree(table);
} }
const char * const char *
...@@ -2661,6 +2661,6 @@ void XrmDestroyDatabase( ...@@ -2661,6 +2661,6 @@ void XrmDestroyDatabase(
_XUnlockMutex(&db->linfo); _XUnlockMutex(&db->linfo);
_XFreeMutex(&db->linfo); _XFreeMutex(&db->linfo);
(*db->methods->destroy)(db->mbstate); (*db->methods->destroy)(db->mbstate);
Xfree((char *)db); Xfree(db);
} }
} }
...@@ -191,7 +191,7 @@ CmapRecForColormap( ...@@ -191,7 +191,7 @@ CmapRecForColormap(
SyncHandle(); SyncHandle();
} while (async_state.error_count > 0 && ++j < nVisualsMatched); } while (async_state.error_count > 0 && ++j < nVisualsMatched);
Xfree((char *)visualList); Xfree(visualList);
/* /*
* if successful * if successful
...@@ -352,7 +352,7 @@ _XcmsDeleteCmapRec( ...@@ -352,7 +352,7 @@ _XcmsDeleteCmapRec(
XcmsFreeCCC(pRec->ccc); XcmsFreeCCC(pRec->ccc);
} }
*pPrevPtr = pRec->pNext; *pPrevPtr = pRec->pNext;
Xfree((char *)pRec); Xfree(pRec);
} }
} }
...@@ -387,7 +387,7 @@ _XcmsFreeClientCmaps( ...@@ -387,7 +387,7 @@ _XcmsFreeClientCmaps(
XcmsFreeCCC(pRecFree->ccc); XcmsFreeCCC(pRecFree->ccc);
} }
/* Now free the XcmsCmapRec structure */ /* Now free the XcmsCmapRec structure */
Xfree((char *)pRecFree); Xfree(pRecFree);
} }
dpy->cms.clientCmaps = (XPointer)NULL; dpy->cms.clientCmaps = (XPointer)NULL;
} }
......
...@@ -1105,10 +1105,10 @@ _XimProtoCloseIM( ...@@ -1105,10 +1105,10 @@ _XimProtoCloseIM(
next = ic->core.next; next = ic->core.next;
#ifdef XIM_CONNECTABLE #ifdef XIM_CONNECTABLE
if (!(!IS_SERVER_CONNECTED(im) && IS_RECONNECTABLE(im))) { if (!(!IS_SERVER_CONNECTED(im) && IS_RECONNECTABLE(im))) {
Xfree ((char *) ic); Xfree (ic);
} }
#else #else
Xfree ((char *) ic); Xfree (ic);
#endif /* XIM_CONNECTABLE */ #endif /* XIM_CONNECTABLE */
ic = next; ic = next;
} }
......
...@@ -231,7 +231,7 @@ _XimLocalCloseIM( ...@@ -231,7 +231,7 @@ _XimLocalCloseIM(
while (ic) { while (ic) {
(*ic->methods->destroy) (ic); (*ic->methods->destroy) (ic);
next = ic->core.next; next = ic->core.next;
Xfree ((char *) ic); Xfree (ic);
ic = next; ic = next;
} }
_XimLocalIMFree(im); _XimLocalIMFree(im);
......
...@@ -227,7 +227,7 @@ _XimThaiCloseIM(XIM xim) ...@@ -227,7 +227,7 @@ _XimThaiCloseIM(XIM xim)
while (ic) { while (ic) {
(*ic->methods->destroy) (ic); (*ic->methods->destroy) (ic);
next = ic->core.next; next = ic->core.next;
Xfree ((char *) ic); Xfree (ic);
ic = next; ic = next;
} }
_XimThaiIMFree(im); _XimThaiIMFree(im);
......
...@@ -1187,7 +1187,7 @@ close_converter( ...@@ -1187,7 +1187,7 @@ close_converter(
XlcConv conv) XlcConv conv)
{ {
/* conv->state is allocated together with conv, free both at once. */ /* conv->state is allocated together with conv, free both at once. */
Xfree((char *) conv); Xfree(conv);
} }
......
...@@ -186,7 +186,7 @@ _XlcCreateDefaultCharSet( ...@@ -186,7 +186,7 @@ _XlcCreateDefaultCharSet(
/* Fill in name and xrm_name. */ /* Fill in name and xrm_name. */
tmp = Xmalloc(name_len + 1 + ct_sequence_len + 1); tmp = Xmalloc(name_len + 1 + ct_sequence_len + 1);
if (tmp == NULL) { if (tmp == NULL) {
Xfree((char *) charset); Xfree(charset);
return (XlcCharSet) NULL; return (XlcCharSet) NULL;
} }
memcpy(tmp, name, name_len+1); memcpy(tmp, name, name_len+1);
...@@ -199,7 +199,7 @@ _XlcCreateDefaultCharSet( ...@@ -199,7 +199,7 @@ _XlcCreateDefaultCharSet(
char *encoding_tmp = Xmalloc(length + 1); char *encoding_tmp = Xmalloc(length + 1);
if (encoding_tmp == NULL) { if (encoding_tmp == NULL) {
Xfree((char *) charset->name); Xfree((char *) charset->name);
Xfree((char *) charset); Xfree(charset);
return (XlcCharSet) NULL; return (XlcCharSet) NULL;
} }
memcpy(encoding_tmp, charset->name, length); memcpy(encoding_tmp, charset->name, length);
......
...@@ -199,10 +199,10 @@ close_indirect_converter( ...@@ -199,10 +199,10 @@ close_indirect_converter(
if (conv->to_conv) if (conv->to_conv)
close_converter(conv->to_conv); close_converter(conv->to_conv);
Xfree((char *) conv); Xfree(conv);
} }
Xfree((char *) lc_conv); Xfree(lc_conv);
} }
static void static void
......
...@@ -196,7 +196,7 @@ clear_parse_info (void) ...@@ -196,7 +196,7 @@ clear_parse_info (void)
if (*parse_info.value) { if (*parse_info.value) {
Xfree(*parse_info.value); Xfree(*parse_info.value);
} }
Xfree((char *)parse_info.value); Xfree(parse_info.value);
} }
ptr = parse_info.buf; ptr = parse_info.buf;
size = parse_info.bufMaxSize; size = parse_info.bufMaxSize;
...@@ -1033,10 +1033,10 @@ DestroyDatabase( ...@@ -1033,10 +1033,10 @@ DestroyDatabase(
if (*p->value != NULL) { if (*p->value != NULL) {
Xfree(*p->value); Xfree(*p->value);
} }
Xfree((char *)p->value); Xfree(p->value);
} }
db = p->next; db = p->next;
Xfree((char *)p); Xfree(p);
p = db; p = db;
} }
} }
...@@ -1249,7 +1249,7 @@ _XlcDestroyLocaleDataBase( ...@@ -1249,7 +1249,7 @@ _XlcDestroyLocaleDataBase(
if (p->lc_db == lc_db) { if (p->lc_db == lc_db) {
if ((-- p->ref_count) < 1) { if ((-- p->ref_count) < 1) {
if (p->lc_db != (XlcDatabase)NULL) { if (p->lc_db != (XlcDatabase)NULL) {
Xfree((char *)p->lc_db); Xfree(p->lc_db);
} }
DestroyDatabase(p->database); DestroyDatabase(p->database);
if (prev == (XlcDatabaseList)NULL) { if (prev == (XlcDatabaseList)NULL) {
...@@ -1331,7 +1331,7 @@ _XlcCreateLocaleDataBase( ...@@ -1331,7 +1331,7 @@ _XlcCreateLocaleDataBase(
err: err:
DestroyDatabase(database); DestroyDatabase(database);
if (lc_db != (XlcDatabase)NULL) { if (lc_db != (XlcDatabase)NULL) {
Xfree((char *)lc_db); Xfree(lc_db);
} }
Xfree (name); Xfree (name);
return (XPointer)NULL; return (XPointer)NULL;
......
...@@ -564,9 +564,9 @@ close_converter( ...@@ -564,9 +564,9 @@ close_converter(
XlcConv conv) XlcConv conv)
{ {
if (conv->state) if (conv->state)
Xfree((char *) conv->state); Xfree(conv->state);
Xfree((char *) conv); Xfree(conv);
} }
static XlcConv static XlcConv
......
...@@ -1363,7 +1363,7 @@ static void ...@@ -1363,7 +1363,7 @@ static void
close_converter( close_converter(
XlcConv conv) XlcConv conv)
{ {
Xfree((char *) conv); Xfree(conv);
} }
enum { MBSTOCS, WCSTOCS, MBTOCS, CSTOMBS, CSTOWCS, MBSTOWCS, WCSTOMBS, enum { MBSTOCS, WCSTOCS, MBTOCS, CSTOMBS, CSTOWCS, MBSTOWCS, WCSTOMBS,
......
...@@ -1224,7 +1224,7 @@ stdc_wcstocts( ...@@ -1224,7 +1224,7 @@ stdc_wcstocts(
ret: ret:
if (buf) if (buf)
Xfree((char *)buf); Xfree(buf);
return (unconv_num1 + unconv_num2); return (unconv_num1 + unconv_num2);
} }
...@@ -1544,7 +1544,7 @@ stdc_ctstowcs( ...@@ -1544,7 +1544,7 @@ stdc_ctstowcs(
ret: ret:
if (buf) if (buf)
Xfree((char *)buf); Xfree(buf);
return (unconv_num1 + unconv_num2); return (unconv_num1 + unconv_num2);
} }
...@@ -1580,7 +1580,7 @@ stdc_cstowcs( ...@@ -1580,7 +1580,7 @@ stdc_cstowcs(
ret: ret:
if (buf) if (buf)
Xfree((char *)buf); Xfree(buf);
return (unconv_num1 + unconv_num2); return (unconv_num1 + unconv_num2);
} }
...@@ -1616,7 +1616,7 @@ mbstocts( ...@@ -1616,7 +1616,7 @@ mbstocts(
ret: ret:
if (buf) if (buf)
Xfree((char *)buf); Xfree(buf);
return (unconv_num1 + unconv_num2); return (unconv_num1 + unconv_num2);
} }
...@@ -2063,7 +2063,7 @@ stdc_wcstostr( ...@@ -2063,7 +2063,7 @@ stdc_wcstostr(
ret: ret:
if (buf) if (buf)
Xfree((char *)buf); Xfree(buf);
return (unconv_num1 + unconv_num2); return (unconv_num1 + unconv_num2);
} }
...@@ -2338,7 +2338,7 @@ ctstombs( ...@@ -2338,7 +2338,7 @@ ctstombs(
ret: ret:
if (buf) if (buf)
Xfree((char *)buf); Xfree(buf);
return (unconv_num1 + unconv_num2); return (unconv_num1 + unconv_num2);
} }
...@@ -2374,7 +2374,7 @@ cstombs( ...@@ -2374,7 +2374,7 @@ cstombs(
ret: ret:
if (buf) if (buf)
Xfree((char *)buf); Xfree(buf);
return (unconv_num1 + unconv_num2); return (unconv_num1 + unconv_num2);
} }
...@@ -2583,7 +2583,7 @@ stdc_strtowcs( ...@@ -2583,7 +2583,7 @@ stdc_strtowcs(
ret: ret:
if (buf) if (buf)
Xfree((char *)buf); Xfree(buf);
return (unconv_num1 + unconv_num2); return (unconv_num1 + unconv_num2);
} }
...@@ -2597,14 +2597,14 @@ close_converter( ...@@ -2597,14 +2597,14 @@ close_converter(
XlcConv conv) XlcConv conv)
{ {
if (conv->state) { if (conv->state) {
Xfree((char *) conv->state); Xfree(conv->state);
} }
if (conv->methods) { if (conv->methods) {
Xfree((char *) conv->methods); Xfree(conv->methods);
} }
Xfree((char *) conv); Xfree(conv);
} }
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
......
...@@ -520,10 +520,10 @@ close_converter( ...@@ -520,10 +520,10 @@ close_converter(
XlcConv conv) XlcConv conv)
{ {
if (conv->state) { if (conv->state) {
Xfree((char *) conv->state); Xfree(conv->state);
} }
Xfree((char *) conv); Xfree(conv);
} }
static XlcConv static XlcConv
......
...@@ -85,7 +85,7 @@ ub_destroy( ...@@ -85,7 +85,7 @@ ub_destroy(
XPointer state) XPointer state)
{ {
_XCloseLC(((UbState) state)->lcd); _XCloseLC(((UbState) state)->lcd);
Xfree((char *) state); Xfree(state);
} }
static const XrmMethodsRec ub_methods = { static const XrmMethodsRec ub_methods = {
...@@ -177,7 +177,7 @@ mb_destroy( ...@@ -177,7 +177,7 @@ mb_destroy(
{ {
_XlcCloseConverter(((MbState) state)->conv); _XlcCloseConverter(((MbState) state)->conv);
_XCloseLC(((MbState) state)->lcd); _XCloseLC(((MbState) state)->lcd);
Xfree((char *) state); Xfree(state);
} }
static const XrmMethodsRec mb_methods = { static const XrmMethodsRec mb_methods = {
...@@ -214,7 +214,7 @@ _XrmDefaultInitParseInfo( ...@@ -214,7 +214,7 @@ _XrmDefaultInitParseInfo(
state->lcd = lcd; state->lcd = lcd;
state->conv = _XlcOpenConverter(lcd, XlcNMultiByte, lcd, XlcNWideChar); state->conv = _XlcOpenConverter(lcd, XlcNMultiByte, lcd, XlcNWideChar);
if (state->conv == NULL) { if (state->conv == NULL) {
Xfree((char *) state); Xfree(state);
return (XrmMethods) NULL; return (XrmMethods) NULL;
} }
......
...@@ -1420,7 +1420,7 @@ static void ...@@ -1420,7 +1420,7 @@ static void
close_converter( close_converter(
XlcConv conv) XlcConv conv)
{ {
Xfree((char *) conv); Xfree(conv);
} }
......
...@@ -100,7 +100,7 @@ static void ...@@ -100,7 +100,7 @@ static void
close_converter( close_converter(
XlcConv conv) XlcConv conv)
{ {
Xfree((char *) conv); Xfree(conv);
} }
/* Replacement character for invalid multibyte sequence or wide character. */ /* Replacement character for invalid multibyte sequence or wide character. */
...@@ -539,7 +539,7 @@ close_tocs_converter( ...@@ -539,7 +539,7 @@ close_tocs_converter(
XlcConv conv) XlcConv conv)
{ {
/* conv->state is allocated together with conv, free both at once. */ /* conv->state is allocated together with conv, free both at once. */
Xfree((char *) conv); Xfree(conv);
} }
/* /*
......
...@@ -312,8 +312,8 @@ static void _XPopReader( ...@@ -312,8 +312,8 @@ static void _XPopReader(
dpy->lock->num_free_cvls++; dpy->lock->num_free_cvls++;
} else { } else {
xcondition_clear(front->cv); xcondition_clear(front->cv);
Xfree((char *)front->cv); Xfree(front->cv);
Xfree((char *)front); Xfree(front);
} }
} }
...@@ -419,14 +419,14 @@ static void _XFreeDisplayLock( ...@@ -419,14 +419,14 @@ static void _XFreeDisplayLock(
while ((cvl = dpy->lock->free_cvls)) { while ((cvl = dpy->lock->free_cvls)) {
dpy->lock->free_cvls = cvl->next; dpy->lock->free_cvls = cvl->next;
xcondition_clear(cvl->cv); xcondition_clear(cvl->cv);
Xfree((char *)cvl->cv); Xfree(cvl->cv);
Xfree((char *)cvl); Xfree(cvl);
} }
Xfree((char *)dpy->lock); Xfree(dpy->lock);
dpy->lock = NULL; dpy->lock = NULL;
} }
if (dpy->lock_fns != NULL) { if (dpy->lock_fns != NULL) {
Xfree((char *)dpy->lock_fns); Xfree(dpy->lock_fns);
dpy->lock_fns = NULL; dpy->lock_fns = NULL;
} }
} }
......
...@@ -61,9 +61,9 @@ XmbSetWMProperties ( ...@@ -61,9 +61,9 @@ XmbSetWMProperties (
XSetWMProperties(dpy, w, wprop, iprop, argv, argc, XSetWMProperties(dpy, w, wprop, iprop, argv, argc,
sizeHints, wmHints, classHints); sizeHints, wmHints, classHints);
if (wprop) if (wprop)
Xfree((char *)wname.value); Xfree(wname.value);
if (iprop) if (iprop)
Xfree((char *)iname.value); Xfree(iname.value);
/* Note: The WM_LOCALE_NAME property is set by XSetWMProperties. */ /* Note: The WM_LOCALE_NAME property is set by XSetWMProperties. */
} }
...@@ -83,9 +83,9 @@ Xutf8SetWMProperties ( ...@@ -83,9 +83,9 @@ Xutf8SetWMProperties (
XSetWMProperties(dpy, w, wprop, iprop, argv, argc, XSetWMProperties(dpy, w, wprop, iprop, argv, argc,
sizeHints, wmHints, classHints); sizeHints, wmHints, classHints);
if (wprop) if (wprop)
Xfree((char *)wname.value); Xfree(wname.value);
if (iprop) if (iprop)
Xfree((char *)iname.value); Xfree(iname.value);
/* Note: The WM_LOCALE_NAME property is set by XSetWMProperties. */ /* Note: The WM_LOCALE_NAME property is set by XSetWMProperties. */
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment