summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/btree.c8
-rw-r--r--test/bitset_test.c2
-rw-r--r--test/ring_test.c10
3 files changed, 10 insertions, 10 deletions
diff --git a/src/btree.c b/src/btree.c
index 49b7516..3553a9a 100644
--- a/src/btree.c
+++ b/src/btree.c
@@ -25,12 +25,12 @@
// #define ZIX_BTREE_SORTED_CHECK 1
#ifndef ZIX_BTREE_PAGE_SIZE
-# define ZIX_BTREE_PAGE_SIZE 4096
+# define ZIX_BTREE_PAGE_SIZE 4096u
#endif
-#define ZIX_BTREE_NODE_SPACE (ZIX_BTREE_PAGE_SIZE - 2 * sizeof(uint16_t))
-#define ZIX_BTREE_LEAF_VALS ((ZIX_BTREE_NODE_SPACE / sizeof(void*)) - 1)
-#define ZIX_BTREE_INODE_VALS (ZIX_BTREE_LEAF_VALS / 2)
+#define ZIX_BTREE_NODE_SPACE (ZIX_BTREE_PAGE_SIZE - 2u * sizeof(uint16_t))
+#define ZIX_BTREE_LEAF_VALS ((ZIX_BTREE_NODE_SPACE / sizeof(void*)) - 1u)
+#define ZIX_BTREE_INODE_VALS (ZIX_BTREE_LEAF_VALS / 2u)
struct ZixBTreeImpl {
ZixBTreeNode* root;
diff --git a/test/bitset_test.c b/test/bitset_test.c
index dda59d3..27f1d2d 100644
--- a/test/bitset_test.c
+++ b/test/bitset_test.c
@@ -21,7 +21,7 @@
#include <stdarg.h>
#include <stdio.h>
-#define N_BITS 256
+#define N_BITS 256u
#define N_ELEMS (ZIX_BITSET_ELEMS(N_BITS))
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
diff --git a/test/ring_test.c b/test/ring_test.c
index 7616346..c11d998 100644
--- a/test/ring_test.c
+++ b/test/ring_test.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <stdlib.h>
-#define MSG_SIZE 20
+#define MSG_SIZE 20u
static ZixRing* ring = 0;
static unsigned n_writes = 0;
@@ -46,7 +46,7 @@ failure(const char* fmt, ...)
static int
gen_msg(int* msg, int start)
{
- for (int i = 0; i < MSG_SIZE; ++i) {
+ for (unsigned i = 0u; i < MSG_SIZE; ++i) {
msg[i] = start;
start = (start + 1) % INT_MAX;
}
@@ -56,9 +56,9 @@ gen_msg(int* msg, int start)
static int
cmp_msg(int* msg1, int* msg2)
{
- for (int i = 0; i < MSG_SIZE; ++i) {
+ for (unsigned i = 0u; i < MSG_SIZE; ++i) {
if (msg1[i] != msg2[i]) {
- return !failure("%d != %d @ %d\n", msg1[i], msg2[i], i);
+ return !failure("%d != %d @ %u\n", msg1[i], msg2[i], i);
}
}
@@ -131,7 +131,7 @@ main(int argc, char** argv)
zix_ring_free(NULL);
- printf("Testing %u writes of %d ints to a %u int ring...\n",
+ printf("Testing %u writes of %u ints to a %u int ring...\n",
n_writes,
MSG_SIZE,
size);