For Programmers: Free Programming Magazines  


Home > Archive > PHP Zend Engine > September 2006 > cvs: ZendEngine2 / zend_operators.c









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: ZendEngine2 / zend_operators.c
Antony Dovgal

2006-09-27, 6:56 pm

tony2001 Wed Sep 27 15:40:09 2006 UTC

Modified files:
/ZendEngine2 zend_operators.c
Log:
use if() instead of ?: and avoid possible optimization problems


http://cvs.php.net/viewvc.cgi/ZendE...6&diff_format=u
Index: ZendEngine2/zend_operators.c
diff -u ZendEngine2/zend_operators.c:1.255 ZendEngine2/zend_operators.c:1.256
--- ZendEngine2/zend_operators.c:1.255 Tue Sep 19 10:38:30 2006
+++ ZendEngine2/zend_operators.c Wed Sep 27 15:40:09 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/

-/* $Id: zend_operators.c,v 1.255 2006/09/19 10:38:30 dmitry Exp $ */
+/* $Id: zend_operators.c,v 1.256 2006/09/27 15:40:09 tony2001 Exp $ */

#include <ctype.h>

@@ -221,8 +221,13 @@
} \
}

+#define DVAL_TO_LVAL(d, l) \
+ if ((d) > LONG_MAX) { \
+ (l) = (unsigned long) (d); \
+ } else { \
+ (l) = (long) (d); \
+ }

-#define DVAL_TO_LVAL(d, l) (l) = (((d) > LONG_MAX) ? (unsigned long) (d) : (long) (d))

#define zendi_convert_to_long(op, holder, result) \
if (op == result) { \
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com