diff options
author | Anatol Belski <ab@php.net> | 2014-08-22 08:58:03 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-08-22 08:58:03 +0200 |
commit | 79f888a602db3814a6ab03183eff6375bfe9234a (patch) | |
tree | f1b6d1fb76ca4d613a5cc1b551057dac33d3f585 /ext/json/JSON_parser.c | |
parent | da35db3ec5fc4b27087292c067a6ea1d0f77bf8f (diff) | |
parent | 411b920a6f8d53025caddb30895b27d04a3576b4 (diff) | |
download | php-git-POST_64BIT_BRANCH_MERGE.tar.gz |
Merge remote-tracking branch 'weltling/master'POST_64BIT_BRANCH_MERGE
* weltling/master: (725 commits)
fix zpp
fixed array_pad()
fix zpp
fix zpp
fix zpp
fix zpp and a bit more
fix zpp
fix zpp
fix zpp
fix zpp
fix zpp
fix zpp
fix zpp
fix zpp
fix zpp
fix zpp
fix zpp
fix zpp
fix zpp
fixed the test
...
Diffstat (limited to 'ext/json/JSON_parser.c')
-rw-r--r-- | ext/json/JSON_parser.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ext/json/JSON_parser.c b/ext/json/JSON_parser.c index 116fc0c9b6..f2a1ee4dda 100644 --- a/ext/json/JSON_parser.c +++ b/ext/json/JSON_parser.c @@ -293,7 +293,7 @@ static int dehexchar(char c) static void json_create_zval(zval *z, smart_str *buf, int type, int options TSRMLS_DC) { - if (type == IS_LONG) + if (type == IS_INT) { zend_bool bigint = 0; @@ -301,9 +301,9 @@ static void json_create_zval(zval *z, smart_str *buf, int type, int options TSRM buf->s->len--; } - if (buf->s->len >= MAX_LENGTH_OF_LONG - 1) { - if (buf->s->len == MAX_LENGTH_OF_LONG - 1) { - int cmp = strcmp(buf->s->val + (buf->s->val[0] == '-'), long_min_digits); + if (buf->s->len >= MAX_LENGTH_OF_ZEND_INT - 1) { + if (buf->s->len == MAX_LENGTH_OF_ZEND_INT - 1) { + int cmp = strcmp(buf->s->val + (buf->s->val[0] == '-'), int_min_digits); if (!(cmp < 0 || (cmp == 0 && buf->s->val[0] == '-'))) { bigint = 1; @@ -326,7 +326,7 @@ static void json_create_zval(zval *z, smart_str *buf, int type, int options TSRM } } - ZVAL_LONG(z, strtol(buf->s->val, NULL, 10)); + ZVAL_INT(z, strtol(buf->s->val, NULL, 10)); } else if (type == IS_DOUBLE) { @@ -373,7 +373,7 @@ static void utf16_to_utf8(smart_str *buf, unsigned short utf16) && ((unsigned char) buf->s->val[buf->s->len - 1] & 0xc0) == 0x80) { /* found surrogate pair */ - unsigned long utf32; + php_uint_t utf32; utf32 = (((buf->s->val[buf->s->len - 2] & 0xf) << 16) | ((buf->s->val[buf->s->len - 1] & 0x3f) << 10) @@ -516,10 +516,10 @@ parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, utf16 += dehexchar(next_char); utf16_to_utf8(&buf, utf16); } - } else if (type < IS_LONG && (next_class == C_DIGIT || next_class == C_ZERO)) { - type = IS_LONG; + } else if (type < IS_INT && (next_class == C_DIGIT || next_class == C_ZERO)) { + type = IS_INT; smart_str_appendc(&buf, next_char); - } else if (type == IS_LONG && next_state == E1) { + } else if (type == IS_INT && next_state == E1) { type = IS_DOUBLE; smart_str_appendc(&buf, next_char); } else if (type < IS_DOUBLE && next_class == C_POINT) { |