diff options
author | snappy.mirrorbot@gmail.com <snappy.mirrorbot@gmail.com@03e5f5b5-db94-4691-08a0-1a8bf15f6143> | 2012-01-04 13:10:46 +0000 |
---|---|---|
committer | snappy.mirrorbot@gmail.com <snappy.mirrorbot@gmail.com@03e5f5b5-db94-4691-08a0-1a8bf15f6143> | 2012-01-04 13:10:46 +0000 |
commit | d9068ee301bdf893a4d8cb7c6518eacc44c4c1f2 (patch) | |
tree | 28e3bcc6c490aa9ebb9ca7f8ad2d585072fc150b /snappy-test.cc | |
parent | 0755c815197dacc77d8971ae917c86d7aa96bf8e (diff) | |
download | snappy-git-d9068ee301bdf893a4d8cb7c6518eacc44c4c1f2.tar.gz |
Fix public issue r57: Fix most warnings with -Wall, mostly signed/unsigned
warnings. There are still some in the unit test, but the main .cc file should
be clean. We haven't enabled -Wall for the default build, since the unit test
is still not clean.
This also fixes a real bug in the open-source implementation of
ReadFileToStringOrDie(); it would not detect errors correctly.
I had to go through some pains to avoid performance loss as the types
were changed; I think there might still be some with 32-bit if and only if LFS
is enabled (ie., size_t is 64-bit), but for regular 32-bit and 64-bit I can't
see any losses, and I've diffed the generated GCC assembler between the old and
new code without seeing any significant choices. If anything, it's ever so
slightly faster.
This may or may not enable compression of very large blocks (>2^32 bytes)
when size_t is 64-bit, but I haven't checked, and it is still not a supported
case.
git-svn-id: https://snappy.googlecode.com/svn/trunk@56 03e5f5b5-db94-4691-08a0-1a8bf15f6143
Diffstat (limited to 'snappy-test.cc')
-rw-r--r-- | snappy-test.cc | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/snappy-test.cc b/snappy-test.cc index 2c50388..223cd92 100644 --- a/snappy-test.cc +++ b/snappy-test.cc @@ -353,7 +353,6 @@ int ZLib::CompressAtMostOrAll(Bytef *dest, uLongf *destLen, // compression. err = deflate(&comp_stream_, flush_mode); - const uLong source_bytes_consumed = *sourceLen - comp_stream_.avail_in; *sourceLen = comp_stream_.avail_in; if ((err == Z_STREAM_END || err == Z_OK) @@ -397,7 +396,6 @@ int ZLib::CompressChunkOrAll(Bytef *dest, uLongf *destLen, int ZLib::Compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) { int err; - const uLongf orig_destLen = *destLen; if ( (err=CompressChunkOrAll(dest, destLen, source, sourceLen, Z_FINISH)) != Z_OK ) return err; |