Driver code simplifying

This commit is contained in:
Imbus 2024-07-02 06:49:49 +02:00
parent 06b949bed4
commit 85071d3130

View file

@ -21,15 +21,18 @@ main(void)
} }
int d; int d;
while(rb_pop_front(&rb, &d, memcpy) == ReadOk) { printf("Data: [");
printf("Data: %d\n", d); while(rb_pop_front(&rb, &d, memcpy) == ReadOk)
} printf("%d,", d);
printf("\b]\n");
// Test wrap around // Test wrap around
rb_push_many(&rb, arr, memcpy, 10); 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 // Test clear
rb_clear(&rb); rb_clear(&rb);