aboutsummaryrefslogtreecommitdiff
path: root/libXfont/src/util/fontutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'libXfont/src/util/fontutil.c')
-rw-r--r--libXfont/src/util/fontutil.c40
1 files changed, 5 insertions, 35 deletions
diff --git a/libXfont/src/util/fontutil.c b/libXfont/src/util/fontutil.c
index 05fe5c2f2..aa89ce01a 100644
--- a/libXfont/src/util/fontutil.c
+++ b/libXfont/src/util/fontutil.c
@@ -149,7 +149,7 @@ QueryTextExtents(FontPtr pFont,
unsigned char defc[2];
int firstReal;
- charinfo = (xCharInfo **) xalloc(count * sizeof(xCharInfo *));
+ charinfo = malloc(count * sizeof(xCharInfo *));
if (!charinfo)
return FALSE;
encoding = TwoD16Bit;
@@ -188,7 +188,7 @@ QueryTextExtents(FontPtr pFont,
QueryGlyphExtents(pFont, (CharInfoPtr*) charinfo + firstReal,
n - firstReal, info);
pFont->info.constantMetrics = cm;
- xfree(charinfo);
+ free(charinfo);
return TRUE;
}
@@ -315,15 +315,13 @@ add_range(fsRange *newrange,
/* Grow the list if necessary */
if (*nranges == 0 || *range == (fsRange *)0)
{
- *range = (fsRange *)xalloc(range_alloc_granularity *
- SIZEOF(fsRange));
+ *range = malloc(range_alloc_granularity * SIZEOF(fsRange));
*nranges = 0;
}
else if (!(*nranges % range_alloc_granularity))
{
- *range = (fsRange *)xrealloc((char *)*range,
- (*nranges + range_alloc_granularity) *
- SIZEOF(fsRange));
+ *range = realloc(*range, (*nranges + range_alloc_granularity) *
+ SIZEOF(fsRange));
}
/* If alloc failed, just return a null list */
@@ -413,31 +411,3 @@ add_range(fsRange *newrange,
return Successful;
}
-
-/* It is difficult to find a good place for this. */
-#ifdef NEED_STRCASECMP
-int
-f_strcasecmp(const char *s1, const char *s2)
-{
- char c1, c2;
-
- if (*s1 == 0)
- if (*s2 == 0)
- return 0;
- else
- return 1;
-
- c1 = (isupper (*s1) ? tolower (*s1) : *s1);
- c2 = (isupper (*s2) ? tolower (*s2) : *s2);
- while (c1 == c2) {
- if (c1 == '\0')
- return 0;
- s1++;
- s2++;
- c1 = (isupper (*s1) ? tolower (*s1) : *s1);
- c2 = (isupper (*s2) ? tolower (*s2) : *s2);
- }
- return c1 - c2;
-}
-#endif
-