summaryrefslogtreecommitdiff
path: root/snappy-test.h
diff options
context:
space:
mode:
authorsnappy.mirrorbot@gmail.com <snappy.mirrorbot@gmail.com@03e5f5b5-db94-4691-08a0-1a8bf15f6143>2012-01-04 13:10:46 +0000
committersnappy.mirrorbot@gmail.com <snappy.mirrorbot@gmail.com@03e5f5b5-db94-4691-08a0-1a8bf15f6143>2012-01-04 13:10:46 +0000
commit9dfee3cc187181ae12b37f965d139b666b3a2948 (patch)
tree28e3bcc6c490aa9ebb9ca7f8ad2d585072fc150b /snappy-test.h
parent03a8e62372a7a311372308eb104dada144720dce (diff)
downloadsnappy-9dfee3cc187181ae12b37f965d139b666b3a2948.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: http://snappy.googlecode.com/svn/trunk@56 03e5f5b5-db94-4691-08a0-1a8bf15f6143
Diffstat (limited to 'snappy-test.h')
-rw-r--r--snappy-test.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/snappy-test.h b/snappy-test.h
index 649f26e..ef6a955 100644
--- a/snappy-test.h
+++ b/snappy-test.h
@@ -135,7 +135,7 @@ namespace File {
while (!feof(fp)) {
char buf[4096];
size_t ret = fread(buf, 1, 4096, fp);
- if (ret == -1) {
+ if (ret == 0 && ferror(fp)) {
perror("fread");
exit(1);
}