From 19f8217113ca5582130a4bc396c6d44278dea96f Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 17 Sep 2014 09:03:47 +0200 Subject: reduce struct size by 8 byte on 64 bit --- ext/json/utf8_decode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/json') diff --git a/ext/json/utf8_decode.h b/ext/json/utf8_decode.h index cc0fc79f6c..0908edd2d4 100644 --- a/ext/json/utf8_decode.h +++ b/ext/json/utf8_decode.h @@ -5,8 +5,8 @@ typedef struct json_utf8_decode { - int the_index; char *the_input; + int the_index; int the_length; int the_char; int the_byte; -- cgit v1.2.1 From 3bc8a958c5ec647adbe409ee6411ae7ed6a3dc3b Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 19 Sep 2014 15:41:01 +0400 Subject: Fixed useless or duplicated IS_INTERNED() checks --- ext/json/json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/json') diff --git a/ext/json/json.c b/ext/json/json.c index 24324bbe99..2b35c00041 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -789,7 +789,7 @@ static PHP_FUNCTION(json_encode) ZVAL_FALSE(return_value); } else { smart_str_0(&buf); /* copy? */ - ZVAL_STR(return_value, buf.s); + ZVAL_NEW_STR(return_value, buf.s); } } /* }}} */ -- cgit v1.2.1 From d0cb715373c3fbe9dc095378ec5ed8c71f799f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Schl=C3=BCter?= Date: Fri, 19 Sep 2014 18:33:14 +0200 Subject: s/PHP 5/PHP 7/ --- ext/json/json.c | 2 +- ext/json/php_json.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/json') diff --git a/ext/json/json.c b/ext/json/json.c index 2b35c00041..4b4522ed30 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/ext/json/php_json.h b/ext/json/php_json.h index 08a4a7ff94..05dcc43e06 100644 --- a/ext/json/php_json.h +++ b/ext/json/php_json.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ -- cgit v1.2.1 From 37aaccad7d8b9428c69f8c03806e1635575f216b Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 19 Sep 2014 22:16:01 +0200 Subject: Use inline functions for most of smart_str smart_str_free_ex no longer exists, always use smart_str_free instead. smart_str_alloc no longer requires a newlen variable to be in scope, instead it returns the new length. --- ext/json/json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/json') diff --git a/ext/json/json.c b/ext/json/json.c index 4b4522ed30..485d14d11b 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -384,7 +384,7 @@ static void json_escape_string(smart_str *buf, char *s, size_t len, int options { int status; unsigned int us, next_us = 0; - size_t pos, checkpoint, newlen; + size_t pos, checkpoint; if (len == 0) { smart_str_appendl(buf, "\"\"", 2); -- cgit v1.2.1