summaryrefslogtreecommitdiff
path: root/src/journal/test-compress.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-08-03 22:50:00 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-08-03 23:53:49 -0400
commitfa1c4b518ec7d8ec2d647213ee651cde4d6c9d7e (patch)
tree6f95fd77ef7f9a6a52501fa58c288cb8026ec66e /src/journal/test-compress.c
parent1f2b7175cf84bdbef6ee6917224658ba2adf43bf (diff)
Fix misuse of uint64_t as size_t
They have different size on 32 bit, so they are really not interchangable.
Diffstat (limited to 'src/journal/test-compress.c')
-rw-r--r--src/journal/test-compress.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/journal/test-compress.c b/src/journal/test-compress.c
index 4c0a9a08e4..f5f5f8df39 100644
--- a/src/journal/test-compress.c
+++ b/src/journal/test-compress.c
@@ -34,14 +34,13 @@
#endif
typedef int (compress_blob_t)(const void *src, uint64_t src_size,
- void *dst, uint64_t *dst_size);
+ void *dst, size_t *dst_size);
typedef int (decompress_blob_t)(const void *src, uint64_t src_size,
- void **dst, uint64_t *dst_alloc_size,
- uint64_t* dst_size, uint64_t dst_max);
-
+ void **dst, size_t *dst_alloc_size,
+ size_t* dst_size, size_t dst_max);
typedef int (decompress_sw_t)(const void *src, uint64_t src_size,
- void **buffer, uint64_t *buffer_size,
- const void *prefix, uint64_t prefix_len,
+ void **buffer, size_t *buffer_size,
+ const void *prefix, size_t prefix_len,
uint8_t extra);
typedef int (compress_stream_t)(int fdf, int fdt, off_t max_bytes);
@@ -53,8 +52,8 @@ static void test_compress_decompress(int compression,
char text[] = "foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF"
"foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF";
char compressed[512];
- uint64_t csize = 512;
- uint64_t usize = 0;
+ size_t csize = 512;
+ size_t usize = 0;
_cleanup_free_ char *decompressed = NULL;
int r;
@@ -92,8 +91,8 @@ static void test_decompress_startswith(int compression,
char text[] = "foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF"
"foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF";
char compressed[512];
- uint64_t csize = 512;
- uint64_t usize = 0;
+ size_t csize = 512;
+ size_t usize = 0;
_cleanup_free_ char *decompressed = NULL;
log_info("/* testing decompress_startswith with %s */",