[PATCH] parsers: use char instead of int8_t

elson.wei at gmail.com elson.wei at gmail.com
Thu Sep 12 01:35:58 CDT 2013


# HG changeset patch
# User Wei, Elson <elson.wei at gmail.com>
# Date 1378967736 -28800
#      Thu Sep 12 14:35:36 2013 +0800
# Node ID 323830f2c65ece0e6111aae2b11d219d23b68d12
# Parent  d69e06724b96a985f29fd493a5dfe356a75af387
parsers: use char instead of int8_t

MS Windows SDK v7.0 doesn't have stdint.h in which int8_t is defined.
For compatibility, changes the type of "hextable" back to char[].

diff --git a/mercurial/parsers.c b/mercurial/parsers.c
--- a/mercurial/parsers.c
+++ b/mercurial/parsers.c
@@ -14,7 +14,7 @@
 
 #include "util.h"
 
-static int8_t hextable[256] = {
+static char hextable[256] = {
 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -35,7 +35,7 @@
 
 static inline int hexdigit(const char *p, Py_ssize_t off)
 {
-	int8_t val = hextable[(unsigned char)p[off]];
+	char val = hextable[(unsigned char)p[off]];
 
 	if (val >= 0) {
 		return val;


More information about the Mercurial-devel mailing list