summaryrefslogtreecommitdiff
path: root/ext/json/JSON_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/JSON_parser.c')
-rw-r--r--ext/json/JSON_parser.c18
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) {