Fix warnings in compression.cc

This commit is contained in:
Eelco Dolstra 2018-08-21 15:20:23 +02:00
parent 17a92dfb7d
commit 6317c65937

View file

@ -15,12 +15,10 @@
namespace nix { namespace nix {
static const size_t bufSize = 32 * 1024;
// Don't feed brotli too much at once. // Don't feed brotli too much at once.
struct ChunkedCompressionSink : CompressionSink struct ChunkedCompressionSink : CompressionSink
{ {
uint8_t outbuf[BUFSIZ]; uint8_t outbuf[32 * 1024];
void write(const unsigned char * data, size_t len) override void write(const unsigned char * data, size_t len) override
{ {
@ -124,7 +122,7 @@ struct BzipDecompressionSink : ChunkedCompressionSink
write(nullptr, 0); 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<decltype(strm.avail_in)>::max()); assert(len <= std::numeric_limits<decltype(strm.avail_in)>::max());
@ -173,7 +171,7 @@ struct BrotliDecompressionSink : ChunkedCompressionSink
writeInternal(nullptr, 0); 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; const uint8_t * next_in = data;
size_t avail_in = len; size_t avail_in = len;
@ -330,7 +328,7 @@ struct BzipCompressionSink : ChunkedCompressionSink
writeInternal(nullptr, 0); 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<decltype(strm.avail_in)>::max()); assert(len <= std::numeric_limits<decltype(strm.avail_in)>::max());
@ -380,7 +378,7 @@ struct BrotliCompressionSink : ChunkedCompressionSink
writeInternal(nullptr, 0); 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; const uint8_t * next_in = data;
size_t avail_in = len; size_t avail_in = len;