com php-src: ported ext/zlib: ext/zlib/php_zlib.h ext/zli b/zlib.c ext/zlib/zlib_fopen_wrapper.c
| From: | Anatol Belski | Date: | Tue, 19 Aug 2014 09:33:51 +0000 |
| Subject: | com php-src: ported ext/zlib: ext/zlib/php_zlib.h ext/zli b/zlib.c ext/zlib/zlib_fopen_wrapper.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-80799@lists.php.net to get a copy of this message | ||
Commit: beec26b5fed95b1638269b66d4a5c9aad28653ea
Author: Anatol Belski <ab@php.net> Tue, 19 Aug 2014 11:33:51 +0200
Parents: b9c44ce85e948d10a99cd46f118829f2f5c4b3cc
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=beec26b5fed95b1638269b66d4a5c9aad28653ea
Log:
ported ext/zlib
Changed paths:
M ext/zlib/php_zlib.h
M ext/zlib/zlib.c
M ext/zlib/zlib_fopen_wrapper.c
Diff:
diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h
index bd2a85b..5a2985c 100644
--- a/ext/zlib/php_zlib.h
+++ b/ext/zlib/php_zlib.h
@@ -50,11 +50,11 @@ typedef struct _php_zlib_context {
ZEND_BEGIN_MODULE_GLOBALS(zlib)
/* variables for transparent gzip encoding */
int compression_coding;
- long output_compression;
- long output_compression_level;
+ php_int_t output_compression;
+ php_int_t output_compression_level;
char *output_handler;
php_zlib_context *ob_gzhandler;
- long output_compression_default;
+ php_int_t output_compression_default;
zend_bool handler_registered;
ZEND_END_MODULE_GLOBALS(zlib);
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index cf6a2c5..67f575e 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -448,7 +448,7 @@ static PHP_FUNCTION(ob_gzhandler)
{
char *in_str;
int in_len;
- long flags = 0;
+ php_int_t flags = 0;
php_output_context ctx = {0};
int encoding, rv;
@@ -460,7 +460,7 @@ static PHP_FUNCTION(ob_gzhandler)
* - OG(running) is not set or set to any other output handler
* - we have to mess around with php_output_context */
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &in_str,
&in_len, &flags)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "si", &in_str,
&in_len, &flags)) {
RETURN_FALSE;
}
@@ -537,10 +537,10 @@ static PHP_FUNCTION(gzfile)
int flags = REPORT_ERRORS;
char buf[8192] = {0};
register int i = 0;
- long use_include_path = 0;
+ php_int_t use_include_path = 0;
php_stream *stream;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &filename,
&filename_len, &use_include_path)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|i", &filename,
&filename_len, &use_include_path)) {
return;
}
@@ -578,9 +578,9 @@ static PHP_FUNCTION(gzopen)
int filename_len, mode_len;
int flags = REPORT_ERRORS;
php_stream *stream;
- long use_include_path = 0;
+ php_int_t use_include_path = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &filename,
&filename_len, &mode, &mode_len, &use_include_path) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|i", &filename,
&filename_len, &mode, &mode_len, &use_include_path) == FAILURE) {
return;
}
@@ -606,9 +606,9 @@ static PHP_FUNCTION(readgzfile)
int flags = REPORT_ERRORS;
php_stream *stream;
int size;
- long use_include_path = 0;
+ php_int_t use_include_path = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename,
&filename_len, &use_include_path) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|i", &filename,
&filename_len, &use_include_path) == FAILURE) {
return;
}
@@ -631,19 +631,19 @@ static PHP_FUNCTION(readgzfile)
static PHP_FUNCTION(name) \
{ \
zend_string *in, *out; \
- long level = -1; \
- long encoding = default_encoding; \
+ php_int_t level = -1; \
+ php_int_t encoding = default_encoding; \
if (default_encoding) { \
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ll", &in,
&level, &encoding)) { \
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ii", &in,
&level, &encoding)) { \
return; \
} \
} else { \
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl|l", &in,
&encoding, &level)) { \
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Si|i", &in,
&encoding, &level)) { \
return; \
} \
} \
if (level < -1 || level > 9) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "compression level (%ld) must be within
-1..9", level); \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "compression level (%pd) must be within
-1..9", level); \
RETURN_FALSE; \
} \
switch (encoding) { \
@@ -667,12 +667,12 @@ static PHP_FUNCTION(name) \
char *in_buf, *out_buf; \
int in_len; \
size_t out_len; \
- long max_len = 0; \
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &in_buf,
&in_len, &max_len)) { \
+ php_int_t max_len = 0; \
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|i", &in_buf,
&in_len, &max_len)) { \
return; \
} \
if (max_len < 0) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "length (%ld) must be greater or equal
zero", max_len); \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "length (%pd) must be greater or equal
zero", max_len); \
RETURN_FALSE; \
} \
if (SUCCESS != php_zlib_decode(in_buf, in_len, &out_buf, &out_len, encoding, max_len
TSRMLS_CC)) { \
diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper..c
index be0ebd4..713a6ec 100644
--- a/ext/zlib/zlib_fopen_wrapper.c
+++ b/ext/zlib/zlib_fopen_wrapper.c
@@ -56,7 +56,7 @@ static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count
return (wrote < 0) ? 0 : wrote;
}
-static int php_gziop_seek(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC)
+static int php_gziop_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs
TSRMLS_DC)
{
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract;