Cast the pointer to void * before casting it back to struct type * in

STAILQ_LAST.  This quiets a warning from GCC about increased required
alignment for the cast.

Idea from:      cognet
This commit is contained in:
Maxime Henrion 2006-03-03 18:54:33 +00:00
parent fb0a379774
commit 1bf308c1ea

View File

@ -274,7 +274,7 @@ struct { \
#define STAILQ_LAST(head, type, field) \
(STAILQ_EMPTY((head)) ? \
NULL : \
((struct type *) \
((struct type *)(void *) \
((char *)((head)->stqh_last) - __offsetof(struct type, field))))
#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)