Permalink
Browse files

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.
  • Loading branch information...
1 parent 423c90d commit ca2514dd3a6fb5e561ff334517ea090ebd8eff13 Cliff Frey committed with ry Aug 18, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 http_parser.c
View
6 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 */

0 comments on commit ca2514d

Please sign in to comment.