diff options
author | Anatol Belski <ab@php.net> | 2014-12-13 23:06:14 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-12-13 23:06:14 +0100 |
commit | bdeb220f48825642f84cdbf3ff23a30613c92e86 (patch) | |
tree | 1a6cf34d20420e4815b4becb21311a4457d84103 /ext/bz2 | |
parent | bb66f385d09e7e55390e9f57fcbca08f6b43ff91 (diff) | |
download | php-git-bdeb220f48825642f84cdbf3ff23a30613c92e86.tar.gz |
first shot remove TSRMLS_* things
Diffstat (limited to 'ext/bz2')
-rw-r--r-- | ext/bz2/bz2.c | 52 | ||||
-rw-r--r-- | ext/bz2/bz2_filter.c | 52 | ||||
-rw-r--r-- | ext/bz2/php_bz2.h | 8 |
3 files changed, 56 insertions, 56 deletions
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index d49be40d35..8a3eb7f6b0 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -135,7 +135,7 @@ struct php_bz2_stream_data_t { /* {{{ BZip2 stream implementation */ -static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) +static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count) { struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; size_t ret = 0; @@ -158,7 +158,7 @@ static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count TSRMLS return ret; } -static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) +static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count) { size_t wrote = 0; struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; @@ -182,7 +182,7 @@ static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count return wrote; } -static int php_bz2iop_close(php_stream *stream, int close_handle TSRMLS_DC) +static int php_bz2iop_close(php_stream *stream, int close_handle) { struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; int ret = EOF; @@ -200,7 +200,7 @@ static int php_bz2iop_close(php_stream *stream, int close_handle TSRMLS_DC) return ret; } -static int php_bz2iop_flush(php_stream *stream TSRMLS_DC) +static int php_bz2iop_flush(php_stream *stream) { struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; return BZ2_bzflush(self->bz_file); @@ -219,7 +219,7 @@ php_stream_ops php_stream_bz2io_ops = { /* {{{ Bzip2 stream openers */ PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, - const char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC) + const char *mode, php_stream *innerstream STREAMS_DC) { struct php_bz2_stream_data_t *self; @@ -236,7 +236,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, const char *mode, int options, char **opened_path, - php_stream_context *context STREAMS_DC TSRMLS_DC) + php_stream_context *context STREAMS_DC) { php_stream *retstream = NULL, *stream = NULL; char *path_copy = NULL; @@ -250,12 +250,12 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, } #ifdef VIRTUAL_DIR - virtual_filepath_ex(path, &path_copy, NULL TSRMLS_CC); + virtual_filepath_ex(path, &path_copy, NULL); #else path_copy = path; #endif - if (php_check_open_basedir(path_copy TSRMLS_CC)) { + if (php_check_open_basedir(path_copy)) { #ifdef VIRTUAL_DIR efree(path_copy); #endif @@ -301,7 +301,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, } if (bz_file) { - retstream = _php_stream_bz2open_from_BZFILE(bz_file, mode, stream STREAMS_REL_CC TSRMLS_CC); + retstream = _php_stream_bz2open_from_BZFILE(bz_file, mode, stream STREAMS_REL_CC); if (retstream) { return retstream; } @@ -341,15 +341,15 @@ static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int); static PHP_MINIT_FUNCTION(bz2) { - php_register_url_stream_wrapper("compress.bzip2", &php_stream_bzip2_wrapper TSRMLS_CC); - php_stream_filter_register_factory("bzip2.*", &php_bz2_filter_factory TSRMLS_CC); + php_register_url_stream_wrapper("compress.bzip2", &php_stream_bzip2_wrapper); + php_stream_filter_register_factory("bzip2.*", &php_bz2_filter_factory); return SUCCESS; } static PHP_MSHUTDOWN_FUNCTION(bz2) { - php_unregister_url_stream_wrapper("compress.bzip2" TSRMLS_CC); - php_stream_filter_unregister_factory("bzip2.*" TSRMLS_CC); + php_unregister_url_stream_wrapper("compress.bzip2"); + php_stream_filter_unregister_factory("bzip2.*"); return SUCCESS; } @@ -373,14 +373,14 @@ static PHP_FUNCTION(bzread) php_stream *stream; zend_string *data; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &bz, &len)) { + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &bz, &len)) { RETURN_FALSE; } php_stream_from_zval(stream, bz); if ((len + 1) < 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "length may not be negative"); + php_error_docref(NULL, E_WARNING, "length may not be negative"); RETURN_FALSE; } data = zend_string_alloc(len, 0); @@ -402,19 +402,19 @@ static PHP_FUNCTION(bzopen) BZFILE *bz; /* The compressed file stream */ php_stream *stream = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &file, &mode, &mode_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs", &file, &mode, &mode_len) == FAILURE) { return; } if (mode_len != 1 || (mode[0] != 'r' && mode[0] != 'w')) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid mode for bzopen(). Only 'w' and 'r' are supported.", mode); + php_error_docref(NULL, E_WARNING, "'%s' is not a valid mode for bzopen(). Only 'w' and 'r' are supported.", mode); RETURN_FALSE; } /* If it's not a resource its a string containing the filename to open */ if (Z_TYPE_P(file) == IS_STRING) { if (Z_STRLEN_P(file) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "filename cannot be empty"); + php_error_docref(NULL, E_WARNING, "filename cannot be empty"); RETURN_FALSE; } @@ -432,10 +432,10 @@ static PHP_FUNCTION(bzopen) stream_mode_len = strlen(stream->mode); if (stream_mode_len != 1 && !(stream_mode_len == 2 && memchr(stream->mode, 'b', 2))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode); + php_error_docref(NULL, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode); RETURN_FALSE; } else if (stream_mode_len == 1 && stream->mode[0] != 'r' && stream->mode[0] != 'w' && stream->mode[0] != 'a' && stream->mode[0] != 'x') { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode); + php_error_docref(NULL, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode); RETURN_FALSE; } @@ -443,7 +443,7 @@ static PHP_FUNCTION(bzopen) case 'r': /* only "r" and "rb" are supported */ if (stream->mode[0] != mode[0] && !(stream_mode_len == 2 && stream->mode[1] != mode[0])) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot read from a stream opened in write only mode"); + php_error_docref(NULL, E_WARNING, "cannot read from a stream opened in write only mode"); RETURN_FALSE; } break; @@ -452,7 +452,7 @@ static PHP_FUNCTION(bzopen) if (stream->mode[0] != mode[0] && !(stream_mode_len == 2 && stream->mode[1] != mode[0]) && stream->mode[0] != 'a' && !(stream_mode_len == 2 && stream->mode[1] != 'a') && stream->mode[0] != 'x' && !(stream_mode_len == 2 && stream->mode[1] != 'x')) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot write to a stream opened in read only mode"); + php_error_docref(NULL, E_WARNING, "cannot write to a stream opened in read only mode"); RETURN_FALSE; } break; @@ -469,7 +469,7 @@ static PHP_FUNCTION(bzopen) stream = php_stream_bz2open_from_BZFILE(bz, mode, stream); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "first parameter has to be string or file-resource"); + php_error_docref(NULL, E_WARNING, "first parameter has to be string or file-resource"); RETURN_FALSE; } @@ -522,7 +522,7 @@ static PHP_FUNCTION(bzcompress) argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &source, &source_len, &zblock_size, &zwork_factor) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ll", &source, &source_len, &zblock_size, &zwork_factor) == FAILURE) { return; } @@ -573,7 +573,7 @@ static PHP_FUNCTION(bzdecompress) #endif bz_stream bzs; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &small)) { + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &source, &source_len, &small)) { RETURN_FALSE; } @@ -624,7 +624,7 @@ static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int opt) int errnum; /* Error number */ struct php_bz2_stream_data_t *self; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &bzp) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &bzp) == FAILURE) { return; } diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c index a2a21d765b..8b9ee99804 100644 --- a/ext/bz2/bz2_filter.c +++ b/ext/bz2/bz2_filter.c @@ -91,13 +91,13 @@ static php_stream_filter_status_t php_bz2_decompress_filter( while (buckets_in->head) { size_t bin = 0, desired; - bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC); + bucket = php_stream_bucket_make_writeable(buckets_in->head); while (bin < bucket->buflen) { if (data->status == PHP_BZ2_UNITIALIZED) { status = BZ2_bzDecompressInit(streamp, 0, data->small_footprint); if (BZ_OK != status) { - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_delref(bucket); return PSFS_ERR_FATAL; } @@ -127,7 +127,7 @@ static php_stream_filter_status_t php_bz2_decompress_filter( } } else if (status != BZ_OK) { /* Something bad happened */ - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_delref(bucket); return PSFS_ERR_FATAL; } desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */ @@ -139,19 +139,19 @@ static php_stream_filter_status_t php_bz2_decompress_filter( if (data->strm.avail_out < data->outbuf_len) { php_stream_bucket *out_bucket; size_t bucketlen = data->outbuf_len - data->strm.avail_out; - out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC); + out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0); + php_stream_bucket_append(buckets_out, out_bucket); data->strm.avail_out = data->outbuf_len; data->strm.next_out = data->outbuf; exit_status = PSFS_PASS_ON; } else if (status == BZ_STREAM_END && data->strm.avail_out >= data->outbuf_len) { /* no more data to decompress, and nothing was spat out */ - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_delref(bucket); return PSFS_PASS_ON; } } - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_delref(bucket); } if ((data->status == PHP_BZ2_RUNNING) && (flags & PSFS_FLAG_FLUSH_CLOSE)) { @@ -162,8 +162,8 @@ static php_stream_filter_status_t php_bz2_decompress_filter( if (data->strm.avail_out < data->outbuf_len) { size_t bucketlen = data->outbuf_len - data->strm.avail_out; - bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); + bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0); + php_stream_bucket_append(buckets_out, bucket); data->strm.avail_out = data->outbuf_len; data->strm.next_out = data->outbuf; exit_status = PSFS_PASS_ON; @@ -180,7 +180,7 @@ static php_stream_filter_status_t php_bz2_decompress_filter( return exit_status; } -static void php_bz2_decompress_dtor(php_stream_filter *thisfilter TSRMLS_DC) +static void php_bz2_decompress_dtor(php_stream_filter *thisfilter) { if (thisfilter && Z_PTR(thisfilter->abstract)) { php_bz2_filter_data *data = Z_PTR(thisfilter->abstract); @@ -227,7 +227,7 @@ static php_stream_filter_status_t php_bz2_compress_filter( while (buckets_in->head) { size_t bin = 0, desired; - bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC); + bucket = php_stream_bucket_make_writeable(buckets_in->head); while (bin < bucket->buflen) { desired = bucket->buflen - bin; @@ -240,7 +240,7 @@ static php_stream_filter_status_t php_bz2_compress_filter( status = BZ2_bzCompress(&(data->strm), flags & PSFS_FLAG_FLUSH_CLOSE ? BZ_FINISH : (flags & PSFS_FLAG_FLUSH_INC ? BZ_FLUSH : BZ_RUN)); if (status != BZ_RUN_OK && status != BZ_FLUSH_OK && status != BZ_FINISH_OK) { /* Something bad happened */ - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_delref(bucket); return PSFS_ERR_FATAL; } desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */ @@ -253,14 +253,14 @@ static php_stream_filter_status_t php_bz2_compress_filter( php_stream_bucket *out_bucket; size_t bucketlen = data->outbuf_len - data->strm.avail_out; - out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC); + out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0); + php_stream_bucket_append(buckets_out, out_bucket); data->strm.avail_out = data->outbuf_len; data->strm.next_out = data->outbuf; exit_status = PSFS_PASS_ON; } } - php_stream_bucket_delref(bucket TSRMLS_CC); + php_stream_bucket_delref(bucket); } if (flags & PSFS_FLAG_FLUSH_CLOSE) { @@ -271,8 +271,8 @@ static php_stream_filter_status_t php_bz2_compress_filter( if (data->strm.avail_out < data->outbuf_len) { size_t bucketlen = data->outbuf_len - data->strm.avail_out; - bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); + bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0); + php_stream_bucket_append(buckets_out, bucket); data->strm.avail_out = data->outbuf_len; data->strm.next_out = data->outbuf; exit_status = PSFS_PASS_ON; @@ -286,7 +286,7 @@ static php_stream_filter_status_t php_bz2_compress_filter( return exit_status; } -static void php_bz2_compress_dtor(php_stream_filter *thisfilter TSRMLS_DC) +static void php_bz2_compress_dtor(php_stream_filter *thisfilter) { if (Z_PTR(thisfilter->abstract)) { php_bz2_filter_data *data = Z_PTR(thisfilter->abstract); @@ -307,7 +307,7 @@ static php_stream_filter_ops php_bz2_compress_ops = { /* {{{ bzip2.* common factory */ -static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) +static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *filterparams, int persistent) { php_stream_filter_ops *fops = NULL; php_bz2_filter_data *data; @@ -316,7 +316,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi /* Create this filter */ data = pecalloc(1, sizeof(php_bz2_filter_data), persistent); if (!data) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zu bytes", sizeof(php_bz2_filter_data)); + php_error_docref(NULL, E_WARNING, "Failed allocating %zu bytes", sizeof(php_bz2_filter_data)); return NULL; } @@ -329,14 +329,14 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi data->strm.avail_out = data->outbuf_len = data->inbuf_len = 2048; data->strm.next_in = data->inbuf = (char *) pemalloc(data->inbuf_len, persistent); if (!data->inbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zu bytes", data->inbuf_len); + php_error_docref(NULL, E_WARNING, "Failed allocating %zu bytes", data->inbuf_len); pefree(data, persistent); return NULL; } data->strm.avail_in = 0; data->strm.next_out = data->outbuf = (char *) pemalloc(data->outbuf_len, persistent); if (!data->outbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zu bytes", data->outbuf_len); + php_error_docref(NULL, E_WARNING, "Failed allocating %zu bytes", data->outbuf_len); pefree(data->inbuf, persistent); pefree(data, persistent); return NULL; @@ -351,7 +351,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi if (Z_TYPE_P(filterparams) == IS_ARRAY || Z_TYPE_P(filterparams) == IS_OBJECT) { if ((tmpzval = zend_hash_str_find(HASH_OF(filterparams), "concatenated", sizeof("concatenated")-1))) { - data->expect_concatenated = zend_is_true(tmpzval TSRMLS_CC); + data->expect_concatenated = zend_is_true(tmpzval); tmpzval = NULL; } @@ -361,7 +361,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi } if (tmpzval) { - data->small_footprint = zend_is_true(tmpzval TSRMLS_CC); + data->small_footprint = zend_is_true(tmpzval); } } @@ -382,7 +382,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi ZVAL_DUP(&tmp, tmpzval); convert_to_long(&tmp); 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)); + php_error_docref(NULL, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%pd)", Z_LVAL_P(tmpzval)); } else { blockSize100k = (int)Z_LVAL(tmp); } @@ -396,7 +396,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi convert_to_long(&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)); + php_error_docref(NULL, E_WARNING, "Invalid parameter given for work factor. (%pd)", Z_LVAL(tmp)); } else { workFactor = (int)Z_LVAL(tmp); } diff --git a/ext/bz2/php_bz2.h b/ext/bz2/php_bz2.h index 6e90e8d67f..dd226a20ad 100644 --- a/ext/bz2/php_bz2.h +++ b/ext/bz2/php_bz2.h @@ -47,11 +47,11 @@ extern zend_module_entry bz2_module_entry; # define PHP_BZ2_API #endif -PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, const char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC); +PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC); +PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, const char *mode, php_stream *innerstream STREAMS_DC); -#define php_stream_bz2open_from_BZFILE(bz, mode, innerstream) _php_stream_bz2open_from_BZFILE((bz), (mode), (innerstream) STREAMS_CC TSRMLS_CC) -#define php_stream_bz2open(wrapper, path, mode, options, opened_path) _php_stream_bz2open((wrapper), (path), (mode), (options), (opened_path), NULL STREAMS_CC TSRMLS_CC) +#define php_stream_bz2open_from_BZFILE(bz, mode, innerstream) _php_stream_bz2open_from_BZFILE((bz), (mode), (innerstream) STREAMS_CC) +#define php_stream_bz2open(wrapper, path, mode, options, opened_path) _php_stream_bz2open((wrapper), (path), (mode), (options), (opened_path), NULL STREAMS_CC) extern php_stream_filter_factory php_bz2_filter_factory; extern php_stream_ops php_stream_bz2io_ops; |