From 9ff10d086a699557e0b2c9ca99dbcfd0f8e330dc Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Wed, 24 Mar 2004 14:28:41 +0000 Subject: [PATCH] - Revert bogus commit --- Zend/zend_operators.c | 10 ++++++---- main/rfc1867.c | 12 +++--------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index bb6bb68a30..cbc1235659 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -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; diff --git a/main/rfc1867.c b/main/rfc1867.c index 1370f5b5a6..3988a9f330 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -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; -- 2.50.1