# HG changeset patch # User Matti Hamalainen # Date 1579282333 -7200 # Node ID b695eb769e30b53ced98cadaf12872601b91fa70 # Parent 140e2272471c716ec01e4895569ff1d99afc077c Change ringbuffer data type from (char *) to (void *). diff -r 140e2272471c -r b695eb769e30 th_datastruct.c --- a/th_datastruct.c Fri Jan 17 19:22:04 2020 +0200 +++ b/th_datastruct.c Fri Jan 17 19:32:13 2020 +0200 @@ -333,7 +333,7 @@ if ((res = th_malloc0(sizeof(th_ringbuf_t))) == NULL) return NULL; - if ((res->data = (char **) th_calloc(size, sizeof(char *))) == NULL) + if ((res->data = th_calloc(size, sizeof(void *))) == NULL) { th_free(res); return NULL; @@ -349,10 +349,10 @@ BOOL th_ringbuf_grow(th_ringbuf_t *buf, const size_t n) { - buf->data = (char **) th_realloc(buf->data, (buf->size + n) * sizeof(char *)); + buf->data = (void **) th_realloc(buf->data, (buf->size + n) * sizeof(void *)); if (buf->data != NULL) { - memset(buf->data + buf->size, 0, sizeof(char *) * n); + memset(buf->data + buf->size, 0, sizeof(void *) * n); buf->size += n; return TRUE; } diff -r 140e2272471c -r b695eb769e30 th_datastruct.h --- a/th_datastruct.h Fri Jan 17 19:22:04 2020 +0200 +++ b/th_datastruct.h Fri Jan 17 19:32:13 2020 +0200 @@ -53,9 +53,9 @@ */ typedef struct { - char **data; size_t n, size; void (*deallocator)(void *data); + void **data; ///< Array of pointers to the data } th_ringbuf_t;