aboutsummaryrefslogtreecommitdiff
path: root/libX11/src/RdBitF.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-07-12 18:20:04 +0000
committermarha <marha@users.sourceforge.net>2009-07-12 18:20:04 +0000
commitda8fe31a7ba4acf109097d5696ad0145b991cdfd (patch)
tree1c74d6f075702a73e557872f2a6f020ea4eb5432 /libX11/src/RdBitF.c
parent6590f805a12779909cb8504c230fa367148fe38c (diff)
parent529dcfd0858d75cb3c87c73cb0f81dd20bbb9230 (diff)
downloadvcxsrv-da8fe31a7ba4acf109097d5696ad0145b991cdfd.tar.gz
vcxsrv-da8fe31a7ba4acf109097d5696ad0145b991cdfd.tar.bz2
vcxsrv-da8fe31a7ba4acf109097d5696ad0145b991cdfd.zip
Changes for VC compilation
Diffstat (limited to 'libX11/src/RdBitF.c')
-rw-r--r--libX11/src/RdBitF.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/libX11/src/RdBitF.c b/libX11/src/RdBitF.c
index 0b31230e6..013d4ea88 100644
--- a/libX11/src/RdBitF.c
+++ b/libX11/src/RdBitF.c
@@ -56,6 +56,7 @@ from The Open Group.
#define MAX_SIZE 255
/* shared data for the image read/parse logic */
+/*
static const short hexTable[256] = {
['0'] = 0, ['1'] = 1,
['2'] = 2, ['3'] = 3,
@@ -73,6 +74,23 @@ static const short hexTable[256] = {
['}'] = -1, ['\n'] = -1,
['\t'] = -1
};
+*/
+short hexTable(unsigned char Char)
+{
+ if (Char<'0')
+ return -1;
+ if (Char<='9')
+ return Char-'0';
+ if (Char<'A')
+ return -1;
+ if (Char<='F')
+ return Char-'A'+10;
+ if (Char<'a')
+ return -1;
+ if (Char<='f')
+ return Char-'a'+10;
+ return -1;
+}
/*
* read next hex value in the input stream, return -1 if EOF
@@ -98,9 +116,9 @@ NextInt (
/* trim high bits, check type and accumulate */
ch &= 0xff;
if (isascii(ch) && isxdigit(ch)) {
- value = (value << 4) + hexTable[ch];
+ value = (value << 4) + hexTable(ch);
gotone++;
- } else if ((hexTable[ch]) < 0 && gotone)
+ } else if ((hexTable(ch)) < 0 && gotone)
done++;
}
}