slist: Make this header file compatible with C++

C++ requires explicit conversions from a void to a non-void pointer.

Signed-off-by: Li Feng <fengli@smartx.com>
[ bvanassche: edited commit message, removed casts and changed the declaration
  type ]
This commit is contained in:
Li Feng
2021-08-20 18:03:57 +08:00
committed by Bart Van Assche
parent c412ae0e1d
commit 6b93325b39

View File

@@ -28,7 +28,7 @@
if ((*list) == NULL) { \
ISCSI_LIST_ADD((list), (item)); \
} else { \
void *head = (*list); \
typeof(*list) head = (*list); \
while ((*list)->next) \
(*list) = (*list)->next; \
(*list)->next = (item); \
@@ -40,7 +40,7 @@
if ((*list) == (item)) { \
(*list) = (item)->next; \
} else { \
void *head = (*list); \
typeof(*list) head = (*list); \
while ((*list)->next && (*list)->next != (item)) \
(*list) = (*list)->next; \
if ((*list)->next != NULL) { \
@@ -52,7 +52,7 @@
#define ISCSI_LIST_LENGTH(list,length) \
do { \
(length) = 0; \
void *head = (*list); \
typeof(*list) head = (*list); \
while ((*list)) { \
(*list) = (*list)->next; \
(length)++; \