MINOR: ncbuf: fix warnings for testing build
Using -Wall reveals several warning when building ncbuf testing API. One
of them was about the signedness mismatch. The other one was with an
incorrect print format.
diff --git a/src/ncbuf.c b/src/ncbuf.c
index bc636fa..2b21a29 100644
--- a/src/ncbuf.c
+++ b/src/ncbuf.c
@@ -689,7 +689,7 @@
/* ******** testing API ******** */
/* To build it :
- * gcc -DSTANDALONE -lasan -I./include -o ncbuf src/ncbuf.c
+ * gcc -Wall -DSTANDALONE -lasan -I./include -o ncbuf src/ncbuf.c
*/
#ifdef STANDALONE
@@ -729,7 +729,7 @@
static void ncb_print_blk(const struct ncb_blk blk)
{
if (ncb_print) {
- fprintf(stderr, "%s(%s): %2zu/%zu.\n",
+ fprintf(stderr, "%s(%s): %2u/%u.\n",
blk.flag & NCB_BK_F_GAP ? "GAP " : "DATA",
blk.flag & NCB_BK_F_FIN ? "F" : "-", blk.off, blk.sz);
}
@@ -822,7 +822,7 @@
BUG_ON(!ncb_is_empty(&b));
BUG_ON(ncb_is_full(&b));
- b.area = bufarea;
+ b.area = (char *)bufarea;
b.size = bufsize;
b.head = head;
NCB_INIT(&b);