Re: [Gluster-devel] !! operator

2016-04-02 Thread Emmanuel Dreyfus
Jeff Darcy wrote: > Sorry if my comment came off as dismissive. It was not dissmissive. My reply was not ironic, I was gladly surprised to learn something about C syntax. >From an objective code-readability standpoint it's probably a bad > idiom. IMO the root of the

Re: [Gluster-devel] !! operator

2016-04-02 Thread Jeff Darcy
> Thanks for the explanation. I was able to practice C for 18 years in > numerous projects without having the opportunity to see it. I will got > to bed less ignorant tonight. :-) Sorry if my comment came off as dismissive. I was only trying to explain why I'd assume it's intentional. I'll

Re: [Gluster-devel] !! operator

2016-04-02 Thread Emmanuel Dreyfus
Jeff Darcy wrote: > It's a common idiom in the Linux kernel/coreutils community. I > thought it was in BSD too. Thanks for the explanation. I was able to practice C for 18 years in numerous projects without having the opportunity to see it. I will got to bed less ignorant

Re: [Gluster-devel] !! operator

2016-04-02 Thread Jeff Darcy
> I found a !! in glusterfs sources. Is it a C syntax I do not know, a > bug, or just a weird syntax? > > xlators/cluster/afr/src/afr-inode-write.c: > local->stable_write = !!((fd->flags|flags)&(O_SYNC|O_DSYNC)); It's a common idiom in the Linux kernel/coreutils community. I thought it was

[Gluster-devel] !! operator

2016-04-02 Thread Emmanuel Dreyfus
Hello I found a !! in glusterfs sources. Is it a C syntax I do not know, a bug, or just a weird syntax? xlators/cluster/afr/src/afr-inode-write.c: local->stable_write = !!((fd->flags|flags)&(O_SYNC|O_DSYNC)); -- Emmanuel Dreyfus http://hcpnet.free.fr/pubz m...@netbsd.org