From 71c4a3a6d66e96661fd341e1a089c4d8bd63fb13 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 28 Jun 2022 18:48:41 -0400 Subject: Use uppercase integer literal suffixes I give in. --- test/ring_test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/ring_test.c') diff --git a/test/ring_test.c b/test/ring_test.c index af54e0e..79aa0f1 100644 --- a/test/ring_test.c +++ b/test/ring_test.c @@ -16,7 +16,7 @@ #include #include -#define MSG_SIZE 20u +#define MSG_SIZE 20U static ZixRing* ring = 0; static unsigned n_writes = 0; @@ -25,7 +25,7 @@ static bool read_error = false; static int gen_msg(int* const msg, int start) { - for (unsigned i = 0u; i < MSG_SIZE; ++i) { + for (unsigned i = 0U; i < MSG_SIZE; ++i) { msg[i] = start; start = (start + 1) % INT_MAX; } @@ -36,7 +36,7 @@ ZIX_PURE_FUNC static int cmp_msg(const int* const msg1, const int* const msg2) { - for (unsigned i = 0u; i < MSG_SIZE; ++i) { + for (unsigned i = 0U; i < MSG_SIZE; ++i) { assert(msg1[i] == msg2[i]); } @@ -103,10 +103,10 @@ test_ring(const unsigned size) zix_ring_mlock(ring); ZixThread reader_thread; // NOLINT - assert(!zix_thread_create(&reader_thread, MSG_SIZE * 4ul, reader, NULL)); + assert(!zix_thread_create(&reader_thread, MSG_SIZE * 4UL, reader, NULL)); ZixThread writer_thread; // NOLINT - assert(!zix_thread_create(&writer_thread, MSG_SIZE * 4ul, writer, NULL)); + assert(!zix_thread_create(&writer_thread, MSG_SIZE * 4UL, writer, NULL)); zix_thread_join(reader_thread, NULL); zix_thread_join(writer_thread, NULL); @@ -168,7 +168,7 @@ test_failed_alloc(void) // Test that each allocation failing is handled gracefully const size_t n_new_allocs = allocator.n_allocations; - for (size_t i = 0u; i < n_new_allocs; ++i) { + for (size_t i = 0U; i < n_new_allocs; ++i) { allocator.n_remaining = i; assert(!zix_ring_new(&allocator.base, 512)); } -- cgit v1.2.1