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:
@@ -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)++; \
|
||||
|
||||
Reference in New Issue
Block a user