2005/8/9, Claudio Jeker <[EMAIL PROTECTED]>: > On Tue, Aug 09, 2005 at 11:38:38AM +0200, Alexander Farber wrote: > > what I dislike about OpenBSD's queue.h is that you can't take an > > element from a SLIST and put it into a SIMPLEQ and vice versa.
> Why? SIMPLEQ is a superset of SLIST. Just use the SIMPLEQ "functions" > SIMPLEQ_INSERT_HEAD an SIMPLEQ_REMOVE_HEAD. Because SIMPLEQ_INSERT_* and SIMPLEQ_REMOVE are slower than the SLIST counterparts - the former have to update the sqh_last too. > Why should we change the emlement entries of SLIST and SIMPLEQ with the > result that suddenly somebody starts to use SLIST macros on something that > is actually a SIMPLEQ. This results in corrupted queues and strange bugs. > So don't do it. Yes, you'll have to pay more attention but would gain the flexibility to take SLIST members and put them into a SIMPLEQ when needed. And the same for the double-linked LIST, TAILQ and CIRCLEQ. And this change for queue.h would be backwards-compatible.