include/sys: fix style issues in queue.h
****************************************************************************/
#if defined(CONFIG_DEBUG_SYS_QUEUE)
-# define _Q_INVALID ((void *)-1)
-# define _Q_INVALIDATE(a) (a) = _Q_INVALID
+# define _Q_INVALID ((FAR void *)(uintptr_t)-1)
+# define _Q_INVALIDATE(a) ((a) = _Q_INVALID)
#else
# define _Q_INVALIDATE(a)
#endif
@@ -138,9 +138,11 @@ for ((var) = SLIST_FIRST(head); \
/* Singly-linked List functions. */
#define SLIST_INIT(head) \
+ do \
{ \
SLIST_FIRST(head) = SLIST_END(head); \
-}
+ } \
+ while(0)
#define SLIST_INSERT_AFTER(slistelm, elm, field) \
do \
@@ -839,7 +841,7 @@ while (0)
#define STAILQ_LAST(head, type, field) \
(STAILQ_EMPTY((head)) ? NULL : \
- ((FAR struct type *)(void *) \
+ ((FAR struct type *)(FAR void *) \
((FAR char *)((head)->stqh_last) - offsetof(struct type, field))))
#endif /* CONFIG_ALLOW_BSD_COMPONENTS */
