On 21 Nov, 2013, at 11:04 , Christos Zoulas <chris...@netbsd.org> wrote:

> Module Name:  src
> Committed By: christos
> Date:         Thu Nov 21 19:04:19 UTC 2013
> 
> Modified Files:
>       src/sys/sys: queue.h
> 
> Log Message:
> provide a const and a non const flavor for CIRCLEQ_END because the kernel
> needs a const one. The const one is supposed to be used for comparisons
> and the non-const one for assignments.

It is a tiny thing, but I think one of the CIRCLEQ_END macros is
useful in applications to replace what is now written as (void *)head with
CIRCLEQ_END(head), and the version best suited for this should be the
one named CIRCLEQ_END() with no extra characters.

Given that all application use of (void *)head in the base system is
for end-of-list comparisons, while only the macros do assignments to
list variables, it might be a bit better to call the comparison version
CIRCLEQ_END() and the assignment version something else.  If you really
do decide to fix the alias problem with the ugly inline then CIRCLEQ_END()
can be defined as that to fix both macros and applications while leaving
CIRCLEQ_END_DONT_USE_THIS() as-is for assignments.

Dennis Ferguson

Reply via email to