summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:28:20 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:28:20 +0000
commitfb0cbe6e7287d635a5f368e055cc0aae6ed50125 (patch)
tree24940f60afb7e084ca0760710bf9d1ffd21c384a /src/util
parentca219ad2fc4f392505d378dfa5a2b34d33de6d61 (diff)
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_16
Diffstat (limited to 'src/util')
-rw-r--r--src/util/fontxlfd.c39
-rw-r--r--src/util/private.c7
2 files changed, 24 insertions, 22 deletions
diff --git a/src/util/fontxlfd.c b/src/util/fontxlfd.c
index 3a2c93d..593f84c 100644
--- a/src/util/fontxlfd.c
+++ b/src/util/fontxlfd.c
@@ -27,7 +27,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/font/util/fontxlfd.c,v 3.15 2002/05/31 18:45:50 dawes Exp $ */
+/* $XFree86: xc/lib/font/util/fontxlfd.c,v 3.17 2003/10/24 16:11:52 tsi Exp $ */
/*
* Author: Keith Packard, MIT X Consortium
@@ -197,7 +197,8 @@ xlfd_round_double(double x)
defined(ia64) || defined(__ia64__) || \
defined(__alpha__) || defined(__alpha) || \
defined(__hppa__) || \
- defined(__x86_64__) || defined(__x86_64)
+ defined(__AMD64__) || defined(__AMD64) || \
+ defined(sgi)
#if !defined(__UNIXOS2__)
#include <float.h>
@@ -214,27 +215,27 @@ xlfd_round_double(double x)
/* convert # of decimal digits to # of binary digits */
#define XLFD_NDIGITS_2 ((int)(XLFD_NDIGITS * M_LN10 / M_LN2 + 0.5))
-
+
union conv_d {
double d;
unsigned char b[8];
} d;
int i,j,k,d_exp;
-
- if (x == 0)
+
+ if (x == 0)
return x;
/* do minor sanity check for IEEE 754 fp and correct byte order */
d.d = 1.0;
if (sizeof(double) == 8 && d.b[7] == 0x3f && d.b[6] == 0xf0) {
-
- /*
+
+ /*
* this code will round IEEE 754 double to XLFD_NDIGITS_2 binary digits
*/
-
+
d.d = x;
d_exp = (d.b[7] << 4) | (d.b[6] >> 4);
-
+
i = (DBL_MANT_DIG-XLFD_NDIGITS_2) >> 3;
j = 1 << ((DBL_MANT_DIG-XLFD_NDIGITS_2) & 0x07);
for (; i<7; i++) {
@@ -249,25 +250,25 @@ xlfd_round_double(double x)
d.b[7] = d_exp >> 4;
d.b[6] = (d.b[6] & 0x0f) | (d_exp << 4);
}
-
+
i = (DBL_MANT_DIG-XLFD_NDIGITS_2) >> 3;
- j = 1 << ((DBL_MANT_DIG-XLFD_NDIGITS_2) & 0x07);
+ j = 1 << ((DBL_MANT_DIG-XLFD_NDIGITS_2) & 0x07);
d.b[i] &= ~(j-1);
for (;--i>=0;) d.b[i] = 0;
return d.d;
}
- else
+ else
#endif
#endif /* !__UNIXOS2__ */
#endif /* i386 || __i386__ */
{
/*
- * If not IEEE 754: Let printf() do it for you.
+ * If not IEEE 754: Let printf() do it for you.
*/
-
+
char formatbuf[40], buffer[40];
-
+
sprintf(formatbuf, "%%.%dlg", XLFD_NDIGITS);
sprintf(buffer, formatbuf, x);
return atof(buffer);
@@ -352,7 +353,7 @@ GetMatrix(char *ptr, FontScalablePtr vals, int which)
}
-static void
+static void
append_ranges(char *fname, int nranges, fsRange *ranges)
{
if (nranges)
@@ -366,9 +367,9 @@ append_ranges(char *fname, int nranges, fsRange *ranges)
sprintf(fname + strlen(fname), "%d",
minchar(ranges[i]));
if (ranges[i].min_char_low ==
- ranges[i].max_char_low &&
- ranges[i].min_char_high ==
- ranges[i].max_char_high) continue;
+ ranges[i].max_char_low &&
+ ranges[i].min_char_high ==
+ ranges[i].max_char_high) continue;
sprintf(fname + strlen(fname), "_%d",
maxchar(ranges[i]));
}
diff --git a/src/util/private.c b/src/util/private.c
index ef7d48b..729d41a 100644
--- a/src/util/private.c
+++ b/src/util/private.c
@@ -25,7 +25,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/font/util/private.c,v 1.8 2001/12/14 19:56:57 dawes Exp $ */
+/* $XFree86: xc/lib/font/util/private.c,v 1.9 2003/02/27 22:19:20 tsi Exp $ */
/*
* Author: Keith Packard, MIT X Consortium
@@ -51,9 +51,9 @@ CreateFontRec (void)
size = sizeof(FontRec) + (sizeof(pointer) * _FontPrivateAllocateIndex);
pFont = (FontPtr)xalloc(size);
- bzero((char*)pFont, size);
if(pFont) {
+ bzero((char*)pFont, size);
pFont->maxPrivate = _FontPrivateAllocateIndex - 1;
if(_FontPrivateAllocateIndex)
pFont->devPrivates = (pointer)(&pFont[1]);
@@ -62,7 +62,8 @@ CreateFontRec (void)
return pFont;
}
-void DestroyFontRec (FontPtr pFont)
+void
+DestroyFontRec (FontPtr pFont)
{
if (pFont->devPrivates && pFont->devPrivates != (pointer)(&pFont[1]))
xfree(pFont->devPrivates);