summaryrefslogtreecommitdiff
path: root/src/fc
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2009-01-20 23:16:35 -0500
committerAdam Jackson <ajax@redhat.com>2009-01-20 23:16:35 -0500
commit0cdc9b8f850342d50b72a57507db3413eacc6fb8 (patch)
treeb86480167977d28f8e7574c91aedf982db52bf32 /src/fc
parent632a2e90a4b209facc84d7a18873f19a720ea7df (diff)
downloadxorg-lib-libXfont-0cdc9b8f850342d50b72a57507db3413eacc6fb8.tar.gz
xalloc -> malloc, etc.
Diffstat (limited to 'src/fc')
-rw-r--r--src/fc/fsconvert.c21
-rw-r--r--src/fc/fserve.c38
-rw-r--r--src/fc/fsio.c16
3 files changed, 35 insertions, 40 deletions
diff --git a/src/fc/fsconvert.c b/src/fc/fsconvert.c
index 8cdda2a..724bc5f 100644
--- a/src/fc/fsconvert.c
+++ b/src/fc/fsconvert.c
@@ -108,8 +108,7 @@ _fs_convert_props(fsPropInfo *pi, fsPropOffset *po, pointer pd,
|| nprops > SIZE_MAX/(sizeof(FontPropRec) + sizeof(char)))
return -1;
- dprop = (FontPropPtr) xalloc(sizeof(FontPropRec) * nprops +
- sizeof (char) * nprops);
+ dprop = malloc(sizeof(FontPropRec) * nprops + sizeof (char) * nprops);
if (!dprop)
return -1;
@@ -132,7 +131,7 @@ _fs_convert_props(fsPropInfo *pi, fsPropOffset *po, pointer pd,
local_off.value.length, 1);
if (dprop->value == BAD_RESOURCE)
{
- xfree (pfi->props);
+ free (pfi->props);
pfi->nprops = 0;
pfi->props = 0;
pfi->isStringProp = 0;
@@ -150,7 +149,7 @@ _fs_free_props (FontInfoPtr pfi)
{
if (pfi->props)
{
- xfree (pfi->props);
+ free (pfi->props);
pfi->nprops = 0;
pfi->props = 0;
}
@@ -616,12 +615,12 @@ _fs_unload_font(FontPtr pfont)
* fsdata points at FSFontRec, FSFontDataRec and name
*/
if (encoding)
- xfree(encoding);
+ free(encoding);
while ((glyphs = fsdata->glyphs))
{
fsdata->glyphs = glyphs->next;
- xfree (glyphs);
+ free (glyphs);
}
/* XXX we may get called after the resource DB has been cleaned out */
@@ -630,7 +629,7 @@ _fs_unload_font(FontPtr pfont)
_fs_free_props (&pfont->info);
- xfree(fsdata);
+ free(fsdata);
DestroyFontRec(pfont);
}
@@ -650,9 +649,7 @@ fs_create_font (FontPathElementPtr fpe,
pfont = CreateFontRec ();
if (!pfont)
return 0;
- fsfont = (FSFontPtr) xalloc (sizeof (FSFontRec) +
- sizeof (FSFontDataRec) +
- namelen + 1);
+ fsfont = malloc (sizeof (FSFontRec) + sizeof (FSFontDataRec) + namelen + 1);
if (!fsfont)
{
DestroyFontRec (pfont);
@@ -703,7 +700,7 @@ fs_create_font (FontPathElementPtr fpe,
/* save the ID */
if (!StoreFontClientFont(pfont, fsd->fontid))
{
- xfree (fsfont);
+ free (fsfont);
DestroyFontRec (pfont);
return 0;
}
@@ -717,7 +714,7 @@ fs_alloc_glyphs (FontPtr pFont, int size)
FSGlyphPtr glyphs;
FSFontPtr fsfont = (FSFontPtr) pFont->fontPrivate;
- glyphs = xalloc (sizeof (FSGlyphRec) + size);
+ glyphs = malloc (sizeof (FSGlyphRec) + size);
glyphs->next = fsfont->glyphs;
fsfont->glyphs = glyphs;
return (pointer) (glyphs + 1);
diff --git a/src/fc/fserve.c b/src/fc/fserve.c
index 3980fb0..3aa7598 100644
--- a/src/fc/fserve.c
+++ b/src/fc/fserve.c
@@ -266,7 +266,7 @@ fs_close_conn(FSFpePtr conn)
for (client = conn->clients; client; client = nclient)
{
nclient = client->next;
- xfree (client);
+ free (client);
}
conn->clients = NULL;
}
@@ -411,7 +411,7 @@ fs_new_block_rec(FontPathElementPtr fpe, pointer client, int type)
size = 0;
break;
}
- blockrec = (FSBlockDataPtr) xalloc(sizeof(FSBlockDataRec) + size);
+ blockrec = malloc(sizeof(FSBlockDataRec) + size);
if (!blockrec)
return (FSBlockDataPtr) 0;
blockrec->data = (pointer) (blockrec + 1);
@@ -462,9 +462,9 @@ _fs_remove_block_rec(FSFpePtr conn, FSBlockDataPtr blockrec)
{
FSBlockedGlyphPtr bglyph = (FSBlockedGlyphPtr)blockrec->data;
if (bglyph->num_expected_ranges)
- xfree(bglyph->expected_ranges);
+ free(bglyph->expected_ranges);
}
- xfree(blockrec);
+ free(blockrec);
_fs_set_pending_reply (conn);
}
@@ -477,7 +477,7 @@ _fs_signal_clients_depending(FSClientsDependingPtr *clients_depending)
{
*clients_depending = p->next;
ClientSignal(p->client);
- xfree(p);
+ free(p);
}
}
@@ -493,7 +493,7 @@ _fs_add_clients_depending(FSClientsDependingPtr *clients_depending, pointer clie
return Suspended;
}
- new = (FSClientsDependingPtr)xalloc (sizeof (FSClientsDependingRec));
+ new = malloc (sizeof (FSClientsDependingRec));
if (!new)
return BadAlloc;
@@ -981,7 +981,7 @@ fs_read_extent_info(FontPathElementPtr fpe, FSBlockDataPtr blockrec)
numInfos *= 2;
haveInk = TRUE;
}
- ci = pCI = (CharInfoPtr) xalloc(sizeof(CharInfoRec) * numInfos);
+ ci = pCI = malloc(sizeof(CharInfoRec) * numInfos);
if (!pCI)
{
@@ -2156,7 +2156,7 @@ _fs_load_glyphs(pointer client, FontPtr pfont, Bool range_flag,
if (nranges)
{
_fs_clean_aborted_loadglyphs(pfont, nranges, ranges);
- xfree(ranges);
+ free(ranges);
}
return _fs_add_clients_depending(clients_depending, client);
}
@@ -2184,7 +2184,7 @@ _fs_load_glyphs(pointer client, FontPtr pfont, Bool range_flag,
/* Since we're not ready to send the load_glyphs request yet,
clean up the damage caused by the fs_build_range() call. */
_fs_clean_aborted_loadglyphs(pfont, nranges, ranges);
- xfree(ranges);
+ free(ranges);
/* Now try to reopen the font. */
return fs_send_open_font(client, pfont->fpe,
@@ -2571,7 +2571,7 @@ fs_client_died(pointer client, FontPathElementPtr fpe)
_fs_add_req_log(conn, FS_FreeAC);
_fs_write (conn, (char *) &freeac, sizeof (fsFreeACReq));
*prev = cur->next;
- xfree (cur);
+ free (cur);
break;
}
}
@@ -2625,7 +2625,7 @@ _fs_client_access (FSFpePtr conn, pointer client, Bool sync)
}
if (!cur)
{
- cur = (FSClientPtr) xalloc (sizeof (FSClientRec));
+ cur = malloc (sizeof (FSClientRec));
if (!cur)
return;
cur->client = client;
@@ -2810,15 +2810,14 @@ _fs_recv_conn_setup (FSFpePtr conn)
*/
if (conn->alts)
{
- xfree (conn->alts);
+ free (conn->alts);
conn->alts = 0;
conn->numAlts = 0;
}
if (setup->num_alternates)
{
- alts = (FSFpeAltPtr) xalloc (setup->num_alternates *
- sizeof (FSFpeAltRec) +
- (setup->alternate_len << 2));
+ alts = malloc (setup->num_alternates * sizeof (FSFpeAltRec) +
+ (setup->alternate_len << 2));
if (alts)
{
alt_names = (char *) (setup + 1);
@@ -3151,13 +3150,12 @@ _fs_init_conn (char *servername)
{
FSFpePtr conn;
- conn = xalloc (sizeof (FSFpeRec) + strlen (servername) + 1);
+ conn = calloc (1, sizeof (FSFpeRec) + strlen (servername) + 1);
if (!conn)
return 0;
- memset (conn, '\0', sizeof (FSFpeRec));
if (!_fs_io_init (conn))
{
- xfree (conn);
+ free (conn);
return 0;
}
conn->servername = (char *) (conn + 1);
@@ -3173,8 +3171,8 @@ _fs_free_conn (FSFpePtr conn)
_fs_close_server (conn);
_fs_io_fini (conn);
if (conn->alts)
- xfree (conn->alts);
- xfree (conn);
+ free (conn->alts);
+ free (conn);
}
/*
diff --git a/src/fc/fsio.c b/src/fc/fsio.c
index 2b55f85..cbb1a67 100644
--- a/src/fc/fsio.c
+++ b/src/fc/fsio.c
@@ -284,7 +284,7 @@ _fs_flush (FSFpePtr conn)
{
_fs_unmark_block (conn, FS_BROKEN_WRITE|FS_PENDING_WRITE);
if (conn->outBuf.size > FS_BUF_INC)
- conn->outBuf.buf = xrealloc (conn->outBuf.buf, FS_BUF_INC);
+ conn->outBuf.buf = realloc (conn->outBuf.buf, FS_BUF_INC);
conn->outBuf.remove = conn->outBuf.insert = 0;
}
return FSIO_READY;
@@ -310,7 +310,7 @@ _fs_resize (FSBufPtr buf, long size)
if (buf->size - buf->remove < size)
{
new_size = ((buf->remove + size + FS_BUF_INC) / FS_BUF_INC) * FS_BUF_INC;
- new = xrealloc (buf->buf, new_size);
+ new = realloc (buf->buf, new_size);
if (!new)
return FSIO_ERROR;
buf->buf = new;
@@ -327,7 +327,7 @@ _fs_downsize (FSBufPtr buf, long size)
buf->insert = buf->remove = 0;
if (buf->size > size)
{
- buf->buf = xrealloc (buf->buf, size);
+ buf->buf = realloc (buf->buf, size);
buf->size = size;
}
}
@@ -346,16 +346,16 @@ Bool
_fs_io_init (FSFpePtr conn)
{
conn->outBuf.insert = conn->outBuf.remove = 0;
- conn->outBuf.buf = xalloc (FS_BUF_INC);
+ conn->outBuf.buf = malloc (FS_BUF_INC);
if (!conn->outBuf.buf)
return FALSE;
conn->outBuf.size = FS_BUF_INC;
conn->inBuf.insert = conn->inBuf.remove = 0;
- conn->inBuf.buf = xalloc (FS_BUF_INC);
+ conn->inBuf.buf = malloc (FS_BUF_INC);
if (!conn->inBuf.buf)
{
- xfree (conn->outBuf.buf);
+ free (conn->outBuf.buf);
conn->outBuf.buf = 0;
return FALSE;
}
@@ -368,9 +368,9 @@ void
_fs_io_fini (FSFpePtr conn)
{
if (conn->outBuf.buf)
- xfree (conn->outBuf.buf);
+ free (conn->outBuf.buf);
if (conn->inBuf.buf)
- xfree (conn->inBuf.buf);
+ free (conn->inBuf.buf);
}
static int