summaryrefslogtreecommitdiff
path: root/ext/standard/php_smart_string.h
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2014-09-19 23:22:26 +0200
committerNikita Popov <nikic@php.net>2014-09-19 23:39:07 +0200
commit31e842472f46d8aa32e2ef316da245f18806589d (patch)
treee87882472345b757f3b898c441dc9e80e0d4364a /ext/standard/php_smart_string.h
parentad3e1830bafdcbf366f611c8778c5409bd4472d2 (diff)
downloadphp-git-31e842472f46d8aa32e2ef316da245f18806589d.tar.gz
Make number printing functions less generic
Now that zend_ulong is 64bit on 64bit platforms, it should be sufficient to always use it, rather than supporting multiple types. API changes: * _zend_print_unsigned_to_buf and _zend_print_signed_to_buf no longer exist. * smart_str(ing)_print_long and smart_str(ing)_print_unsigned no longer exist. * Instead of all these, zend_print_ulong_to_buf and zend_print_long_to_buf should be used. * smart_str_append_generic_ex no longer exists. * smart_str(ing)_append_off_t(_ex) no longer exists, use smart_str(ing)_append_long(_ex) instead.
Diffstat (limited to 'ext/standard/php_smart_string.h')
-rw-r--r--ext/standard/php_smart_string.h24
1 files changed, 3 insertions, 21 deletions
diff --git a/ext/standard/php_smart_string.h b/ext/standard/php_smart_string.h
index 36647aa27a..e052574a34 100644
--- a/ext/standard/php_smart_string.h
+++ b/ext/standard/php_smart_string.h
@@ -89,8 +89,6 @@
smart_string_append_ex((dest), (src), 0)
#define smart_string_append_long(dest, val) \
smart_string_append_long_ex((dest), (val), 0)
-#define smart_string_append_off_t(dest, val) \
- smart_string_append_off_t_ex((dest), (val), 0)
#define smart_string_append_unsigned(dest, val) \
smart_string_append_unsigned_ex((dest), (val), 0)
@@ -119,33 +117,17 @@
__dest->len = __nl; \
} while (0)
-static inline char *smart_string_print_long(char *buf, zend_long num) {
- char *r;
- _zend_print_signed_to_buf(buf, num, zend_long, r);
- return r;
-}
-
-static inline char *smart_string_print_unsigned(char *buf, zend_long num) {
- char *r;
- _zend_print_unsigned_to_buf(buf, num, zend_ulong, r);
- return r;
-}
-
#define smart_string_append_generic_ex(dest, num, type, vartype, func) do { \
char __b[32]; \
- char *__t; \
- _zend_print##func##_to_buf(__b + sizeof(__b) - 1, (num), vartype, __t); \
+ char *__t = zend_print##func##_to_buf(__b + sizeof(__b) - 1, (num)); \
smart_string_appendl_ex((dest), __t, __b + sizeof(__b) - 1 - __t, (type)); \
} while (0)
#define smart_string_append_unsigned_ex(dest, num, type) \
- smart_string_append_generic_ex((dest), (num), (type), zend_ulong, _unsigned)
+ smart_string_append_generic_ex((dest), (num), (type), zend_ulong, _ulong)
#define smart_string_append_long_ex(dest, num, type) \
- smart_string_append_generic_ex((dest), (num), (type), zend_ulong, _signed)
-
-#define smart_string_append_off_t_ex(dest, num, type) \
- smart_string_append_generic_ex((dest), (num), (type), zend_off_t, _signed)
+ smart_string_append_generic_ex((dest), (num), (type), zend_ulong, _long)
#define smart_string_append_ex(dest, src, what) \
smart_string_appendl_ex((dest), ((smart_string *)(src))->c, \