Re: Glib Atomic Operations
- From: Ryan Lortie <desrt desrt ca>
- To: Morten Welinder <mortenw gnome org>
- Cc: gtk-devel-list <gtk-devel-list gnome org>
- Subject: Re: Glib Atomic Operations
- Date: Fri, 07 Oct 2011 09:25:57 -0400
On Fri, 2011-10-07 at 09:24 -0400, Morten Welinder wrote:
> > what is the purpose of '(void) (0 ? *(atomic) ^ *(atomic) : 0)'?
>
> Poor man's type check. That expression isn't valid for every
> possible "atomic".
Specifically, it ensures that the destination of the pointer is an
integral type. You can't perform ^ (xor) on a pointer, struct, double,
etc.
Notice that this check is omitted for the _pointer_ variant -- which is
(of course) expected to work on pointers.
Cheers
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]