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/json.c') 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 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/json/json.c') 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 | +----------------------------------------------------------------------+ -- 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/json.c') 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 From e33f3d3b7c9a69fe069484045a27d282aa98b00e Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 20 Sep 2014 22:42:02 +0200 Subject: Move smart_str implementation into Zend/ So we can use it there as well... For now I've retained the zend_smart_str_public.h header, though it would probably be better to just move that one struct into zend_types.h. --- ext/json/json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/json/json.c') diff --git a/ext/json/json.c b/ext/json/json.c index 485d14d11b..16e452a004 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -26,7 +26,7 @@ #include "php_ini.h" #include "ext/standard/info.h" #include "ext/standard/html.h" -#include "ext/standard/php_smart_str.h" +#include "zend_smart_str.h" #include "JSON_parser.h" #include "php_json.h" #include -- cgit v1.2.1