From 14ffc38e44c1e64dc231cbdb3f4871da12cdd274 Mon Sep 17 00:00:00 2001 From: PulkoMandy Date: Sat, 23 Feb 2019 22:16:59 +0100 Subject: [PATCH] kernel list: use BytePointer Change-Id: I259cc33ad71cfbabc7f85278287a64a31dcb5e44 Reviewed-on: https://review.haiku-os.org/c/1101 Reviewed-by: waddlesplash --- src/system/kernel/util/list.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/util/list.cpp b/src/system/kernel/util/list.cpp index ce7cc1d853..7f7341172a 100644 --- a/src/system/kernel/util/list.cpp +++ b/src/system/kernel/util/list.cpp @@ -5,11 +5,13 @@ #include +#include -#define GET_ITEM(list, item) ((void *)((uint8 *)item - list->offset)) -#define GET_LINK(list, item) ((list_link *)((uint8 *)item + list->offset)) - +#define GET_ITEM(list, item) ({ BytePointer pointer((uint8*)item \ + - list->offset); &pointer; }) +#define GET_LINK(list, item) ({ BytePointer pointer((uint8*)item \ + + list->offset); &pointer; }) /** Initializes the list with a specified offset to the link * structure in the items that will be part of the list.