From ca2514dd3a6fb5e561ff334517ea090ebd8eff13 Mon Sep 17 00:00:00 2001 From: Cliff Frey Date: Wed, 18 Aug 2010 10:37:09 -0700 Subject: [PATCH] Array type cleanups. Also save space acceptable_header[x] is always assigned to a variable of type char, so the 'unsigned' is unnecessary. The other arrays can be of type int8_t/uint8_t to save space. --- http_parser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/http_parser.c b/http_parser.c index c1a7b4f..334c3d0 100644 --- a/http_parser.c +++ b/http_parser.c @@ -108,7 +108,7 @@ static const char *method_strings[] = /* ' ', '_', '-' and all alpha-numeric ascii characters are accepted by acceptable_header. The 'A'-'Z' are lower-cased. */ -static const unsigned char acceptable_header[256] = { +static const char acceptable_header[256] = { /* 0 nul 1 soh 2 stx 3 etx 4 eot 5 enq 6 ack 7 bel */ 0, 0, 0, 0, 0, 0, 0, 0, /* 8 bs 9 ht 10 nl 11 vt 12 np 13 cr 14 so 15 si */ @@ -143,7 +143,7 @@ static const unsigned char acceptable_header[256] = { 'x', 'y', 'z', 0, 0, 0, 0, 0 }; -static const int unhex[256] = +static const int8_t unhex[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 @@ -155,7 +155,7 @@ static const int unhex[256] = }; -static const int normal_url_char[256] = { +static const uint8_t normal_url_char[256] = { /* 0 nul 1 soh 2 stx 3 etx 4 eot 5 enq 6 ack 7 bel */ 0, 0, 0, 0, 0, 0, 0, 0, /* 8 bs 9 ht 10 nl 11 vt 12 np 13 cr 14 so 15 si */