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

Emil Velikov emil.l.velikov at gmail.com
Wed Jan 6 13:30:42 PST 2016


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


More information about the waffle mailing list