From ced8ab50af1429d9ba7651da1b3b78014fd76e79 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Mon, 11 Nov 2024 10:22:26 -0700 Subject: libmisc: Write my own assert.h --- libcr_ipc/include/libcr_ipc/_linkedlist.h | 2 +- libcr_ipc/include/libcr_ipc/select.h | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'libcr_ipc') 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 +#include /* 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 /* for alloca() */ -#include /* for assert() */ #include /* for va_* */ #include /* for size_t */ #include /* for random() */ +#include + #include #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 = { -- cgit v1.2.3-2-g168b