com php-src: finer fixes for ext/json: ext/json/JSON_parser .c ext/json/JSON_parser.h ext/json/json.c ext/jso n/php_json.h
| From: | Anatol Belski | Date: | Fri, 29 Nov 2013 12:00:29 +0000 |
| Subject: | com php-src: finer fixes for ext/json: ext/json/JSON_parser .c ext/json/JSON_parser.h ext/json/json.c ext/jso n/php_json.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74162@lists.php.net to get a copy of this message | ||
Commit: 23019318b1e92ef324dde2d5655103064a8ab93c
Author: Anatol Belski <ab@php.net> Fri, 29 Nov 2013 13:00:29 +0100
Parents: 3ffecac9163826f7160660996ee77d3dc54f8fa0
Branches: str_size_and_int64
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=23019318b1e92ef324dde2d5655103064a8ab93c
Log:
finer fixes for ext/json
Changed paths:
M ext/json/JSON_parser.c
M ext/json/JSON_parser.h
M ext/json/json.c
M ext/json/php_json.h
Diff:
diff --git a/ext/json/JSON_parser.c b/ext/json/JSON_parser.c
index b95629e..823b1b8 100644
--- a/ext/json/JSON_parser.c
+++ b/ext/json/JSON_parser.c
@@ -239,7 +239,7 @@ pop(JSON_parser jp, int mode)
JSON_checker_char will delete the JSON_checker object if it sees an error.
*/
JSON_parser
-new_JSON_parser(int depth)
+new_JSON_parser(php_int_t depth)
{
JSON_parser jp = (JSON_parser)emalloc(sizeof(struct JSON_parser_struct));
jp->state = GO;
@@ -291,7 +291,7 @@ static int dehexchar(char c)
}
-static void json_create_zval(zval **z, smart_str *buf, int type, int options)
+static void json_create_zval(zval **z, smart_str *buf, int type, php_int_t options)
{
ALLOC_INIT_ZVAL(*z);
@@ -418,7 +418,7 @@ static void attach_zval(JSON_parser jp, int up, int cur, smart_str *key, int ass
#define FREE_BUFFERS() smart_str_free(&buf); smart_str_free(&key);
#define SWAP_BUFFERS(from, to) do { \
char *t1 = from.c; \
- int t2 = from.a; \
+ zend_str_size_int t2 = from.a; \
from.c = to.c; \
from.a = to.a; \
to.c = t1; \
@@ -436,7 +436,7 @@ static void attach_zval(JSON_parser jp, int up, int cur, smart_str *key, int ass
machine with a stack.
*/
int
-parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], zend_str_size_int length, int
options TSRMLS_DC)
+parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], zend_str_size_int length,
php_int_t options TSRMLS_DC)
{
int next_char; /* the next character */
int next_class; /* the next character class */
diff --git a/ext/json/JSON_parser.h b/ext/json/JSON_parser.h
index b3bcd8c..5742ab3 100644
--- a/ext/json/JSON_parser.h
+++ b/ext/json/JSON_parser.h
@@ -11,7 +11,7 @@
typedef struct JSON_parser_struct {
int state;
- int depth;
+ php_int_t depth;
int top;
int error_code;
int* stack;
@@ -31,8 +31,8 @@ enum error_codes {
PHP_JSON_ERROR_UNSUPPORTED_TYPE
};
-extern JSON_parser new_JSON_parser(int depth);
-extern int parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], zend_str_size_int
length, int options TSRMLS_DC);
+extern JSON_parser new_JSON_parser(php_int_t depth);
+extern int parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], zend_str_size_int
length, php_int_t options TSRMLS_DC);
extern int free_JSON_parser(JSON_parser jp);
static inline int parse_JSON(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int
assoc TSRMLS_DC)
diff --git a/ext/json/json.c b/ext/json/json.c
index f459df0...ec5d9af 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -167,7 +167,7 @@ static PHP_MINFO_FUNCTION(json)
}
/* }}} */
-static void json_escape_string(smart_str *buf, char *s, int len, int options TSRMLS_DC);
+static void json_escape_string(smart_str *buf, char *s, zend_str_size_int len, php_int_t options
TSRMLS_DC);
static int json_determine_array_type(zval **val TSRMLS_DC) /* {{{ */
{
@@ -206,7 +206,7 @@ static int json_determine_array_type(zval **val TSRMLS_DC) /* {{{ */
/* {{{ Pretty printing support functions */
-static inline void json_pretty_print_char(smart_str *buf, int options, char c TSRMLS_DC) /* {{{ */
+static inline void json_pretty_print_char(smart_str *buf, php_int_t options, char c TSRMLS_DC) /*
{{{ */
{
if (options & PHP_JSON_PRETTY_PRINT) {
smart_str_appendc(buf, c);
@@ -214,7 +214,7 @@ static inline void json_pretty_print_char(smart_str *buf, int options, char c TS
}
/* }}} */
-static inline void json_pretty_print_indent(smart_str *buf, int options TSRMLS_DC) /* {{{ */
+static inline void json_pretty_print_indent(smart_str *buf, php_int_t options TSRMLS_DC) /* {{{ */
{
int i;
@@ -228,7 +228,7 @@ static inline void json_pretty_print_indent(smart_str *buf, int options TSRMLS_D
/* }}} */
-static void json_encode_array(smart_str *buf, zval **val, int options TSRMLS_DC) /* {{{ */
+static void json_encode_array(smart_str *buf, zval **val, php_int_t options TSRMLS_DC) /* {{{ */
{
int i, r;
HashTable *myht;
@@ -358,7 +358,7 @@ static void json_encode_array(smart_str *buf, zval **val, int options TSRMLS_DC)
}
/* }}} */
-static int json_utf8_to_utf16(unsigned short *utf16, char utf8[], zend_str_size_int len) /* {{{ */
+static php_int_t json_utf8_to_utf16(unsigned short *utf16, char utf8[], zend_str_size_int len) /*
{{{ */
{
size_t pos = 0, us;
zend_str_size_int j;
@@ -397,9 +397,10 @@ static int json_utf8_to_utf16(unsigned short *utf16, char utf8[],
zend_str_size_
/* }}} */
-static void json_escape_string(smart_str *buf, char *s, int len, int options TSRMLS_DC) /* {{{ */
+static void json_escape_string(smart_str *buf, char *s, zend_str_size_int len, php_int_t options
TSRMLS_DC) /* {{{ */
{
- int pos = 0, ulen = 0;
+ zend_str_size_int pos = 0;
+ php_int_t ulen = 0;
unsigned short us;
unsigned short *utf16;
size_t newlen;
@@ -555,7 +556,7 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR
/* }}} */
-static void json_encode_serializable_object(smart_str *buf, zval *val, int options TSRMLS_DC) /*
{{{ */
+static void json_encode_serializable_object(smart_str *buf, zval *val, php_int_t options TSRMLS_DC)
/* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(val);
zval *retval = NULL, fname;
@@ -664,7 +665,7 @@ PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, php_int_t options T
PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, zend_str_size_int str_len,
php_int_t options, php_int_t depth TSRMLS_DC) /* {{{ */
{
- int utf16_len;
+ php_int_t utf16_len;
zval *z;
unsigned short *utf16;
JSON_parser jp;
diff --git a/ext/json/php_json.h b/ext/json/php_json.h
index 861cd7d..8779ec6 100644
--- a/ext/json/php_json.h
+++ b/ext/json/php_json.h
@@ -38,9 +38,9 @@ extern zend_module_entry json_module_entry;
#endif
ZEND_BEGIN_MODULE_GLOBALS(json)
- int encoder_depth;
+ php_int_t encoder_depth;
int error_code;
- int encode_max_depth;
+ php_int_t encode_max_depth;
ZEND_END_MODULE_GLOBALS(json)
#ifdef ZTS