summaryrefslogtreecommitdiff
path: root/src/common/compress_zlib.c
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2017-04-25 14:46:02 +0200
committerAlexander Færøy <ahf@torproject.org>2017-04-25 14:56:55 +0200
commit91dd4a00f7d4891e24187a849933547128aeeb9f (patch)
tree54b9c995ff02c788c876566b88cc11b02223ae14 /src/common/compress_zlib.c
parent754b86ba01db81b109c657a33a19978d5703a72b (diff)
downloadtor-91dd4a00f7d4891e24187a849933547128aeeb9f.tar.gz
tor-91dd4a00f7d4891e24187a849933547128aeeb9f.zip
Rename shadowing variable in compress_zlib.c.
This patch renames the `compress` parameter of the `tor_zlib_compress_new()` function to `_compress` to avoid shadowing the `compress()` function in zlib.h.
Diffstat (limited to 'src/common/compress_zlib.c')
-rw-r--r--src/common/compress_zlib.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/compress_zlib.c b/src/common/compress_zlib.c
index 50bdf9ece1..faa179f7c1 100644
--- a/src/common/compress_zlib.c
+++ b/src/common/compress_zlib.c
@@ -406,14 +406,14 @@ tor_zlib_state_size_precalc(int inflate_, int windowbits, int memlevel)
* <b>method</b>. If <b>compress</b>, it's for compression; otherwise it's for
* decompression. */
tor_zlib_compress_state_t *
-tor_zlib_compress_new(int compress,
+tor_zlib_compress_new(int compress_,
compress_method_t method,
compression_level_t compression_level)
{
tor_zlib_compress_state_t *out;
int bits, memlevel;
- if (! compress) {
+ if (! compress_) {
/* use this setting for decompression, since we might have the
* max number of window bits */
compression_level = HIGH_COMPRESSION;
@@ -423,10 +423,10 @@ tor_zlib_compress_new(int compress,
out->stream.zalloc = Z_NULL;
out->stream.zfree = Z_NULL;
out->stream.opaque = NULL;
- out->compress = compress;
+ out->compress = compress_;
bits = method_bits(method, compression_level);
memlevel = memory_level(compression_level);
- if (compress) {
+ if (compress_) {
if (deflateInit2(&out->stream, Z_BEST_COMPRESSION, Z_DEFLATED,
bits, memlevel,
Z_DEFAULT_STRATEGY) != Z_OK)
@@ -435,7 +435,7 @@ tor_zlib_compress_new(int compress,
if (inflateInit2(&out->stream, bits) != Z_OK)
goto err; // LCOV_EXCL_LINE
}
- out->allocation = tor_zlib_state_size_precalc(!compress, bits, memlevel);
+ out->allocation = tor_zlib_state_size_precalc(!compress_, bits, memlevel);
total_zlib_allocation += out->allocation;