summaryrefslogtreecommitdiff
path: root/src/fontfile/fontdir.c
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/fontfile/fontdir.c
parent632a2e90a4b209facc84d7a18873f19a720ea7df (diff)
xalloc -> malloc, etc.
Diffstat (limited to 'src/fontfile/fontdir.c')
-rw-r--r--src/fontfile/fontdir.c49
1 files changed, 24 insertions, 25 deletions
diff --git a/src/fontfile/fontdir.c b/src/fontfile/fontdir.c
index 00c7511..4d1baa9 100644
--- a/src/fontfile/fontdir.c
+++ b/src/fontfile/fontdir.c
@@ -51,7 +51,7 @@ FontFileInitTable (FontTablePtr table, int size)
return FALSE;
if (size)
{
- table->entries = (FontEntryPtr) xalloc(sizeof(FontEntryRec) * size);
+ table->entries = malloc(sizeof(FontEntryRec) * size);
if (!table->entries)
return FALSE;
}
@@ -70,26 +70,26 @@ FontFileFreeEntry (FontEntryPtr entry)
int i;
if (entry->name.name)
- xfree(entry->name.name);
+ free(entry->name.name);
entry->name.name = NULL;
switch (entry->type)
{
case FONT_ENTRY_SCALABLE:
- xfree (entry->u.scalable.fileName);
+ free (entry->u.scalable.fileName);
extra = entry->u.scalable.extra;
for (i = 0; i < extra->numScaled; i++)
if (extra->scaled[i].vals.ranges)
- xfree (extra->scaled[i].vals.ranges);
- xfree (extra->scaled);
- xfree (extra);
+ free (extra->scaled[i].vals.ranges);
+ free (extra->scaled);
+ free (extra);
break;
case FONT_ENTRY_BITMAP:
- xfree (entry->u.bitmap.fileName);
+ free (entry->u.bitmap.fileName);
entry->u.bitmap.fileName = NULL;
break;
case FONT_ENTRY_ALIAS:
- xfree (entry->u.alias.resolved);
+ free (entry->u.alias.resolved);
entry->u.alias.resolved = NULL;
break;
#ifdef NOTYET
@@ -106,7 +106,7 @@ FontFileFreeTable (FontTablePtr table)
for (i = 0; i < table->used; i++)
FontFileFreeEntry (&table->entries[i]);
- xfree (table->entries);
+ free (table->entries);
}
FontDirectoryPtr
@@ -136,19 +136,19 @@ FontFileMakeDir(char *dirName, int size)
if (dirlen) /* leave out slash for builtins */
#endif
needslash = 1;
- dir = (FontDirectoryPtr) xalloc(sizeof *dir + dirlen + needslash + 1 +
- (attriblen ? attriblen + 1 : 0));
+ dir = malloc(sizeof *dir + dirlen + needslash + 1 +
+ (attriblen ? attriblen + 1 : 0));
if (!dir)
return (FontDirectoryPtr)0;
if (!FontFileInitTable (&dir->scalable, 0))
{
- xfree (dir);
+ free (dir);
return (FontDirectoryPtr)0;
}
if (!FontFileInitTable (&dir->nonScalable, size))
{
FontFileFreeTable (&dir->scalable);
- xfree (dir);
+ free (dir);
return (FontDirectoryPtr)0;
}
dir->directory = (char *) (dir + 1);
@@ -172,7 +172,7 @@ FontFileFreeDir (FontDirectoryPtr dir)
{
FontFileFreeTable (&dir->scalable);
FontFileFreeTable (&dir->nonScalable);
- xfree(dir);
+ free(dir);
}
FontEntryPtr
@@ -186,8 +186,7 @@ FontFileAddEntry(FontTablePtr table, FontEntryPtr prototype)
return (FontEntryPtr) 0; /* "cannot" happen */
if (table->used == table->size) {
newsize = table->size + 100;
- entry = (FontEntryPtr) xrealloc(table->entries,
- newsize * sizeof(FontEntryRec));
+ entry = realloc(table->entries, newsize * sizeof(FontEntryRec));
if (!entry)
return (FontEntryPtr)0;
table->size = newsize;
@@ -195,7 +194,7 @@ FontFileAddEntry(FontTablePtr table, FontEntryPtr prototype)
}
entry = &table->entries[table->used];
*entry = *prototype;
- entry->name.name = (char *) xalloc(prototype->name.length + 1);
+ entry->name.name = malloc(prototype->name.length + 1);
if (!entry->name.name)
return (FontEntryPtr)0;
memcpy (entry->name.name, prototype->name.name, prototype->name.length);
@@ -439,7 +438,7 @@ FontFileSaveString (char *s)
{
char *n;
- n = (char *) xalloc (strlen (s) + 1);
+ n = malloc (strlen (s) + 1);
if (!n)
return 0;
strcpy (n, s);
@@ -695,7 +694,7 @@ FontFileAddFontFile (FontDirectoryPtr dir, char *fontName, char *fileName)
return FALSE;
if (!(bitmap = FontFileAddEntry (&dir->nonScalable, &entry)))
{
- xfree (entry.u.bitmap.fileName);
+ free (entry.u.bitmap.fileName);
return FALSE;
}
}
@@ -723,7 +722,7 @@ FontFileAddFontFile (FontDirectoryPtr dir, char *fontName, char *fileName)
{
existing->u.scalable.extra->defaults = vals;
- xfree (existing->u.scalable.fileName);
+ free (existing->u.scalable.fileName);
if (!(existing->u.scalable.fileName = FontFileSaveString (fileName)))
return FALSE;
}
@@ -738,10 +737,10 @@ FontFileAddFontFile (FontDirectoryPtr dir, char *fontName, char *fileName)
}
if (!(entry.u.scalable.fileName = FontFileSaveString (fileName)))
return FALSE;
- extra = (FontScalableExtraPtr) xalloc (sizeof (FontScalableExtraRec));
+ extra = malloc (sizeof (FontScalableExtraRec));
if (!extra)
{
- xfree (entry.u.scalable.fileName);
+ free (entry.u.scalable.fileName);
return FALSE;
}
bzero((char *)&extra->defaults, sizeof(extra->defaults));
@@ -791,8 +790,8 @@ FontFileAddFontFile (FontDirectoryPtr dir, char *fontName, char *fileName)
entry.u.scalable.extra = extra;
if (!(scalable = FontFileAddEntry (&dir->scalable, &entry)))
{
- xfree (extra);
- xfree (entry.u.scalable.fileName);
+ free (extra);
+ free (entry.u.scalable.fileName);
return FALSE;
}
if (vals.values_supplied & SIZE_SPECIFY_MASK)
@@ -826,7 +825,7 @@ FontFileAddFontAlias (FontDirectoryPtr dir, char *aliasName, char *fontName)
return FALSE;
if (!FontFileAddEntry (&dir->nonScalable, &entry))
{
- xfree (entry.u.alias.resolved);
+ free (entry.u.alias.resolved);
return FALSE;
}
return TRUE;