diff options
author | Dmitry Stogov <dmitry@zend.com> | 2017-12-14 22:14:36 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2017-12-14 22:14:36 +0300 |
commit | 83e495e0fdc0c59b449bd173d0c8df1999239634 (patch) | |
tree | 80eb0e2e63b10f988add83a7d494838bd2cf9e56 /ext/bz2 | |
parent | 5d367636389506d3aff2220b0f4c6f14a59f98ea (diff) | |
download | php-git-83e495e0fdc0c59b449bd173d0c8df1999239634.tar.gz |
Move constants into read-only data segment
Diffstat (limited to 'ext/bz2')
-rw-r--r-- | ext/bz2/bz2.c | 4 | ||||
-rw-r--r-- | ext/bz2/bz2_filter.c | 8 | ||||
-rw-r--r-- | ext/bz2/php_bz2.h | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index d8445d295f..5250bf49d3 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -211,7 +211,7 @@ static int php_bz2iop_flush(php_stream *stream) } /* }}} */ -php_stream_ops php_stream_bz2io_ops = { +const php_stream_ops php_stream_bz2io_ops = { php_bz2iop_write, php_bz2iop_read, php_bz2iop_close, php_bz2iop_flush, "BZip2", @@ -317,7 +317,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, /* }}} */ -static php_stream_wrapper_ops bzip2_stream_wops = { +static const php_stream_wrapper_ops bzip2_stream_wops = { _php_stream_bz2open, NULL, /* close */ NULL, /* fstat */ diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c index 6446e29ad9..3dfe1b6352 100644 --- a/ext/bz2/bz2_filter.c +++ b/ext/bz2/bz2_filter.c @@ -193,7 +193,7 @@ static void php_bz2_decompress_dtor(php_stream_filter *thisfilter) } } -static php_stream_filter_ops php_bz2_decompress_ops = { +static const php_stream_filter_ops php_bz2_decompress_ops = { php_bz2_decompress_filter, php_bz2_decompress_dtor, "bzip2.decompress" @@ -297,7 +297,7 @@ static void php_bz2_compress_dtor(php_stream_filter *thisfilter) } } -static php_stream_filter_ops php_bz2_compress_ops = { +static const php_stream_filter_ops php_bz2_compress_ops = { php_bz2_compress_filter, php_bz2_compress_dtor, "bzip2.compress" @@ -309,7 +309,7 @@ static php_stream_filter_ops php_bz2_compress_ops = { static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *filterparams, uint8_t persistent) { - php_stream_filter_ops *fops = NULL; + const php_stream_filter_ops *fops = NULL; php_bz2_filter_data *data; int status = BZ_OK; @@ -399,7 +399,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi return php_stream_filter_alloc(fops, data, persistent); } -php_stream_filter_factory php_bz2_filter_factory = { +const php_stream_filter_factory php_bz2_filter_factory = { php_bz2_filter_create }; /* }}} */ diff --git a/ext/bz2/php_bz2.h b/ext/bz2/php_bz2.h index e21f1f1c96..ac04ba7ce2 100644 --- a/ext/bz2/php_bz2.h +++ b/ext/bz2/php_bz2.h @@ -56,8 +56,8 @@ PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, const char * #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; +extern const php_stream_filter_factory php_bz2_filter_factory; +extern const php_stream_ops php_stream_bz2io_ops; #define PHP_STREAM_IS_BZIP2 &php_stream_bz2io_ops /* 400kb */ |