diff options
author | David Robillard <d@drobilla.net> | 2012-02-01 01:40:05 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-02-01 01:40:05 +0000 |
commit | 5d071ef1c9ea2d39c03ca64b6a0c3bb9c67bd8cf (patch) | |
tree | 6b2d088aef4ed5099fbbc140c594a0ee1b7e67fa /test/ring_test.c | |
parent | dc7628a8eec281add045eb123ae06dbc94c1b950 (diff) | |
download | zix-5d071ef1c9ea2d39c03ca64b6a0c3bb9c67bd8cf.tar.gz zix-5d071ef1c9ea2d39c03ca64b6a0c3bb9c67bd8cf.tar.bz2 zix-5d071ef1c9ea2d39c03ca64b6a0c3bb9c67bd8cf.zip |
Windows portability fixes.
git-svn-id: http://svn.drobilla.net/zix/trunk@58 df6676b4-ccc9-40e5-b5d6-7c4628a128e3
Diffstat (limited to 'test/ring_test.c')
-rw-r--r-- | test/ring_test.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/test/ring_test.c b/test/ring_test.c index b7d181c..6cbe4fd 100644 --- a/test/ring_test.c +++ b/test/ring_test.c @@ -16,7 +16,6 @@ #include <limits.h> #include <stdarg.h> -#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -69,15 +68,15 @@ reader(void* arg) { printf("Reader starting\n"); - int ref_msg[MSG_SIZE]; // Reference generated for comparison - int read_msg[MSG_SIZE]; // Read from ring - size_t count = 0; - int start = gen_msg(ref_msg, 0); + int ref_msg[MSG_SIZE]; // Reference generated for comparison + int read_msg[MSG_SIZE]; // Read from ring + unsigned count = 0; + int start = gen_msg(ref_msg, 0); for (size_t i = 0; i < n_writes; ++i) { if (zix_ring_read_space(ring) >= MSG_SIZE * sizeof(int)) { if (zix_ring_read(ring, read_msg, MSG_SIZE * sizeof(int))) { if (!cmp_msg(ref_msg, read_msg)) { - printf("FAIL: Message %zu is corrupt\n", count); + printf("FAIL: Message %u is corrupt\n", count); read_error = true; return NULL; } @@ -118,7 +117,7 @@ main(int argc, char** argv) return 1; } - int size = 1024; + unsigned size = 1024; if (argc > 1) { size = atoi(argv[1]); } @@ -128,7 +127,7 @@ main(int argc, char** argv) n_writes = atoi(argv[2]); } - printf("Testing %zu writes of %d ints to a %d int ring...\n", + printf("Testing %u writes of %d ints to a %d int ring...\n", n_writes, MSG_SIZE, size); ring = zix_ring_new(size); @@ -216,7 +215,7 @@ main(int argc, char** argv) return failure("Successful underrun read\n"); } - char* big_buf = calloc(size, 1); + char* big_buf = (char*)calloc(size, 1); n = zix_ring_write(ring, big_buf, size - 1); if (n != (uint32_t)size - 1) { return failure("Maximum size write failed (wrote %u)\n", n); |