diff options
author | Yann Collet <cyan@fb.com> | 2016-11-17 23:34:07 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2016-11-17 23:34:07 (GMT) |
commit | 3f6f57768752a5687c2715ad4a7cd4ebfa502bc2 (patch) | |
tree | 18f9213c472bb9f78569aa4b6e4dd284176ee8a8 | |
parent | c0e55ec05f5621bfc16a0f54dedef2a49f48634d (diff) | |
download | lz4-3f6f57768752a5687c2715ad4a7cd4ebfa502bc2.zip lz4-3f6f57768752a5687c2715ad4a7cd4ebfa502bc2.tar.gz lz4-3f6f57768752a5687c2715ad4a7cd4ebfa502bc2.tar.bz2 |
fixed strict aliasing warnings in fasttest
-rw-r--r-- | tests/fasttest.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/tests/fasttest.c b/tests/fasttest.c index 7694e0c..a165293 100644 --- a/tests/fasttest.c +++ b/tests/fasttest.c @@ -51,12 +51,6 @@ int test_compress(const char *input, int inSize, char *output, int outSize) return 0; } -void swap(void **a, void **b) { - void *tmp = *a; - *a = *b; - *b = tmp; -} - /* Returns non-zero on failure. Not a safe function. */ int test_decompress(const char *uncompressed, const char *compressed) { @@ -91,11 +85,10 @@ int test_decompress(const char *uncompressed, const char *compressed) lz4StreamDecode, compressed + offset, output, unBytes); if(bytes <= 0) return 2; /* Check result */ - { - int r = memcmp(uncompressed + unOffset, output, unBytes); + { int const r = memcmp(uncompressed + unOffset, output, unBytes); if (r) return 3; } - swap((void**)&output, (void**)&lastOutput); + { char* const tmp = output; output = lastOutput; lastOutput = tmp; } offset += bytes; unOffset += unBytes; lastBytes = unBytes; |