changeset 733:79d06eb6d39f

Rename "allocated" field to "is_allocated" in some structures.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 07 Dec 2022 11:57:43 +0200
parents d190dccc3ee6
children 2ae1045f6c18
files th_datastruct.c th_datastruct.h
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/th_datastruct.c	Wed Dec 07 00:17:57 2022 +0200
+++ b/th_datastruct.c	Wed Dec 07 11:57:43 2022 +0200
@@ -318,7 +318,7 @@
         return res;
     }
 
-    (*buf)->allocated = TRUE;
+    (*buf)->is_allocated = TRUE;
 
     return THERR_OK;
 }
@@ -349,7 +349,7 @@
 
     th_free(buf->data);
 
-    if (buf->allocated)
+    if (buf->is_allocated)
         th_free(buf);
 }
 
@@ -391,7 +391,7 @@
         return NULL;
 
     th_growbuf_init(buf, mingrow);
-    buf->allocated = TRUE;
+    buf->is_allocated = TRUE;
 
     return buf;
 }
@@ -401,7 +401,7 @@
 {
     th_free(buf->data);
 
-    if (buf->allocated)
+    if (buf->is_allocated)
         th_free(buf);
 }
 
--- a/th_datastruct.h	Wed Dec 07 00:17:57 2022 +0200
+++ b/th_datastruct.h	Wed Dec 07 11:57:43 2022 +0200
@@ -59,7 +59,7 @@
     size_t size;    ///< Size of this ringbuffer in elements (aka pointers to data)
     size_t n;       ///< Number of elements currently in the ringbuffer (@p n <= @p size)
     void (*deallocator)(void *data); ///< De-allocator function that frees one element.
-    BOOL allocated;
+    BOOL is_allocated;
 } th_ringbuf_t;
 
 
@@ -77,7 +77,7 @@
 
 typedef struct
 {
-    BOOL allocated;
+    BOOL is_allocated;
     uint8_t *data;
     size_t size, len, mingrow;
 } th_growbuf_t;