[PATCH] Some additional return value checking, updated.

Behdad Esfahbod behdad at behdad.org
Mon Nov 22 20:01:16 PST 2010


On 11/22/10 21:59, Kristian Høgsberg wrote:

>> -       eglBindAPI(EGL_OPENGL_API);
>> +       if (EGL_FALSE == eglBindAPI(EGL_OPENGL_API)) {
>> +               fprintf(stderr, "failed to bind api EGL_OPENGL_API\n");
>> +               return NULL;
>> +       }
> 
> I don't use the "if (EGL_FALSE == stuff())" idiom in wayland.  I get
> that the idea is that by putting the constant on the left hand side of
> ==, we avoid accidents like "if (a = 5) ...", but gcc already warns
> about that and "if (5 == a)" just isn't very intuitive. Don't take it
> personal, it's one of my pet peeves ;-)

http://stackoverflow.com/questions/2349378/new-programming-jargon-you-coined/2430307#2430307

:)
b


More information about the wayland-devel mailing list