com php-src: Fix boolean conversion warnings: ext/reflection/ph p_reflection.c

From: Date: Fri, 23 Oct 2015 03:19:19 +0000
Subject: com php-src: Fix boolean conversion warnings: ext/reflection/ph p_reflection.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-89485@lists.php.net to get a copy of this message
Commit: bbaf6daa9db6e6389181b0cc72175cfa023a398c Author: c9s <yoanlin93@gmail.com> Thu, 22 Oct 2015 20:59:42 +0800 Committer: Xinchen Hui <laruence@gmail.com> Fri, 23 Oct 2015 11:19:19 +0800 Parents: 3dc0bf7428f32908d4c1fe0236e5d0ef23a8eed4 Branches: PHP-7.0 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bbaf6daa9db6e6389181b0cc72175cfa023a398c Log: Fix boolean conversion warnings Summary: The compiler complains and raised some warnings about boolean conversion: warning: address of 'ce->constants_table' will always evaluate to 'true' [-Wpointer-bool-conversion] Since the address of 'HashTable' will always evaluate to true. the condition should be removed. The scope is kept for local variables. Platform: OS X 10.11 Compiler: Apple LLVM version 7.0.0 (clang-700.0.72) Target: x86_64-apple-darwin15.0.0 Thread model: posix Changed paths: M ext/reflection/php_reflection.c Diff: diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index df905bf..6890d0e 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -445,7 +445,6 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in } /* Constants */ - if (&ce->constants_table) { string_printf(str, "\n"); count = zend_hash_num_elements(&ce->constants_table); string_printf(str, "%s - Constants [%d] {\n", indent, count); @@ -459,10 +458,8 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in } ZEND_HASH_FOREACH_END(); } string_printf(str, "%s }\n", indent); - } /* Static properties */ - if (&ce->properties_info) { /* counting static properties */ count = zend_hash_num_elements(&ce->properties_info); if (count > 0) { @@ -489,10 +486,8 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in } ZEND_HASH_FOREACH_END(); } string_printf(str, "%s }\n", indent); - } /* Static methods */ - if (&ce->function_table) { /* counting static methods */ count = zend_hash_num_elements(&ce->function_table); if (count > 0) { @@ -524,10 +519,8 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in string_printf(str, "\n"); } string_printf(str, "%s }\n", indent); - } /* Default/Implicit properties */ - if (&ce->properties_info) { count = zend_hash_num_elements(&ce->properties_info) - count_static_props - count_shadow_props; string_printf(str, "\n%s - Properties [%d] {\n", indent, count); if (count > 0) { @@ -540,7 +533,6 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in } ZEND_HASH_FOREACH_END(); } string_printf(str, "%s }\n", indent); - } if (obj && Z_TYPE_P(obj) == IS_OBJECT && Z_OBJ_HT_P(obj)->get_properties) { string dyn; @@ -568,7 +560,6 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in } /* Non static methods */ - if (&ce->function_table) { count = zend_hash_num_elements(&ce->function_table) - count_static_funcs; if (count > 0) { zend_function *mptr; @@ -617,7 +608,6 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in string_printf(str, "\n%s - Methods [0] {\n", indent); } string_printf(str, "%s }\n", indent); - } string_printf(str, "%s}\n", indent); string_free(&sub_indent);

« previous php.cvs (#89485) next »