aboutsummaryrefslogtreecommitdiff
path: root/match.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-01-18 11:39:20 -0800
committerBruce Hill <bruce@bruce-hill.com>2021-01-18 11:39:20 -0800
commit4b3579c968a5f6c9239ee6235f03108d80e1a2e3 (patch)
treeec318cefbd3433a24a0c6d4614e3a3e09400301e /match.c
parent0b0e99bfac8e11463ae15211882aab98ba150dcb (diff)
More bools, because why not
Diffstat (limited to 'match.c')
-rw-r--r--match.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/match.c b/match.c
index eb9b383..05d8a8a 100644
--- a/match.c
+++ b/match.c
@@ -3,6 +3,7 @@
//
#include <ctype.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -14,13 +15,13 @@
#ifdef DEBUG_HEAP
// Doubly-linked list operations:
-#define DLL_PREPEND(head, node) do { (node)->atme = &(head); (node)->next = head; if (head) (head)->atme = &(node)->next; head = node; } while(0)
-#define DLL_REMOVE(node) do { *(node)->atme = (node)->next; if ((node)->next) (node)->next->atme = (node)->atme; } while(0)
+#define DLL_PREPEND(head, node) do { (node)->atme = &(head); (node)->next = head; if (head) (head)->atme = &(node)->next; head = node; } while(false)
+#define DLL_REMOVE(node) do { *(node)->atme = (node)->next; if ((node)->next) (node)->next->atme = (node)->atme; } while(false)
#endif
// Refcounting ownership-setting macros:
-#define ADD_OWNER(owner, m) do { owner = m; ++(m)->refcount; } while(0)
-#define REMOVE_OWNERSHIP(owner) do { if (owner) { --(owner)->refcount; recycle_if_unused(&(owner)); owner = NULL; } } while(0)
+#define ADD_OWNER(owner, m) do { owner = m; ++(m)->refcount; } while(false)
+#define REMOVE_OWNERSHIP(owner) do { if (owner) { --(owner)->refcount; recycle_if_unused(&(owner)); owner = NULL; } } while(false)
// New match objects are either recycled from unused match objects or allocated
// from the heap. While it is in use, the match object is stored in the