mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-11-02 07:53:43 +00:00
fix the ambiguous type defination
This commit is contained in:
+11
-11
@@ -50,7 +50,7 @@ typedef unsigned short json_uchar;
|
||||
|
||||
static unsigned char hex_value (json_char c)
|
||||
{
|
||||
if (isdigit(c))
|
||||
if (isdigit((uint8_t)c))
|
||||
return c - '0';
|
||||
|
||||
switch (c) {
|
||||
@@ -193,7 +193,7 @@ static const long
|
||||
flag_next = 1 << 0,
|
||||
flag_reproc = 1 << 1,
|
||||
flag_need_comma = 1 << 2,
|
||||
flag_seek_value = 1 << 3,
|
||||
flag_seek_value = 1 << 3,
|
||||
flag_escaped = 1 << 4,
|
||||
flag_string = 1 << 5,
|
||||
flag_need_colon = 1 << 6,
|
||||
@@ -263,7 +263,7 @@ json_value * json_parse_ex (json_settings * settings,
|
||||
for (i = json ;; ++ i)
|
||||
{
|
||||
json_char b = (i == end ? 0 : *i);
|
||||
|
||||
|
||||
if (flags & flag_string)
|
||||
{
|
||||
if (!b)
|
||||
@@ -287,7 +287,7 @@ json_value * json_parse_ex (json_settings * settings,
|
||||
case 't': string_add ('\t'); break;
|
||||
case 'u':
|
||||
|
||||
if (end - i < 4 ||
|
||||
if (end - i < 4 ||
|
||||
(uc_b1 = hex_value (*++ i)) == 0xFF || (uc_b2 = hex_value (*++ i)) == 0xFF
|
||||
|| (uc_b3 = hex_value (*++ i)) == 0xFF || (uc_b4 = hex_value (*++ i)) == 0xFF)
|
||||
{
|
||||
@@ -363,7 +363,7 @@ json_value * json_parse_ex (json_settings * settings,
|
||||
if (state.first_pass)
|
||||
(*(json_char **) &top->u.object.values) += string_length + 1;
|
||||
else
|
||||
{
|
||||
{
|
||||
top->u.object.values [top->u.object.length].name
|
||||
= (json_char *) top->_reserved.object_mem;
|
||||
|
||||
@@ -576,14 +576,14 @@ json_value * json_parse_ex (json_settings * settings,
|
||||
|
||||
default:
|
||||
|
||||
if (isdigit (b) || b == '-')
|
||||
if (isdigit ((uint8_t)b) || b == '-')
|
||||
{
|
||||
if (!new_value (&state, &top, &root, &alloc, json_integer))
|
||||
goto e_alloc_failure;
|
||||
|
||||
if (!state.first_pass)
|
||||
{
|
||||
while (isdigit (b) || b == '+' || b == '-'
|
||||
while (isdigit ((uint8_t)b) || b == '+' || b == '-'
|
||||
|| b == 'e' || b == 'E' || b == '.')
|
||||
{
|
||||
if ( (++ i) == end)
|
||||
@@ -628,7 +628,7 @@ json_value * json_parse_ex (json_settings * settings,
|
||||
switch (top->type)
|
||||
{
|
||||
case json_object:
|
||||
|
||||
|
||||
switch (b)
|
||||
{
|
||||
whitespace:
|
||||
@@ -648,7 +648,7 @@ json_value * json_parse_ex (json_settings * settings,
|
||||
string_length = 0;
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case '}':
|
||||
|
||||
flags = (flags & ~ flag_need_comma) | flag_next;
|
||||
@@ -673,7 +673,7 @@ json_value * json_parse_ex (json_settings * settings,
|
||||
case json_integer:
|
||||
case json_double:
|
||||
|
||||
if (isdigit (b))
|
||||
if (isdigit ((uint8_t)b))
|
||||
{
|
||||
++ num_digits;
|
||||
|
||||
@@ -804,7 +804,7 @@ json_value * json_parse_ex (json_settings * settings,
|
||||
|
||||
if (top->parent->type == json_array)
|
||||
flags |= flag_seek_value;
|
||||
|
||||
|
||||
if (!state.first_pass)
|
||||
{
|
||||
json_value * parent = top->parent;
|
||||
|
||||
Reference in New Issue
Block a user