aboutsummaryrefslogtreecommitdiff
path: root/libXfont/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'libXfont/src/util')
-rw-r--r--libXfont/src/util/Makefile.in46
-rw-r--r--libXfont/src/util/atom.c9
-rw-r--r--libXfont/src/util/fontnames.c32
-rw-r--r--libXfont/src/util/fontutil.c40
-rw-r--r--libXfont/src/util/fontxlfd.c2
-rw-r--r--libXfont/src/util/miscutil.c54
-rw-r--r--libXfont/src/util/patcache.c14
-rw-r--r--libXfont/src/util/private.c11
-rw-r--r--libXfont/src/util/utilbitmap.c6
9 files changed, 65 insertions, 149 deletions
diff --git a/libXfont/src/util/Makefile.in b/libXfont/src/util/Makefile.in
index a86e54064..63b966b12 100644
--- a/libXfont/src/util/Makefile.in
+++ b/libXfont/src/util/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -48,7 +48,7 @@ am_libutil_la_OBJECTS = atom.lo fontaccel.lo fontnames.lo fontutil.lo \
fontxlfd.lo format.lo miscutil.lo patcache.lo private.lo \
utilbitmap.lo
libutil_la_OBJECTS = $(am_libutil_la_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(top_builddir) -I$(top_builddir)/include/X11/fonts@am__isrc@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/include/X11/fonts
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -79,22 +79,18 @@ CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
-ECHO = @ECHO@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENCODINGSDIR = @ENCODINGSDIR@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
FREETYPE_LIBS = @FREETYPE_LIBS@
FREETYPE_REQUIRES = @FREETYPE_REQUIRES@
@@ -104,17 +100,24 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MATH_LIBS = @MATH_LIBS@
MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_CFLAGS = @OS_CFLAGS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -124,6 +127,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
+SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@@ -137,8 +141,7 @@ abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -171,6 +174,7 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
@@ -183,6 +187,7 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INCLUDES = \
@@ -211,8 +216,8 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
@@ -297,8 +302,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -310,8 +315,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -321,13 +326,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
- here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
diff --git a/libXfont/src/util/atom.c b/libXfont/src/util/atom.c
index b770dc9de..bfb05ccbd 100644
--- a/libXfont/src/util/atom.c
+++ b/libXfont/src/util/atom.c
@@ -84,14 +84,13 @@ ResizeHashTable (void)
newHashSize = 1024;
else
newHashSize = hashSize * 2;
- newHashTable = (AtomListPtr *) xalloc (newHashSize * sizeof (AtomListPtr));
+ newHashTable = calloc (newHashSize, sizeof (AtomListPtr));
if (!newHashTable) {
fprintf(stderr, "ResizeHashTable(): Error: Couldn't allocate"
" newHashTable (%ld)\n",
newHashSize * (unsigned long)sizeof (AtomListPtr));
return FALSE;
}
- bzero ((char *) newHashTable, newHashSize * sizeof (AtomListPtr));
newHashMask = newHashSize - 1;
newRehash = (newHashMask - 2);
for (i = 0; i < hashSize; i++)
@@ -111,7 +110,7 @@ ResizeHashTable (void)
newHashTable[h] = hashTable[i];
}
}
- xfree (hashTable);
+ free (hashTable);
hashTable = newHashTable;
hashSize = newHashSize;
hashMask = newHashMask;
@@ -127,7 +126,7 @@ ResizeReverseMap (void)
reverseMapSize = 1000;
else
reverseMapSize *= 2;
- reverseMap = (AtomListPtr *) xrealloc (reverseMap, reverseMapSize * sizeof (AtomListPtr));
+ reverseMap = realloc (reverseMap, reverseMapSize * sizeof (AtomListPtr));
if (!reverseMap) {
fprintf(stderr, "ResizeReverseMap(): Error: Couldn't reallocate"
" reverseMap (%ld)\n",
@@ -187,7 +186,7 @@ MakeAtom(char *string, unsigned len, int makeit)
}
if (!makeit)
return None;
- a = (AtomListPtr) xalloc (sizeof (AtomListRec) + len + 1);
+ a = malloc (sizeof (AtomListRec) + len + 1);
if (a == NULL) {
fprintf(stderr, "MakeAtom(): Error: Couldn't allocate AtomListRec"
" (%ld)\n", (unsigned long)sizeof (AtomListRec) + len + 1);
diff --git a/libXfont/src/util/fontnames.c b/libXfont/src/util/fontnames.c
index 2d3a51752..d03cea773 100644
--- a/libXfont/src/util/fontnames.c
+++ b/libXfont/src/util/fontnames.c
@@ -49,11 +49,11 @@ FreeFontNames(FontNamesPtr pFN)
if (!pFN)
return;
for (i = 0; i < pFN->nnames; i++) {
- xfree(pFN->names[i]);
+ free(pFN->names[i]);
}
- xfree(pFN->names);
- xfree(pFN->length);
- xfree(pFN);
+ free(pFN->names);
+ free(pFN->length);
+ free(pFN);
}
FontNamesPtr
@@ -61,18 +61,18 @@ MakeFontNamesRecord(unsigned int size)
{
FontNamesPtr pFN;
- pFN = (FontNamesPtr) xalloc(sizeof(FontNamesRec));
+ pFN = malloc(sizeof(FontNamesRec));
if (pFN) {
pFN->nnames = 0;
pFN->size = size;
if (size)
{
- pFN->length = (int *) xalloc(size * sizeof(int));
- pFN->names = (char **) xalloc(size * sizeof(char *));
+ pFN->length = malloc(size * sizeof(int));
+ pFN->names = malloc(size * sizeof(char *));
if (!pFN->length || !pFN->names) {
- xfree(pFN->length);
- xfree(pFN->names);
- xfree(pFN);
+ free(pFN->length);
+ free(pFN->names);
+ free(pFN);
pFN = (FontNamesPtr) 0;
}
}
@@ -91,7 +91,7 @@ AddFontNamesName(FontNamesPtr names, char *name, int length)
int index = names->nnames;
char *nelt;
- nelt = (char *) xalloc(length + 1);
+ nelt = malloc(length + 1);
if (!nelt)
return AllocError;
if (index >= names->size) {
@@ -101,16 +101,16 @@ AddFontNamesName(FontNamesPtr names, char *name, int length)
if (size == 0)
size = 8;
- nlength = (int *) xrealloc(names->length, size * sizeof(int));
- nnames = (char **) xrealloc(names->names, size * sizeof(char *));
+ nlength = realloc(names->length, size * sizeof(int));
+ nnames = realloc(names->names, size * sizeof(char *));
if (nlength && nnames) {
names->size = size;
names->length = nlength;
names->names = nnames;
} else {
- xfree(nelt);
- xfree(nlength);
- xfree(nnames);
+ free(nelt);
+ free(nlength);
+ free(nnames);
return AllocError;
}
}
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
-
diff --git a/libXfont/src/util/fontxlfd.c b/libXfont/src/util/fontxlfd.c
index f402aa9dd..664d7598f 100644
--- a/libXfont/src/util/fontxlfd.c
+++ b/libXfont/src/util/fontxlfd.c
@@ -203,7 +203,6 @@ xlfd_round_double(double x)
defined(__hppa__) || \
defined(__amd64__) || defined(__amd64) || \
defined(sgi)
-#if !defined(__UNIXOS2__)
/* if we have IEEE 754 fp, we can round to binary digits... */
@@ -263,7 +262,6 @@ xlfd_round_double(double x)
}
else
#endif
-#endif /* !__UNIXOS2__ */
#endif /* i386 || __i386__ */
{
/*
diff --git a/libXfont/src/util/miscutil.c b/libXfont/src/util/miscutil.c
index c44527a29..345927515 100644
--- a/libXfont/src/util/miscutil.c
+++ b/libXfont/src/util/miscutil.c
@@ -43,66 +43,12 @@ from The Open Group.
#ifdef __SUNPRO_C
#pragma weak serverGeneration
-#pragma weak Xalloc
-#pragma weak Xrealloc
-#pragma weak Xfree
-#pragma weak Xcalloc
-#pragma weak CopyISOLatin1Lowered
#pragma weak register_fpe_functions
#endif
/* make sure everything initializes themselves at least once */
weak long serverGeneration = 1;
-weak void *
-Xalloc (unsigned long m)
-{
- return malloc (m);
-}
-
-weak void *
-Xrealloc (void *n, unsigned long m)
-{
- if (!n)
- return malloc (m);
- else
- return realloc (n, m);
-}
-
-weak void
-Xfree (void *n)
-{
- if (n)
- free (n);
-}
-
-weak void *
-Xcalloc (unsigned long n)
-{
- return calloc (n, 1);
-}
-
-weak void
-CopyISOLatin1Lowered (char *dst, char *src, int len)
-{
- register unsigned char *dest, *source;
-
- for (dest = (unsigned char *)dst, source = (unsigned char *)src;
- *source && len > 0;
- source++, dest++, len--)
- {
- if ((*source >= XK_A) && (*source <= XK_Z))
- *dest = *source + (XK_a - XK_A);
- else if ((*source >= XK_Agrave) && (*source <= XK_Odiaeresis))
- *dest = *source + (XK_agrave - XK_Agrave);
- else if ((*source >= XK_Ooblique) && (*source <= XK_Thorn))
- *dest = *source + (XK_oslash - XK_Ooblique);
- else
- *dest = *source;
- }
- *dest = '\0';
-}
-
weak void
register_fpe_functions (void)
{
diff --git a/libXfont/src/util/patcache.c b/libXfont/src/util/patcache.c
index 0351b1ac2..5411810d6 100644
--- a/libXfont/src/util/patcache.c
+++ b/libXfont/src/util/patcache.c
@@ -77,7 +77,7 @@ EmptyFontPatternCache (FontPatternCachePtr cache)
cache->entries[i].next = &cache->entries[i+1];
cache->entries[i].prev = 0;
cache->entries[i].pFont = 0;
- xfree (cache->entries[i].pattern);
+ free (cache->entries[i].pattern);
cache->entries[i].pattern = 0;
cache->entries[i].patlen = 0;
}
@@ -91,7 +91,7 @@ MakeFontPatternCache (void)
{
FontPatternCachePtr cache;
int i;
- cache = (FontPatternCachePtr) xalloc (sizeof *cache);
+ cache = malloc (sizeof *cache);
if (!cache)
return 0;
for (i = 0; i < NENTRIES; i++) {
@@ -110,8 +110,8 @@ FreeFontPatternCache (FontPatternCachePtr cache)
int i;
for (i = 0; i < NENTRIES; i++)
- xfree (cache->entries[i].pattern);
- xfree (cache);
+ free (cache->entries[i].pattern);
+ free (cache);
}
/* compute id for string */
@@ -139,7 +139,7 @@ CacheFontPattern (FontPatternCachePtr cache,
char *newpat;
int i;
- newpat = (char *) xalloc (patlen);
+ newpat = malloc (patlen);
if (!newpat)
return;
if (cache->free)
@@ -157,7 +157,7 @@ CacheFontPattern (FontPatternCachePtr cache,
if (e->next)
e->next->prev = e->prev;
*e->prev = e->next;
- xfree (e->pattern);
+ free (e->pattern);
}
/* set pattern */
memcpy (newpat, pattern, patlen);
@@ -214,7 +214,7 @@ RemoveCachedFontPattern (FontPatternCachePtr cache,
*e->prev = e->next;
e->next = cache->free;
cache->free = e;
- xfree (e->pattern);
+ free (e->pattern);
e->pattern = 0;
}
}
diff --git a/libXfont/src/util/private.c b/libXfont/src/util/private.c
index 85e90e57b..6b760b4c3 100644
--- a/libXfont/src/util/private.c
+++ b/libXfont/src/util/private.c
@@ -53,7 +53,7 @@ CreateFontRec (void)
size = sizeof(FontRec) + (sizeof(pointer) * _FontPrivateAllocateIndex);
- pFont = (FontPtr)xalloc(size);
+ pFont = malloc(size);
if(pFont) {
bzero((char*)pFont, size);
@@ -69,8 +69,8 @@ void
DestroyFontRec (FontPtr pFont)
{
if (pFont->devPrivates && pFont->devPrivates != (pointer)(&pFont[1]))
- xfree(pFont->devPrivates);
- xfree(pFont);
+ free(pFont->devPrivates);
+ free(pFont);
}
void
@@ -86,11 +86,12 @@ _FontSetNewPrivate (FontPtr pFont, int n, pointer ptr)
if (n > pFont->maxPrivate) {
if (pFont->devPrivates && pFont->devPrivates != (pointer)(&pFont[1])) {
- new = (pointer *) xrealloc (pFont->devPrivates, (n + 1) * sizeof (pointer));
+ new = realloc (pFont->devPrivates, (n + 1) * sizeof (pointer));
if (!new)
return FALSE;
} else {
- new = (pointer *) xalloc ((n + 1) * sizeof (pointer));
+ /* omg realloc */
+ new = malloc ((n + 1) * sizeof (pointer));
if (!new)
return FALSE;
if (pFont->devPrivates)
diff --git a/libXfont/src/util/utilbitmap.c b/libXfont/src/util/utilbitmap.c
index a817a4ec6..978db89c8 100644
--- a/libXfont/src/util/utilbitmap.c
+++ b/libXfont/src/util/utilbitmap.c
@@ -1,5 +1,3 @@
-/* $Xorg: utilbitmap.c,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */
-
/*
Copyright 1990, 1994, 1998 The Open Group
@@ -38,7 +36,7 @@ in this Software without prior written authorization from The Open Group.
/* Utility functions for reformating font bitmaps */
-static unsigned char _reverse_byte[0x100] = {
+static const unsigned char _reverse_byte[0x100] = {
0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
@@ -79,7 +77,7 @@ static unsigned char _reverse_byte[0x100] = {
void
BitOrderInvert(unsigned char *buf, int nbytes)
{
- unsigned char *rev = _reverse_byte;
+ const unsigned char *rev = _reverse_byte;
for (; --nbytes >= 0; buf++)
*buf = rev[*buf];