summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorThomas Klausner <wiz@NetBSD.org>2015-02-25 21:45:50 +0100
committerAdam Jackson <ajax@redhat.com>2015-10-20 12:52:08 -0400
commitd66f107d6e714a54515f39d94caf46aef9be7416 (patch)
treeed0b265d971ce9c72c1471e5a227a3bb3c112207 /src/util
parent1a73d6828dfa03924f2d68644fb5b99afd9c78e2 (diff)
downloadxorg-lib-libXfont-d66f107d6e714a54515f39d94caf46aef9be7416.tar.gz
Fix is*() usage.
The argument must be an unsigned char or -1; in these cases we know it's not -1 so cast it to unsigned char. Fixes warning: array subscript is of type 'char' [-Wchar-subscripts] Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/fontxlfd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/util/fontxlfd.c b/src/util/fontxlfd.c
index 974128e..99a3679 100644
--- a/src/util/fontxlfd.c
+++ b/src/util/fontxlfd.c
@@ -145,9 +145,9 @@ xlfd_double_to_text(double value, char *buffer, int space_required)
if (value == 0.0) exponent = 0;
/* Figure out how many digits are significant */
- while (p1 >= buffer && (!isdigit(*p1) || *p1 == '0')) p1--;
+ while (p1 >= buffer && (!isdigit((unsigned char)*p1) || *p1 == '0')) p1--;
ndigits = 0;
- while (p1 >= buffer) if (isdigit(*p1--)) ndigits++;
+ while (p1 >= buffer) if (isdigit((unsigned char)*p1--)) ndigits++;
/* Figure out notation to use */
if (exponent >= XLFD_NDIGITS || ndigits - exponent > XLFD_NDIGITS + 1)
@@ -278,7 +278,7 @@ GetMatrix(char *ptr, FontScalablePtr vals, int which)
matrix = vals->point_matrix;
else return (char *)0;
- while (isspace(*ptr)) ptr++;
+ while (isspace((unsigned char)*ptr)) ptr++;
if (*ptr == '[')
{
/* This is a matrix containing real numbers. It would be nice
@@ -292,13 +292,13 @@ GetMatrix(char *ptr, FontScalablePtr vals, int which)
(ptr = readreal(ptr, matrix + 2)) &&
(ptr = readreal(ptr, matrix + 3)))
{
- while (isspace(*ptr)) ptr++;
+ while (isspace((unsigned char)*ptr)) ptr++;
if (*ptr != ']')
ptr = (char *)0;
else
{
ptr++;
- while (isspace(*ptr)) ptr++;
+ while (isspace((unsigned char)*ptr)) ptr++;
if (*ptr == '-')
{
if (which == POINTSIZE_MASK)