summaryrefslogtreecommitdiffstats
path: root/tests/fasttest.c
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2016-11-17 23:34:07 (GMT)
committerYann Collet <cyan@fb.com>2016-11-17 23:34:07 (GMT)
commit3f6f57768752a5687c2715ad4a7cd4ebfa502bc2 (patch)
tree18f9213c472bb9f78569aa4b6e4dd284176ee8a8 /tests/fasttest.c
parentc0e55ec05f5621bfc16a0f54dedef2a49f48634d (diff)
downloadlz4-3f6f57768752a5687c2715ad4a7cd4ebfa502bc2.zip
lz4-3f6f57768752a5687c2715ad4a7cd4ebfa502bc2.tar.gz
lz4-3f6f57768752a5687c2715ad4a7cd4ebfa502bc2.tar.bz2
fixed strict aliasing warnings in fasttest
Diffstat (limited to 'tests/fasttest.c')
-rw-r--r--tests/fasttest.c11
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;