summaryrefslogtreecommitdiff
path: root/libcr_ipc
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-11 10:22:26 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-11 10:22:26 -0700
commitced8ab50af1429d9ba7651da1b3b78014fd76e79 (patch)
tree4f0975a2594c4bfa97ebaa6b263e712858d2e8a4 /libcr_ipc
parentd84daf84d2ced072782ef3c61e5088b06d950939 (diff)
libmisc: Write my own assert.hHEADmain
Diffstat (limited to 'libcr_ipc')
-rw-r--r--libcr_ipc/include/libcr_ipc/_linkedlist.h2
-rw-r--r--libcr_ipc/include/libcr_ipc/select.h9
2 files changed, 6 insertions, 5 deletions
diff --git a/libcr_ipc/include/libcr_ipc/_linkedlist.h b/libcr_ipc/include/libcr_ipc/_linkedlist.h
index 43b7286..e5aa52a 100644
--- a/libcr_ipc/include/libcr_ipc/_linkedlist.h
+++ b/libcr_ipc/include/libcr_ipc/_linkedlist.h
@@ -7,7 +7,7 @@
#ifndef _LIBCR_IPC__LINKEDLIST_H_
#define _LIBCR_IPC__LINKEDLIST_H_
-#include <assert.h>
+#include <libmisc/assert.h>
/* singly linked list *********************************************************/
diff --git a/libcr_ipc/include/libcr_ipc/select.h b/libcr_ipc/include/libcr_ipc/select.h
index f094662..ce14416 100644
--- a/libcr_ipc/include/libcr_ipc/select.h
+++ b/libcr_ipc/include/libcr_ipc/select.h
@@ -5,11 +5,12 @@
*/
#include <alloca.h> /* for alloca() */
-#include <assert.h> /* for assert() */
#include <stdarg.h> /* for va_* */
#include <stddef.h> /* for size_t */
#include <stdlib.h> /* for random() */
+#include <libmisc/assert.h>
+
#include <libcr_ipc/chan.h>
#ifndef _LIBCR_IPC_SELECT_H_
@@ -98,7 +99,7 @@ static inline enum _cr_select_class _cr_select_getclass(struct cr_select_arg arg
case _CR_SELECT_OP_DEFAULT:
return _CR_SELECT_CLASS_DEFAULT;
default:
- __builtin_unreachable();
+ assert_notreached("invalid arg.op");
}
}
@@ -154,14 +155,14 @@ static size_t cr_select_v(size_t arg_cnt, struct cr_select_arg arg_vec[]) {
seen++;
}
}
- __builtin_unreachable();
+ assert_notreached("should have returned from inside for() loop");
}
if (cnt_default) {
for (size_t i = 0; i < arg_cnt; i++)
if (_cr_select_getclass(arg_vec[i]) == _CR_SELECT_CLASS_DEFAULT)
return i;
- __builtin_unreachable();
+ assert_notreached("should have returned from inside for() loop");
}
struct _cr_select_waiters waiters = {