changeset 626:98c8bd80f633

Fix ringbuf size and n types.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 17 Jan 2020 19:13:57 +0200
parents dfed3754f7fd
children 964657ad0960
files th_datastruct.c th_datastruct.h
diffstat 2 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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]);
--- 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 *));