]> granicus.if.org Git - php/commitdiff
- Revert bogus commit
authorDerick Rethans <derick@php.net>
Wed, 24 Mar 2004 14:28:41 +0000 (14:28 +0000)
committerDerick Rethans <derick@php.net>
Wed, 24 Mar 2004 14:28:41 +0000 (14:28 +0000)
Zend/zend_operators.c
main/rfc1867.c

index bb6bb68a30dd7c9c242c676e44c4de1168f57c57..cbc12356593ac87f5954b6710888412cca04a9ea 100644 (file)
@@ -34,6 +34,8 @@
 #include "ext/bcmath/number.h"
 #endif
 
+#define LONG_SIGN_MASK (1L << (8*sizeof(long)-1))
+
 ZEND_API int zend_atoi(const char *str, int str_len)
 {
        int retval;
@@ -725,8 +727,8 @@ ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
                long lval = op1->value.lval + op2->value.lval;
                
                /* check for overflow by comparing sign bits */
-               if ( (op1->value.lval & LONG_MIN) == (op2->value.lval & LONG_MIN
-                       && (op1->value.lval & LONG_MIN) != (lval & LONG_MIN)) {
+               if ( (op1->value.lval & LONG_SIGN_MASK) == (op2->value.lval & LONG_SIGN_MASK
+                       && (op1->value.lval & LONG_SIGN_MASK) != (lval & LONG_SIGN_MASK)) {
 
                        result->value.dval = (double) op1->value.lval + (double) op2->value.lval;
                        result->type = IS_DOUBLE;
@@ -765,8 +767,8 @@ ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
                long lval = op1->value.lval - op2->value.lval;
                
                /* check for overflow by comparing sign bits */
-               if ( (op1->value.lval & LONG_MIN) != (op2->value.lval & LONG_MIN
-                       && (op1->value.lval & LONG_MIN) != (lval & LONG_MIN)) {
+               if ( (op1->value.lval & LONG_SIGN_MASK) != (op2->value.lval & LONG_SIGN_MASK
+                       && (op1->value.lval & LONG_SIGN_MASK) != (lval & LONG_SIGN_MASK)) {
 
                        result->value.dval = (double) op1->value.lval - (double) op2->value.lval;
                        result->type = IS_DOUBLE;
index 1370f5b5a6a2119a798cde77f0ad24df616356c5..3988a9f330ddd8e3d028e5a4b7d2dfcdb3c12e63 100644 (file)
@@ -957,22 +957,16 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
                        while (!cancel_upload && (blen = multipart_buffer_read(mbuff, buff, sizeof(buff) TSRMLS_CC)))
                        {
                                if (PG(upload_max_filesize) > 0 && total_bytes > PG(upload_max_filesize)) {
-#ifdef DEBUG_FILE_UPLOAD
-                                       sapi_module.sapi_error(E_NOTICE, "upload_max_filesize of %ld bytes exceeded - file [%s=%s] not saved", PG(upload_max_filesize), param, filename);
-#endif
+                                       sapi_module.sapi_error(E_WARNING, "upload_max_filesize of %ld bytes exceeded - file [%s=%s] not saved", PG(upload_max_filesize), param, filename);
                                        cancel_upload = UPLOAD_ERROR_A;
                                } else if (max_file_size && (total_bytes > max_file_size)) {
-#ifdef DEBUG_FILE_UPLOAD
-                                       sapi_module.sapi_error(E_NOTICE, "MAX_FILE_SIZE of %ld bytes exceeded - file [%s=%s] not saved", max_file_size, param, filename);
-#endif
+                                       sapi_module.sapi_error(E_WARNING, "MAX_FILE_SIZE of %ld bytes exceeded - file [%s=%s] not saved", max_file_size, param, filename);
                                        cancel_upload = UPLOAD_ERROR_B;
                                } else if (blen > 0) {
                                        wlen = fwrite(buff, 1, blen, fp);
                        
                                        if (wlen < blen) {
-#ifdef DEBUG_FILE_UPLOAD
-                                               sapi_module.sapi_error(E_NOTICE, "Only %d bytes were written, expected to write %ld", wlen, blen);
-#endif
+                                               sapi_module.sapi_error(E_WARNING, "Only %d bytes were written, expected to write %ld", wlen, blen);
                                                cancel_upload = UPLOAD_ERROR_C;
                                        } else {
                                                total_bytes += wlen;