mirror of
https://github.com/openvswitch/ovs
synced 2025-10-27 15:18:06 +00:00
clang: Fix the "expression result unused" warning.
This commit makes macro function "ASSIGN_CONTAINER()" evaluates to "(void)0". This is to avoid the 'clang' warning: "expression result unused", since most of time, the final evaluated value is not used. Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
10
lib/list.h
10
lib/list.h
@@ -72,11 +72,11 @@ bool list_is_short(const struct list *);
|
||||
for (ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.prev, MEMBER); \
|
||||
&(ITER)->MEMBER != (LIST); \
|
||||
ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.prev, MEMBER))
|
||||
#define LIST_FOR_EACH_SAFE(ITER, NEXT, MEMBER, LIST) \
|
||||
for (ASSIGN_CONTAINER(ITER, (LIST)->next, MEMBER); \
|
||||
(&(ITER)->MEMBER != (LIST) \
|
||||
? ASSIGN_CONTAINER(NEXT, (ITER)->MEMBER.next, MEMBER) \
|
||||
: 0); \
|
||||
#define LIST_FOR_EACH_SAFE(ITER, NEXT, MEMBER, LIST) \
|
||||
for (ASSIGN_CONTAINER(ITER, (LIST)->next, MEMBER); \
|
||||
(&(ITER)->MEMBER != (LIST) \
|
||||
? ASSIGN_CONTAINER(NEXT, (ITER)->MEMBER.next, MEMBER), 1 \
|
||||
: 0); \
|
||||
(ITER) = (NEXT))
|
||||
|
||||
#endif /* list.h */
|
||||
|
||||
Reference in New Issue
Block a user