# HG changeset patch # User Matti Hamalainen # Date 1579281237 -7200 # Node ID 98c8bd80f63353b26ee2a774f067e8b110768e8b # Parent dfed3754f7fdff8c615da2b2d6720fdbd25e6b5d Fix ringbuf size and n types. diff -r dfed3754f7fd -r 98c8bd80f633 th_datastruct.c --- a/th_datastruct.c Fri Jan 17 04:20:16 2020 +0200 +++ b/th_datastruct.c Fri Jan 17 19:13:57 2020 +0200 @@ -350,9 +350,7 @@ void th_ringbuf_free(th_ringbuf_t *buf) { - int i; - - for (i = 0; i < buf->size; i++) + for (size_t i = 0; i < buf->size; i++) { if (buf->data[i] != NULL) buf->deallocator(buf->data[i]); diff -r dfed3754f7fd -r 98c8bd80f633 th_datastruct.h --- a/th_datastruct.h Fri Jan 17 04:20:16 2020 +0200 +++ b/th_datastruct.h Fri Jan 17 19:13:57 2020 +0200 @@ -54,8 +54,8 @@ typedef struct { char **data; - int n, size; - void (*deallocator)(void *); + size_t n, size; + void (*deallocator)(void *data); } th_ringbuf_t; th_ringbuf_t * th_ringbuf_new(const size_t size, void (*mdeallocator)(void *));