From acf87144d019f18e646501657d9082c6eba77f54 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 26 Jun 2016 01:38:22 +0200 Subject: nx-X11/programs/Xserver: Drop {X,x}free() macros, use free() instead. Fixes ArcticaProject/nx-libs#105 --- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 90 ++++++++++++------------- 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 77f21e495..d15df9513 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -326,9 +326,9 @@ bail: for (i = 0; i < c->num_fpes; i++) { FreeFPE(c->fpe_list[i]); } - xfree(c->fpe_list); - xfree(c->fontname); - xfree(c); + free(c->fpe_list); + free(c->fontname); + free(c); return TRUE; } @@ -441,7 +441,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) return TRUE; } if (err == FontNameAlias) { - if (resolved) xfree(resolved); + if (resolved) free(resolved); resolved = (char *) xalloc(resolvedlen + 1); if (resolved) memmove(resolved, tmpname, resolvedlen + 1); @@ -496,7 +496,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) c->saved = c->current; c->haveSaved = TRUE; if (c->savedName) - xfree(c->savedName); + free(c->savedName); c->savedName = (char *)xalloc(namelen + 1); if (c->savedName) memmove(c->savedName, name, namelen + 1); @@ -614,11 +614,11 @@ bail: } for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); + free(c->fpe_list); + if (c->savedName) free(c->savedName); FreeFontNames(names); - xfree(c); - if (resolved) xfree(resolved); + free(c); + if (resolved) free(resolved); return TRUE; } @@ -643,14 +643,14 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length, c->fpe_list = (FontPathElementPtr *) xalloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { - xfree(c); + free(c); return BadAlloc; } c->names = MakeFontNamesRecord(max_names < nxagentMaxFontNames ? max_names : nxagentMaxFontNames); if (!c->names) { - xfree(c->fpe_list); - xfree(c); + free(c->fpe_list); + free(c); return BadAlloc; } memmove( c->current.pattern, pattern, length); @@ -785,7 +785,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) c->haveSaved = TRUE; c->savedNumFonts = numFonts; if (c->savedName) - xfree(c->savedName); + free(c->savedName); c->savedName = (char *)xalloc(namelen + 1); if (c->savedName) memmove(c->savedName, name, namelen + 1); @@ -886,8 +886,8 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) (void) WriteToClient(client, namelen, name); if (pFontInfo == &fontInfo) { - xfree(fontInfo.props); - xfree(fontInfo.isStringProp); + free(fontInfo.props); + free(fontInfo.isStringProp); } --c->current.max_names; } @@ -910,10 +910,10 @@ bail: } for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); - xfree(c->reply); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); - xfree(c); + free(c->reply); + free(c->fpe_list); + if (c->savedName) free(c->savedName); + free(c); return TRUE; } @@ -1085,7 +1085,7 @@ nxdoListFontsAndAliases(client, fss) return TRUE; } if (err == FontNameAlias) { - if (resolved) xfree(resolved); + if (resolved) free(resolved); resolved = (char *) xalloc(resolvedlen + 1); if (resolved) { @@ -1154,7 +1154,7 @@ nxdoListFontsAndAliases(client, fss) c->saved = c->current; c->haveSaved = TRUE; if (c->savedName) - xfree(c->savedName); + free(c->savedName); c->savedName = (char *)xalloc(namelen + 1); if (c->savedName) { @@ -1249,12 +1249,12 @@ finish: } for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - if (c->savedName) xfree(c->savedName); + free(c->fpe_list); + if (c->savedName) free(c->savedName); FreeFontNames(c->names); - xfree(c); - xfree(fss); - if (resolved) xfree(resolved); + free(c); + free(fss); + if (resolved) free(resolved); return doOpenFont(client, oc); } @@ -1279,7 +1279,7 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) memmove(f, pfontname, lenfname); f[lenfname] = '\0'; ErrorF("OpenFont: fontname is \"%s\"\n", f); - xfree(f); + free(f); #endif if (!lenfname || lenfname > XLFDMAXFONTNAMELEN) return BadName; @@ -1317,22 +1317,22 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) if (!(c = (LFclosurePtr) xalloc(sizeof *c))) { - xfree(fss); + free(fss); return BadAlloc; } c->fpe_list = (FontPathElementPtr *) xalloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { - xfree(c); - xfree(fss); + free(c); + free(fss); return BadAlloc; } c->names = MakeFontNamesRecord(100); if (!c->names) { - xfree(c->fpe_list); - xfree(c); - xfree(fss); + free(c->fpe_list); + free(c); + free(fss); return BadAlloc; } memmove( c->current.pattern, pfontname, lenfname); @@ -1356,9 +1356,9 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) { for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - xfree(c); - xfree(fss); + free(c->fpe_list); + free(c); + free(fss); return BadAlloc; } oc->fontname = (char *) xalloc(256);/* I don't want to deal with future reallocs errors */ @@ -1367,10 +1367,10 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) if (!oc->fontname) { for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - xfree(c); - xfree(oc); - xfree(fss); + free(c->fpe_list); + free(c); + free(oc); + free(fss); return BadAlloc; } /* @@ -1380,13 +1380,13 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) oc->fpe_list = (FontPathElementPtr *) xalloc(sizeof(FontPathElementPtr) * num_fpes); if (!oc->fpe_list) { - xfree(oc->fontname); - xfree(oc); + free(oc->fontname); + free(oc); for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); - xfree(c->fpe_list); - xfree(c); - xfree(fss); + free(c->fpe_list); + free(c); + free(fss); return BadAlloc; } memmove(oc->fontname, pfontname, lenfname); -- cgit v1.2.3 From 2646fc254e75c4a7fc10d03d1139d0bd708ceae9 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 26 Jun 2016 01:51:18 +0200 Subject: nx-X11/programs/Xserver: Drop {X,x}alloc() macros, use malloc() instead. --- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 28 ++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index d15df9513..4b0af0867 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -442,7 +442,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) } if (err == FontNameAlias) { if (resolved) free(resolved); - resolved = (char *) xalloc(resolvedlen + 1); + resolved = (char *) malloc(resolvedlen + 1); if (resolved) memmove(resolved, tmpname, resolvedlen + 1); } @@ -497,7 +497,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) c->haveSaved = TRUE; if (c->savedName) free(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); + c->savedName = (char *)malloc(namelen + 1); if (c->savedName) memmove(c->savedName, name, namelen + 1); c->savedNameLen = namelen; @@ -638,10 +638,10 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length, if (length > XLFDMAXFONTNAMELEN) return BadAlloc; - if (!(c = (LFclosurePtr) xalloc(sizeof *c))) + if (!(c = (LFclosurePtr) malloc(sizeof *c))) return BadAlloc; c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); + malloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { free(c); return BadAlloc; @@ -786,7 +786,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) c->savedNumFonts = numFonts; if (c->savedName) free(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); + c->savedName = (char *)malloc(namelen + 1); if (c->savedName) memmove(c->savedName, name, namelen + 1); aliascount = 20; @@ -1086,7 +1086,7 @@ nxdoListFontsAndAliases(client, fss) } if (err == FontNameAlias) { if (resolved) free(resolved); - resolved = (char *) xalloc(resolvedlen + 1); + resolved = (char *) malloc(resolvedlen + 1); if (resolved) { memmove(resolved, tmpname, resolvedlen); @@ -1155,7 +1155,7 @@ nxdoListFontsAndAliases(client, fss) c->haveSaved = TRUE; if (c->savedName) free(c->savedName); - c->savedName = (char *)xalloc(namelen + 1); + c->savedName = (char *)malloc(namelen + 1); if (c->savedName) { memmove(c->savedName, name, namelen); @@ -1275,7 +1275,7 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) #ifdef FONTDEBUG char *f; - f = (char *)xalloc(lenfname + 1); + f = (char *)malloc(lenfname + 1); memmove(f, pfontname, lenfname); f[lenfname] = '\0'; ErrorF("OpenFont: fontname is \"%s\"\n", f); @@ -1312,16 +1312,16 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) return Success; } } - if (!(fss = (nxFsPtr) xalloc(sizeof(nxFs)))) + if (!(fss = (nxFsPtr) malloc(sizeof(nxFs)))) return BadAlloc; - if (!(c = (LFclosurePtr) xalloc(sizeof *c))) + if (!(c = (LFclosurePtr) malloc(sizeof *c))) { free(fss); return BadAlloc; } c->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); + malloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { free(c); free(fss); @@ -1351,7 +1351,7 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) c->slept = FALSE; c->savedName = 0; - oc = (OFclosurePtr) xalloc(sizeof(OFclosureRec)); + oc = (OFclosurePtr) malloc(sizeof(OFclosureRec)); if (!oc) { for (i = 0; i < c->num_fpes; i++) @@ -1361,7 +1361,7 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) free(fss); return BadAlloc; } - oc->fontname = (char *) xalloc(256);/* I don't want to deal with future reallocs errors */ + oc->fontname = (char *) malloc(256);/* I don't want to deal with future reallocs errors */ oc->origFontName = pfontname; oc->origFontNameLen = lenfname; if (!oc->fontname) { @@ -1378,7 +1378,7 @@ nxOpenFont(client, fid, flags, lenfname, pfontname) * while we're blocking, the request still appears atomic */ oc->fpe_list = (FontPathElementPtr *) - xalloc(sizeof(FontPathElementPtr) * num_fpes); + malloc(sizeof(FontPathElementPtr) * num_fpes); if (!oc->fpe_list) { free(oc->fontname); free(oc); -- cgit v1.2.3 From 74a5450bc058354e55c1589e64ef8e73775cebc4 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 26 Jun 2016 02:08:32 +0200 Subject: nx-X11/programs/Xserver: Drop {X,x}realloc() macros, use realloc() instead. --- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 4b0af0867..2603988b2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -227,7 +227,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) if (err == FontNameAlias && alias) { newlen = strlen(alias); - newname = (char *) xrealloc(c->fontname, newlen); + newname = (char *) realloc(c->fontname, newlen); if (!newname) { err = AllocError; break; @@ -846,7 +846,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) reply = c->reply; if (c->length < length) { - reply = (xListFontsWithInfoReply *) xrealloc(c->reply, length); + reply = (xListFontsWithInfoReply *) realloc(c->reply, length); if (!reply) { err = AllocError; -- cgit v1.2.3