summaryrefslogtreecommitdiff
path: root/libmisc
diff options
context:
space:
mode:
Diffstat (limited to 'libmisc')
-rw-r--r--libmisc/include/libmisc/assert.h6
-rw-r--r--libmisc/include/libmisc/linkedlist.h10
-rw-r--r--libmisc/include/libmisc/map.h2
3 files changed, 11 insertions, 7 deletions
diff --git a/libmisc/include/libmisc/assert.h b/libmisc/include/libmisc/assert.h
index 0563a58..ccdb288 100644
--- a/libmisc/include/libmisc/assert.h
+++ b/libmisc/include/libmisc/assert.h
@@ -10,7 +10,11 @@
#ifdef NDEBUG
# define __assert_msg(expr, expr_str, msg) ((void)0)
#else
-# define __assert_msg(expr, expr_str, msg) do { if (!(expr)) __assert_msg_fail(expr_str, __FILE__, __LINE__, __func__, msg); } while (0)
+# define __assert_msg(expr, expr_str, msg) \
+ do { \
+ if (!(expr)) \
+ __assert_msg_fail(expr_str, __FILE__, __LINE__, __func__, msg); \
+ } while (0)
[[noreturn]] void __assert_msg_fail(const char *expr,
const char *file, unsigned int line, const char *func,
const char *msg);
diff --git a/libmisc/include/libmisc/linkedlist.h b/libmisc/include/libmisc/linkedlist.h
index e8c65db..b6ff688 100644
--- a/libmisc/include/libmisc/linkedlist.h
+++ b/libmisc/include/libmisc/linkedlist.h
@@ -56,14 +56,14 @@ void _dlist_pop_from_front(struct _dlist_root *root);
typeof(*_rootp->front) *_nodep = NODE; \
_slist_push_to_rear((struct _slist_root *)_rootp, \
(struct _slist_node *)_nodep); \
-} while(0)
+} while (0)
#define slist_pop_from_front(ROOT) { \
/* This temporary variables are to get the compiler to check \
* the type. */ \
typeof(*(ROOT)->_slist_root_typ[0]) *_rootp = ROOT; \
_slist_pop_from_front((struct _slist_root *)_rootp); \
-} while(0)
+} while (0)
/* doubly linked list (non-intrusive) *****************************************/
@@ -87,7 +87,7 @@ void _dlist_pop_from_front(struct _dlist_root *root);
typeof(*_rootp->front) *_nodep = NODE; \
_dlist_push_to_rear((struct _dlist_root *)_rootp, \
(struct _dlist_node *)_nodep); \
-} while(0)
+} while (0)
#define dlist_remove(ROOT, NODE) { \
/* These temporary variables are to get the compiler to check \
@@ -96,13 +96,13 @@ void _dlist_pop_from_front(struct _dlist_root *root);
typeof(*_rootp->front) *_nodep = NODE; \
_dlist_remove((struct _dlist_root *)_rootp, \
(struct _dlist_node *)_nodep); \
-} while(0)
+} while (0)
#define dlist_pop_from_front(ROOT) { \
/* This temporary variables are to get the compiler to check \
* the type. */ \
typeof(*(ROOT)->_dlist_root_typ[0]) *_rootp = ROOT; \
_dlist_pop_from_front((struct _dlist_root *)_rootp); \
-} while(0)
+} while (0)
#endif /* _LIBMISC_LINKEDLIST_H_ */
diff --git a/libmisc/include/libmisc/map.h b/libmisc/include/libmisc/map.h
index 41ac069..6622595 100644
--- a/libmisc/include/libmisc/map.h
+++ b/libmisc/include/libmisc/map.h
@@ -52,7 +52,7 @@ struct _map {
(M)->core.offsetof_k = offsetof(typeof((M)->kv_typ[0]), val.key); \
(M)->core.offsetof_v = offsetof(typeof((M)->kv_typ[0]), val.val); \
} \
-} while(0)
+} while (0)
/* Methods ********************************************************************/