From fd025c1137c8d0b481f653ec3e0d04fcad99e549 Mon Sep 17 00:00:00 2001 From: David Mak Date: Mon, 22 Jul 2024 00:18:19 +0800 Subject: [PATCH] standalone: Use uint32_t for cslice length Matching the expected type of string and list slices. --- nac3standalone/demo/demo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nac3standalone/demo/demo.c b/nac3standalone/demo/demo.c index 0b8147b5..5bf22044 100644 --- a/nac3standalone/demo/demo.c +++ b/nac3standalone/demo/demo.c @@ -64,14 +64,14 @@ void output_asciiart(int32_t x) { struct cslice { void *data; - usize len; + uint32_t len; }; void output_int32_list(struct cslice *slice) { const int32_t *data = (int32_t *) slice->data; putchar('['); - for (usize i = 0; i < slice->len; ++i) { + for (uint32_t i = 0; i < slice->len; ++i) { if (i == slice->len - 1) { printf("%d", data[i]); } else { @@ -85,7 +85,7 @@ void output_int32_list(struct cslice *slice) { void output_str(struct cslice *slice) { const char *data = (const char *) slice->data; - for (usize i = 0; i < slice->len; ++i) { + for (uint32_t i = 0; i < slice->len; ++i) { putchar(data[i]); } }