diff options
author | Anatol Belski <ab@php.net> | 2014-08-25 19:24:55 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-08-25 19:24:55 +0200 |
commit | c3e3c98ec666812daaaca896cf5ef758a8a6df14 (patch) | |
tree | d82a76de5c8d117d1cf2dcca19bb30a283621870 /ext/bz2 | |
parent | 0cf2dbdf58645b52cb6582b1b2571c5cd9e9e6b3 (diff) | |
download | php-git-c3e3c98ec666812daaaca896cf5ef758a8a6df14.tar.gz |
master renames phase 1
Diffstat (limited to 'ext/bz2')
-rw-r--r-- | ext/bz2/bz2.c | 32 | ||||
-rw-r--r-- | ext/bz2/bz2_filter.c | 12 |
2 files changed, 22 insertions, 22 deletions
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index c6a03935d9..7696dbb93d 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -343,11 +343,11 @@ static PHP_MINFO_FUNCTION(bz2) static PHP_FUNCTION(bzread) { zval *bz; - php_int_t len = 1024; + zend_long len = 1024; php_stream *stream; zend_string *data; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|i", &bz, &len)) { + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &bz, &len)) { RETURN_FALSE; } @@ -357,11 +357,11 @@ static PHP_FUNCTION(bzread) php_error_docref(NULL TSRMLS_CC, E_WARNING, "length may not be negative"); RETURN_FALSE; } - data = STR_ALLOC(len, 0); + data = zend_string_alloc(len, 0); data->len = php_stream_read(stream, data->val, data->len); if (data->len < 0) { - STR_FREE(data); + zend_string_free(data); php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not read valid bz2 data from stream"); RETURN_FALSE; } @@ -393,7 +393,7 @@ static PHP_FUNCTION(bzopen) /* If it's not a resource its a string containing the filename to open */ if (Z_TYPE_P(file) == IS_STRING) { - if (Z_STRSIZE_P(file) == 0) { + if (Z_STRLEN_P(file) == 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "filename cannot be empty"); RETURN_FALSE; } @@ -490,8 +490,8 @@ static PHP_FUNCTION(bzerror) static PHP_FUNCTION(bzcompress) { char *source; /* Source data to compress */ - php_int_t zblock_size = 0; /* Optional block size to use */ - php_int_t zwork_factor = 0;/* Optional work factor to use */ + zend_long zblock_size = 0; /* Optional block size to use */ + zend_long zwork_factor = 0;/* Optional work factor to use */ zend_string *dest = NULL; /* Destination to place the compressed data into */ int error, /* Error Container */ block_size = 4, /* Block size for compression algorithm */ @@ -502,7 +502,7 @@ static PHP_FUNCTION(bzcompress) argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ii", &source, &source_len, &zblock_size, &zwork_factor) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &source, &source_len, &zblock_size, &zwork_factor) == FAILURE) { return; } @@ -513,7 +513,7 @@ static PHP_FUNCTION(bzcompress) dest_len = (unsigned int) (source_len + (0.01 * source_len) + 600); /* Allocate the destination buffer */ - dest = STR_ALLOC(dest_len, 0); + dest = zend_string_alloc(dest_len, 0); /* Handle the optional arguments */ if (argc > 1) { @@ -526,8 +526,8 @@ static PHP_FUNCTION(bzcompress) error = BZ2_bzBuffToBuffCompress(dest->val, &dest_len, source, source_len, block_size, 0, work_factor); if (error != BZ_OK) { - STR_FREE(dest); - RETURN_INT(error); + zend_string_free(dest); + RETURN_LONG(error); } else { /* Copy the buffer, we have perhaps allocate a lot more than we need, so we erealloc() the buffer to the proper size */ @@ -544,7 +544,7 @@ static PHP_FUNCTION(bzdecompress) { char *source, *dest; int source_len, error; - php_int_t small = 0; + zend_long small = 0; #if defined(PHP_WIN32) unsigned __int64 size = 0; #else @@ -552,7 +552,7 @@ static PHP_FUNCTION(bzdecompress) #endif bz_stream bzs; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|i", &source, &source_len, &small)) { + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &small)) { RETURN_FALSE; } @@ -586,7 +586,7 @@ static PHP_FUNCTION(bzdecompress) efree(dest); } else { /* real error */ efree(dest); - RETVAL_INT(error); + RETVAL_LONG(error); } BZ2_bzDecompressEnd(&bzs); @@ -621,7 +621,7 @@ static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int opt) /* Determine what to return */ switch (opt) { case PHP_BZ_ERRNO: - RETURN_INT(errnum); + RETURN_LONG(errnum); break; case PHP_BZ_ERRSTR: RETURN_STRING((char*)errstr); @@ -629,7 +629,7 @@ static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int opt) case PHP_BZ_ERRBOTH: array_init(return_value); - add_assoc_int (return_value, "errno", errnum); + add_assoc_long (return_value, "errno", errnum); add_assoc_string(return_value, "errstr", (char*)errstr); break; } diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c index 75c1bd418b..cb175af37c 100644 --- a/ext/bz2/bz2_filter.c +++ b/ext/bz2/bz2_filter.c @@ -381,10 +381,10 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi ZVAL_DUP(&tmp, tmpzval); convert_to_int(&tmp); - if (Z_IVAL(tmp) < 1 || Z_IVAL(tmp) > 9) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%pd)", Z_IVAL_P(tmpzval)); + if (Z_LVAL(tmp) < 1 || Z_LVAL(tmp) > 9) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%pd)", Z_LVAL_P(tmpzval)); } else { - blockSize100k = Z_IVAL(tmp); + blockSize100k = Z_LVAL(tmp); } } @@ -395,10 +395,10 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi ZVAL_DUP(&tmp, tmpzval); convert_to_int(&tmp); - if (Z_IVAL(tmp) < 0 || Z_IVAL(tmp) > 250) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for work factor. (%pd)", Z_IVAL(tmp)); + if (Z_LVAL(tmp) < 0 || Z_LVAL(tmp) > 250) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for work factor. (%pd)", Z_LVAL(tmp)); } else { - workFactor = Z_IVAL(tmp); + workFactor = Z_LVAL(tmp); } } } |