From 6317c65937ad7d9c5a954c4dfc48de259e55f4f3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 21 Aug 2018 15:20:23 +0200 Subject: [PATCH] Fix warnings in compression.cc --- src/libutil/compression.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/libutil/compression.cc b/src/libutil/compression.cc index 53b62f62a..204c63cd2 100644 --- a/src/libutil/compression.cc +++ b/src/libutil/compression.cc @@ -15,12 +15,10 @@ namespace nix { -static const size_t bufSize = 32 * 1024; - // Don't feed brotli too much at once. struct ChunkedCompressionSink : CompressionSink { - uint8_t outbuf[BUFSIZ]; + uint8_t outbuf[32 * 1024]; void write(const unsigned char * data, size_t len) override { @@ -124,7 +122,7 @@ struct BzipDecompressionSink : ChunkedCompressionSink write(nullptr, 0); } - void writeInternal(const unsigned char * data, size_t len) + void writeInternal(const unsigned char * data, size_t len) override { assert(len <= std::numeric_limits::max()); @@ -173,7 +171,7 @@ struct BrotliDecompressionSink : ChunkedCompressionSink writeInternal(nullptr, 0); } - void writeInternal(const unsigned char * data, size_t len) + void writeInternal(const unsigned char * data, size_t len) override { const uint8_t * next_in = data; size_t avail_in = len; @@ -330,7 +328,7 @@ struct BzipCompressionSink : ChunkedCompressionSink writeInternal(nullptr, 0); } - void writeInternal(const unsigned char * data, size_t len) + void writeInternal(const unsigned char * data, size_t len) override { assert(len <= std::numeric_limits::max()); @@ -380,7 +378,7 @@ struct BrotliCompressionSink : ChunkedCompressionSink writeInternal(nullptr, 0); } - void writeInternal(const unsigned char * data, size_t len) + void writeInternal(const unsigned char * data, size_t len) override { const uint8_t * next_in = data; size_t avail_in = len;