This commit is contained in:
Jani Taskinen 2009-05-10 22:37:30 +00:00
parent 5ff419882b
commit 1895deb41c

View file

@ -81,7 +81,7 @@ END_EXTERN_C()
(l) = LONG_MAX; \ (l) = LONG_MAX; \
} else if ((d) <= LONG_MIN) { \ } else if ((d) <= LONG_MIN) { \
(l) = LONG_MIN; \ (l) = LONG_MIN; \
} else {\ } else { \
(l) = (long) (d); \ (l) = (long) (d); \
} }
#else #else
@ -258,7 +258,8 @@ zend_memnstr(char *haystack, char *needle, int needle_len, char *end)
if (needle_len == 1) { if (needle_len == 1) {
return (char *)memchr(p, *needle, (end-p)); return (char *)memchr(p, *needle, (end-p));
} }
if(needle_len > end-haystack) {
if (needle_len > end-haystack) {
return NULL; return NULL;
} }
@ -319,6 +320,7 @@ ZEND_API void multi_convert_to_double_ex(int argc, ...);
ZEND_API void multi_convert_to_string_ex(int argc, ...); ZEND_API void multi_convert_to_string_ex(int argc, ...);
ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2); ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2);
ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2); ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2);
#define convert_to_string(op) _convert_to_string((op) ZEND_FILE_LINE_CC) #define convert_to_string(op) _convert_to_string((op) ZEND_FILE_LINE_CC)
#define convert_to_string_with_converter(op, conv) _convert_to_string_with_converter((op), (conv) TSRMLS_CC ZEND_FILE_LINE_CC) #define convert_to_string_with_converter(op, conv) _convert_to_string_with_converter((op), (conv) TSRMLS_CC ZEND_FILE_LINE_CC)
#define convert_to_unicode(op) _convert_to_unicode((op) TSRMLS_CC ZEND_FILE_LINE_CC) #define convert_to_unicode(op) _convert_to_unicode((op) TSRMLS_CC ZEND_FILE_LINE_CC)
@ -371,6 +373,7 @@ ZEND_API long zend_atol(const char *str, int str_len);
ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC); ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC);
END_EXTERN_C() END_EXTERN_C()
#define convert_to_ex_master(ppzv, lower_type, upper_type) \ #define convert_to_ex_master(ppzv, lower_type, upper_type) \
if (Z_TYPE_PP(ppzv)!=IS_##upper_type) { \ if (Z_TYPE_PP(ppzv)!=IS_##upper_type) { \
SEPARATE_ZVAL_IF_NOT_REF(ppzv); \ SEPARATE_ZVAL_IF_NOT_REF(ppzv); \
@ -408,7 +411,7 @@ END_EXTERN_C()
assert(0); \ assert(0); \
break; \ break; \
} \ } \
} while (0); \ } while (0);
#define convert_to_explicit_type_ex(ppzv, str_type) \ #define convert_to_explicit_type_ex(ppzv, str_type) \
if (Z_TYPE_PP(ppzv) != str_type) { \ if (Z_TYPE_PP(ppzv) != str_type) { \