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