[waffle] [PATCH v2 3/4] wflinfo.c: split version, renderer, and vendor checks

Dylan Baker baker.dylan.c at gmail.com
Wed Jan 6 14:55:17 PST 2016


On Wed, Jan 6, 2016 at 1:30 PM, Emil Velikov <emil.l.velikov at gmail.com>
wrote:

> On 5 January 2016 at 19:46,  <baker.dylan.c at gmail.com> wrote:
> > From: Dylan Baker <baker.dylan.c at gmail.com>
> >
> > Pull these out into helper functions, this change will be used in a
> > following patch to add a JSON printer.
> >
> > Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> >
> > v2: - change "const char * name" to "const char *name" (Frank)
> > ---
> >  src/utils/wflinfo.c | 50
> ++++++++++++++++++++++++++++++++++++--------------
> >  1 file changed, 36 insertions(+), 14 deletions(-)
> >
> > diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c
> > index 4b92222..8ee95c6 100644
> > --- a/src/utils/wflinfo.c
> > +++ b/src/utils/wflinfo.c
> > @@ -460,6 +460,39 @@ parse_version(const char *version)
> >      return (major * 10) + minor;
> >  }
> >
> > +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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/waffle/attachments/20160106/2cc776b1/attachment.html>


More information about the waffle mailing list