[Mesa-dev] [PATCH] r600: Flip point sprite coordinates when rendering to an FBO.

Dave Airlie airlied at gmail.com
Mon Jul 19 16:02:22 PDT 2010


On Tue, Jul 20, 2010 at 7:27 AM, Henri Verbeet <hverbeet at gmail.com> wrote:
> On 19 July 2010 23:13, Matt Turner <mattst88 at gmail.com> wrote:
>> I can't speak to the meaning of this change, but the use of ^ and !!
>> is just an abuse of the language.
>>
>> ^ is binary XOR. Logical XOR is !=.
>>
>> Let's write this like
>>    if ((ctx->Point.SpriteOrigin == GL_LOWER_LEFT) !=
>> (ctx->DrawBuffer->Name != NULL))
>>
> Well, Name isn't a pointer. I can easily make this change if that's
> really the preferred form, but I'm not sure why you'd consider ^ or !!
> abuse, it looks more obvious to me.

Its abuse because if you read that your brain would have to go wtf at
least twice,

I don't mind !!, since your brain can deal with that, but using binary
operators where you really want logical is really bad for the reader.

Open source code should be optimised for readers not writers.

Dave.


More information about the mesa-dev mailing list