[waffle] [PATCH v2 3/4] wflinfo.c: split version, renderer, and vendor checks
Chad Versace
chad.versace at intel.com
Fri Jan 8 14:06:45 PST 2016
On 01/06/2016 02:55 PM, Dylan Baker wrote:
>
>
> On Wed, Jan 6, 2016 at 1:30 PM, Emil Velikov <emil.l.velikov at gmail.com <mailto:emil.l.velikov at gmail.com>> wrote:
>
> On 5 January 2016 at 19:46, <baker.dylan.c at gmail.com <mailto:baker.dylan.c at gmail.com>> wrote:
> > From: Dylan Baker <baker.dylan.c at gmail.com <mailto:baker.dylan.c at gmail.com>>
> > +static const char *
> > +get_vendor(void)
> > +{
> > + const char *vendor = (const char *) glGetString(GL_VENDOR);
> > + if (glGetError() != GL_NO_ERROR || vendor == NULL) {
> > + vendor = "WFLINFO_GL_ERROR";
> > + }
> > +
> Wish I caught you before re-spinning things. This and the other two
> can loose the brackets - those were added due to bugs in MSVC's C99
> parser. This comment is another "if things ever get to v3".
>
> -Emil
>
>
> After learning GO I'm always going to use brackets, because being in
> a good habit of using brackets prevents an entire class of bugs (like
> apple's ssl return bug). Unless Chad really objects to having the
> brackets I prefer them.
Even though it's unpopular with C programmers, I prefer, like Dylan,
to use brackets everywhere. Programming in C is hard enough; deciding
when to use or not use brackets is another unneeded mental burden.
Also, I've encountered real bugs in driver code due to a missing
bracket.
I'm not entirely consistent, though. Sometimes I don't bracket when
I'm *gasp* feeling lazy.
More information about the waffle
mailing list