]> granicus.if.org Git - php/commitdiff
- MFH
authorAndi Gutmans <andi@php.net>
Sat, 11 Sep 2004 00:23:33 +0000 (00:23 +0000)
committerAndi Gutmans <andi@php.net>
Sat, 11 Sep 2004 00:23:33 +0000 (00:23 +0000)
Zend/zend_operators.c

index 96217df5b15df6cc68a9ec0fc158939e5b9c701b..3a49d12876ab4c94f85199c15f616ec6194ae58c 100644 (file)
@@ -183,7 +183,15 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
        }
 
 
-#define DVAL_TO_LVAL(d, l) (l) = (d) > LONG_MAX ? (unsigned long) (d) : (long) (d)
+#define DVAL_TO_LVAL(d, l) do {                        \
+       if ((d) > LONG_MAX) {                   \
+               l = LONG_MAX;                   \
+       } else if ((d) < LONG_MIN) {            \
+               l = LONG_MIN;                   \
+       } else {                                \
+               l = (d);                        \
+       }                                       \
+} while (0)
 
 #define zendi_convert_to_long(op, holder, result)                                      \
        if (op==result) {                                                                                               \