[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: does SIMPLEQ_REMOVE_HEAD() work ?



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