[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: does SIMPLEQ_REMOVE_HEAD() work ?
- To: tech_(_at_)_openbsd_(_dot_)_org
- Subject: Re: does SIMPLEQ_REMOVE_HEAD() work ?
- From: "Chris, the Young One" <cky_(_at_)_pobox_(_dot_)_com>
- Date: Wed, 19 Jul 2000 23:22:03 +1200
- Mail-followup-to: tech_(_at_)_openbsd_(_dot_)_org
- Mail-reply-to: young1_(_at_)_hedgee_(_dot_)_com
This is based on a very simple glance at the code, and I don't
guarantee that this is anything more than a stab in the dark.
On Tue, Jul 18, 2000 at 07:41:55PM +0000, Peter Galbavy wrote:
! #define SIMPLEQ_REMOVE_HEAD(head, elm, field) do { \
! if (((head)->sqh_first = (elm)->field.sqe_next) == NULL)\
! (head)->sqh_last = &(head)->sqh_first; \
! } while (0)
I think this function removes all elements, from the head of the list,
up to and including elm.
! I would have thought, from the small detail in the man page that "elm"
! would be set to point to the removed element and the head set to
! head->sqh_first->field.sqe_next ?
Doesn't that imply removing just the first item from the head of the
list (with no regard to the value of elm)?
A second opinion would be appreciated.
Thanks,
---Chris K.
--
Chris, the Young One |_ Never brag about how your machines haven't been
Auckland, New Zealand |_ hacked, or your code hasn't been broken. It's
http://cloud9.hedgee.com/ |_ guaranteed to bring the wrong kind of
PGP: 0xCCC6114E/0x706A6AAD |_ attention. ---Neil Schneider
Visit your host, monkey.org