summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSVN Migration <svn@php.net>2005-11-17 21:27:59 +0000
committerSVN Migration <svn@php.net>2005-11-17 21:27:59 +0000
commit5f128c84afa6530c74f303109156c88912ce2de9 (patch)
tree033e5859e61f1e5a46699569511420771ca5be46
parent4ba37d04d472be40d3893128101fa221013bc975 (diff)
downloadphp-git-php-5.1.0RC6.tar.gz
This commit was manufactured by cvs2svn to create tag 'php_5_1_0RC6'.php-5.1.0RC6
-rw-r--r--Zend/zend_API.c4
-rw-r--r--Zend/zend_operators.h24
2 files changed, 11 insertions, 17 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index af70c3dd48..5aa684b4c8 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -296,7 +296,7 @@ static char *zend_parse_arg_impl(zval **arg, va_list *va, char **spec TSRMLS_DC)
double d;
int type;
- if ((type = is_numeric_string(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), p, &d, -1)) == 0) {
+ if ((type = is_numeric_string(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), p, &d, 0)) == 0) {
return "long";
} else if (type == IS_DOUBLE) {
*p = (long) d;
@@ -330,7 +330,7 @@ static char *zend_parse_arg_impl(zval **arg, va_list *va, char **spec TSRMLS_DC)
long l;
int type;
- if ((type = is_numeric_string(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), &l, p, -1)) == 0) {
+ if ((type = is_numeric_string(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), &l, p, 0)) == 0) {
return "double";
} else if (type == IS_LONG) {
*p = (double) l;
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index b58ffb14df..0f1f23e469 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -65,7 +65,7 @@ ZEND_API zend_bool instanceof_function_ex(zend_class_entry *instance_ce, zend_cl
ZEND_API zend_bool instanceof_function(zend_class_entry *instance_ce, zend_class_entry *ce TSRMLS_DC);
END_EXTERN_C()
-static inline zend_bool is_numeric_string(char *str, int length, long *lval, double *dval, int allow_errors)
+static inline zend_bool is_numeric_string(char *str, int length, long *lval, double *dval, zend_bool allow_errors)
{
long local_lval;
double local_dval;
@@ -116,20 +116,14 @@ static inline zend_bool is_numeric_string(char *str, int length, long *lval, dou
} else {
end_ptr_double=NULL;
}
-
- if (!allow_errors) {
- return 0;
- }
- if (allow_errors == -1) {
- zend_error(E_NOTICE, "A non well formed numeric value encountered");
- }
-
- if (end_ptr_double>end_ptr_long && dval) {
- *dval = local_dval;
- return IS_DOUBLE;
- } else if (end_ptr_long && lval) {
- *lval = local_lval;
- return IS_LONG;
+ if (allow_errors) {
+ if (end_ptr_double>end_ptr_long && dval) {
+ *dval = local_dval;
+ return IS_DOUBLE;
+ } else if (end_ptr_long && lval) {
+ *lval = local_lval;
+ return IS_LONG;
+ }
}
return 0;
}