Skip to content

Commit fe36285

Browse files
committed
fix datatype mismatches
1 parent 0ae011f commit fe36285

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎ext/json/json_encoder.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static inline void php_json_encode_double(smart_str *buf, double d, int options)
104104
{
105105
size_t len;
106106
char num[PHP_JSON_DOUBLE_MAX_LENGTH];
107-
php_gcvt(d, EG(precision), '.', 'e', &num[0]);
107+
php_gcvt(d, (int)EG(precision), '.', 'e', &num[0]);
108108
len = strlen(num);
109109
if (options & PHP_JSON_PRESERVE_ZERO_FRACTION && strchr(num, '.') == NULL && len < PHP_JSON_DOUBLE_MAX_LENGTH - 2) {
110110
num[len++] = '.';

‎ext/json/json_parser.tab.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1817,7 +1817,7 @@ void php_json_parser_object_init(php_json_parser *parser, zval *object)
18171817
void php_json_parser_object_update(php_json_parser *parser, zval *object, zval *zkey, zval *zvalue)
18181818
{
18191819
char *key = Z_STRVAL_P(zkey);
1820-
int key_len = Z_STRLEN_P(zkey);
1820+
size_t key_len = Z_STRLEN_P(zkey);
18211821

18221822
if (parser->scanner.options & PHP_JSON_OBJECT_AS_ARRAY) {
18231823
add_assoc_zval_ex(object, key, key_len, zvalue);

‎ext/json/json_parser.y‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ void php_json_parser_object_init(php_json_parser *parser, zval *object)
188188
void php_json_parser_object_update(php_json_parser *parser, zval *object, zval *zkey, zval *zvalue)
189189
{
190190
char *key = Z_STRVAL_P(zkey);
191-
int key_len = Z_STRLEN_P(zkey);
191+
size_t key_len = Z_STRLEN_P(zkey);
192192

193193
if (parser->scanner.options & PHP_JSON_OBJECT_AS_ARRAY) {
194194
add_assoc_zval_ex(object, key, key_len, zvalue);

0 commit comments

Comments
 (0)