com php-src: some fixes to constants, var_dump and var_ export: ext/standard/php_smart_str.h ext/standard/v ar.c
| From: | Anatol Belski | Date: | Wed, 16 Oct 2013 10:14:11 +0000 |
| Subject: | com php-src: some fixes to constants, var_dump and var_ export: ext/standard/php_smart_str.h ext/standard/v ar.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-73466@lists.php.net to get a copy of this message | ||
Commit: 34818356fc3c957485a6fd94b92fdec0a3695621
Author: Anatol Belski <ab@php.net> Fri, 23 Aug 2013 02:34:14 -0700
Parents: dfec5cf7750f1628a29332918a521be8dba92131
Branches: str_size_and_int64
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=34818356fc3c957485a6fd94b92fdec0a3695621
Log:
some fixes to constants, var_dump and var_export
Changed paths:
M ext/standard/php_smart_str.h
M ext/standard/var.c
Diff:
diff --git a/ext/standard/php_smart_str.h b/ext/standard/php_smart_str.h
index 7e8c491..8bb351b 100644
--- a/ext/standard/php_smart_str.h
+++ b/ext/standard/php_smart_str.h
@@ -88,6 +88,8 @@
smart_str_append_ex((dest), (src), 0)
#define smart_str_append_long(dest, val) \
smart_str_append_long_ex((dest), (val), 0)
+#define smart_str_append_php_int(dest, val) \
+ smart_str_append_php_int_ex((dest), (val), 0)
#define smart_str_append_str_size(dest, val) \
smart_str_append_str_size_ex((dest), (val), 0)
#define smart_str_append_off_t(dest, val) \
@@ -180,6 +182,9 @@ static inline char *smart_str_print_unsigned(char *buf, long num) {
#define smart_str_append_str_size_ex(dest, num, type) \
smart_str_append_generic_ex((dest), (num), (type), zend_str_size, _long)
+#define smart_str_append_php_int_ex(dest, num, type) \
+ smart_str_append_generic_ex((dest), (num), (type), php_int_t, _long)
+
#define smart_str_append_off_t_ex(dest, num, type) \
smart_str_append_generic_ex((dest), (num), (type), off_t, _long)
diff --git a/ext/standard/var.c b/ext/standard/var.c
index 585d043...c259df9 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -104,7 +104,11 @@ PHPAPI void php_var_dump(zval **struc, int level TSRMLS_DC) /* {{{ */
php_printf("%sNULL\n", COMMON);
break;
case IS_LONG:
+#ifdef ZEND_ENABLE_INT64
+ php_printf("%sint(%lld)\n", COMMON, Z_LVAL_PP(struc));
+#else
php_printf("%sint(%ld)\n", COMMON, Z_LVAL_PP(struc));
+#endif
break;
case IS_DOUBLE:
php_printf("%sfloat(%.*G)\n", COMMON, (int) EG(precision), Z_DVAL_PP(struc));
@@ -433,7 +437,7 @@ PHPAPI void php_var_export_ex(zval **struc, int level, smart_str *buf TSRMLS_DC)
smart_str_appendl(buf, "NULL", 4);
break;
case IS_LONG:
- smart_str_append_long(buf, Z_LVAL_PP(struc));
+ smart_str_append_php_int(buf, Z_LVAL_PP(struc));
break;
case IS_DOUBLE:
tmp_len = spprintf(&tmp_str, 0,"%.*H", (int) EG(precision), Z_DVAL_PP(struc));