com php-src: And this one...: Zend/zend_operators.h
| From: | Xinchen Hui | Date: | Fri, 03 Oct 2014 11:07:02 +0000 |
| Subject: | com php-src: And this one...: Zend/zend_operators.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82068@lists.php.net to get a copy of this message | ||
Commit: 5e39d0c19c276a20ab84d363955871c71b066de7
Author: Xinchen Hui <laruence@php.net> Fri, 3 Oct 2014 19:07:02 +0800
Parents: aa5f937958fcc0ea95a80e455ff176449c3094dc
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5e39d0c19c276a20ab84d363955871c71b066de7
Log:
And this one...
Changed paths:
M Zend/zend_operators.h
Diff:
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index 39a7e1f..8075edf 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -69,6 +69,24 @@ ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSR
ZEND_API zend_bool instanceof_function_ex(const zend_class_entry *instance_ce, const
zend_class_entry *ce, zend_bool interfaces_only TSRMLS_DC);
ZEND_API zend_bool instanceof_function(const zend_class_entry *instance_ce, const zend_class_entry
*ce TSRMLS_DC);
+
+/**
+ * Checks whether the string "str" with length "length" is numeric. The value
+ * of allow_errors determines whether it's required to be entirely numeric, or
+ * just its prefix. Leading whitespace is allowed.
+ *
+ * The function returns 0 if the string did not contain a valid number; IS_LONG
+ * if it contained a number that fits within the range of a long; or IS_DOUBLE
+ * if the number was out of long range or contained a decimal point/exponent.
+ * The number's value is returned into the respective pointer, *lval or *dval,
+ * if that pointer is not NULL.
+ *
+ * This variant also gives information if a string that represents an integer
+ * could not be represented as such due to overflow. It writes 1 to oflow_info
+ * if the integer is larger than ZEND_LONG_MAX and -1 if it's smaller than ZEND_LONG_MIN.
+ */
+ZEND_API zend_uchar _is_numeric_string_ex(const char *str, size_t length, zend_long *lval, double
*dval, int allow_errors, int *oflow_info);
+
END_EXTERN_C()
#if ZEND_DVAL_TO_LVAL_CAST_OK
@@ -125,23 +143,6 @@ static zend_always_inline zend_long zend_dval_to_lval(double d)
#define ZEND_IS_DIGIT(c) ((c) >= '0' && (c) <= '9')
#define ZEND_IS_XDIGIT(c) (((c) >= 'A' && (c) <= 'F') || ((c)
>= 'a' && (c) <= 'f'))
-/**
- * Checks whether the string "str" with length "length" is numeric. The value
- * of allow_errors determines whether it's required to be entirely numeric, or
- * just its prefix. Leading whitespace is allowed.
- *
- * The function returns 0 if the string did not contain a valid number; IS_LONG
- * if it contained a number that fits within the range of a long; or IS_DOUBLE
- * if the number was out of long range or contained a decimal point/exponent.
- * The number's value is returned into the respective pointer, *lval or *dval,
- * if that pointer is not NULL.
- *
- * This variant also gives information if a string that represents an integer
- * could not be represented as such due to overflow. It writes 1 to oflow_info
- * if the integer is larger than ZEND_LONG_MAX and -1 if it's smaller than ZEND_LONG_MIN.
- */
-ZEND_API zend_uchar _is_numeric_string_ex(const char *str, size_t length, zend_long *lval, double
*dval, int allow_errors, int *oflow_info);
-
static zend_always_inline zend_uchar is_numeric_string_ex(const char *str, size_t length, zend_long
*lval, double *dval, int allow_errors, int *oflow_info)
{
if (*str > '9') {