diff options
author | Ard Biesheuvel <abies@php.net> | 2003-09-13 15:27:09 +0000 |
---|---|---|
committer | Ard Biesheuvel <abies@php.net> | 2003-09-13 15:27:09 +0000 |
commit | 6f377333670e4835fdfb61c141ea8fea288a8036 (patch) | |
tree | a1df955b88400e1af4be74239f2688d377d8c638 | |
parent | 2a68d3c19ed8c11695105261e6363320d230fb16 (diff) | |
download | php-git-6f377333670e4835fdfb61c141ea8fea288a8036.tar.gz |
Fixed for 64bit archs
-rw-r--r-- | main/SAPI.c | 2 | ||||
-rwxr-xr-x | main/streams/streams.c | 2 | ||||
-rw-r--r-- | main/streams/userspace.c | 4 | ||||
-rw-r--r-- | tests/lang/bug24054.phpt | 23 |
4 files changed, 20 insertions, 11 deletions
diff --git a/main/SAPI.c b/main/SAPI.c index 17755dda1f..c11a8b4037 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -517,7 +517,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC) switch (op) { case SAPI_HEADER_SET_STATUS: - sapi_update_response_code((int) arg TSRMLS_CC); + sapi_update_response_code((long) arg TSRMLS_CC); return SUCCESS; case SAPI_HEADER_REPLACE: diff --git a/main/streams/streams.c b/main/streams/streams.c index 5591928470..f43e9399ff 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -368,7 +368,7 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov * as leaked; it will log a warning, but lets help it out and display what kind * of stream it was. */ char leakbuf[512]; - snprintf(leakbuf, sizeof(leakbuf), __FILE__ "(%d) : Stream of type '%s' 0x%08X (path:%s) was not closed\n", __LINE__, stream->ops->label, (unsigned int)stream, stream->__orig_path); + snprintf(leakbuf, sizeof(leakbuf), __FILE__ "(%d) : Stream of type '%s' %p (path:%s) was not closed\n", __LINE__, stream->ops->label, stream, stream->__orig_path); if (stream->__orig_path) { pefree(stream->__orig_path, stream->is_persistent); diff --git a/main/streams/userspace.c b/main/streams/userspace.c index 7ef9a0bcac..aa7f5ca581 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -430,7 +430,7 @@ static size_t php_userstreamop_write(php_stream *stream, const char *buf, size_t /* don't allow strange buffer overruns due to bogus return */ if (didwrite > count) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_WRITE " wrote %d bytes more data than requested (%d written, %d max)", + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_WRITE " wrote %zd bytes more data than requested (%zd written, %zd max)", us->wrapper->classname, didwrite - count, didwrite, count); didwrite = count; @@ -471,7 +471,7 @@ static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count convert_to_string(retval); didread = Z_STRLEN_P(retval); if (didread > count) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_READ " - read %d bytes more data than requested (%d read, %d max) - excess data will be lost", + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_READ " - read %zd bytes more data than requested (%zd read, %zd max) - excess data will be lost", us->wrapper->classname, didread - count, didread, count); didread = count; } diff --git a/tests/lang/bug24054.phpt b/tests/lang/bug24054.phpt index 6800cb39b4..e5035beee5 100644 --- a/tests/lang/bug24054.phpt +++ b/tests/lang/bug24054.phpt @@ -3,15 +3,24 @@ Bug #24054 (Assignment operator *= broken) --FILE-- <?php - $i = 10000000; +define('LONG_MAX', is_int(5000000000)? 9223372036854775807 : 0x7FFFFFFF); +define('LONG_MIN', -LONG_MAX - 1); +printf("%d,%d,%d,%d\n",is_int(LONG_MIN ),is_int(LONG_MAX ), + is_int(LONG_MIN-1),is_int(LONG_MAX+1)); + + $i = LONG_MAX; + + $j = $i * 1001; $i *= 1001; + - $j = 10000000; - $j = $j * 1001; +$tests = <<<TESTS - var_dump($i,$j); +$i === $j +TESTS; -?> + include(dirname(__FILE__) . '/../quicktester.inc'); + --EXPECT-- -float(1.001E+10) -float(1.001E+10) +1,1,0,0 +OK |