From 85071d3130d4dc0aace71628ccdf1edabbc2d171 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Tue, 2 Jul 2024 06:49:49 +0200 Subject: [PATCH] Driver code simplifying --- driver.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/driver.c b/driver.c index cd59397..36f7bb5 100644 --- a/driver.c +++ b/driver.c @@ -21,15 +21,18 @@ main(void) } int d; - while(rb_pop_front(&rb, &d, memcpy) == ReadOk) { - printf("Data: %d\n", d); - } + printf("Data: ["); + while(rb_pop_front(&rb, &d, memcpy) == ReadOk) + printf("%d,", d); + printf("\b]\n"); // Test wrap around rb_push_many(&rb, arr, memcpy, 10); - while(rb_pop_front(&rb, &d, memcpy) == ReadOk) { - printf("Data: %d\n", d); - } + + printf("Data: ["); + while(rb_pop_front(&rb, &d, memcpy) == ReadOk) + printf("%d,", d); + printf("\b]\n"); // Test clear rb_clear(&rb);