In article <[EMAIL PROTECTED]>,
Alfred Perlstein <[EMAIL PROTECTED]> wrote:
>
> +typedef struct { volatile int a; } atomic_t;
> +
> +#define atomic_init(p, v) do { p->a = v; } while(0)
> +#define atomic_destroy(p) do { ; } while(0)
I don't see the need for the do ... while(0) construct here. Why not
something simpler?
#define atomic_init(p, v) ((p)->a = (v))
#define atomic_destroy(p) ((void)0)
Likewise for atomic_set(), which seems to do the same thing as
atomic_init().
John
--
John Polstra [EMAIL PROTECTED]
John D. Polstra & Co., Inc. Seattle, Washington USA
"Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message