<div dir="ltr">Okay, I can fix that too.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 27, 2015 at 7:43 AM, Frank Henigman <span dir="ltr"><<a href="mailto:fjhenigman@google.com" target="_blank">fjhenigman@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wed, Dec 16, 2015 at 8:37 PM,  <<a href="mailto:baker.dylan.c@gmail.com">baker.dylan.c@gmail.com</a>> wrote:<br>
> From: Dylan Baker <<a href="mailto:baker.dylan.c@gmail.com">baker.dylan.c@gmail.com</a>><br>
><br>
> Pull these out into helper functions, this change will be used in a<br>
> following patch to add a json printer.<br>
><br>
> Signed-off-by: Dylan Baker <<a href="mailto:dylanx.c.baker@intel.com">dylanx.c.baker@intel.com</a>><br>
> ---<br>
>  src/utils/wflinfo.c | 50 ++++++++++++++++++++++++++++++++++++--------------<br>
>  1 file changed, 36 insertions(+), 14 deletions(-)<br>
><br>
> diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c<br>
> index 905fd90..b843757 100644<br>
> --- a/src/utils/wflinfo.c<br>
> +++ b/src/utils/wflinfo.c<br>
> @@ -458,6 +458,39 @@ parse_version(const char *version)<br>
>      return (major * 10) + minor;<br>
>  }<br>
><br>
> +static const char *<br>
> +get_vendor(void)<br>
> +{<br>
> +    const char *vendor = (const char *) glGetString(GL_VENDOR);<br>
> +    if (glGetError() != GL_NO_ERROR || vendor == NULL) {<br>
> +        vendor = "WFLINFO_GL_ERROR";<br>
> +    }<br>
> +<br>
> +    return vendor;<br>
> +}<br>
> +<br>
> +static const char *<br>
> +get_renderer(void)<br>
> +{<br>
> +    const char *renderer = (const char *) glGetString(GL_RENDERER);<br>
> +    if (glGetError() != GL_NO_ERROR || renderer == NULL) {<br>
> +        renderer = "WFLINFO_GL_ERROR";<br>
> +    }<br>
> +<br>
> +    return renderer;<br>
> +}<br>
> +<br>
> +static const char *<br>
> +get_version(void)<br>
> +{<br>
> +    const char *version_str = (const char *) glGetString(GL_VERSION);<br>
> +    if (glGetError() != GL_NO_ERROR || version_str == NULL) {<br>
> +        version_str = "WFLINFO_GL_ERROR";<br>
> +    }<br>
> +<br>
> +    return version_str;<br>
> +}<br>
> +<br>
>  static void<br>
>  print_extensions(bool use_stringi)<br>
>  {<br>
> @@ -539,20 +572,9 @@ print_wflinfo(const struct options *opts)<br>
>          /* Clear all errors */<br>
>      }<br>
><br>
> -    const char *vendor = (const char *) glGetString(GL_VENDOR);<br>
> -    if (glGetError() != GL_NO_ERROR || vendor == NULL) {<br>
> -        vendor = "WFLINFO_GL_ERROR";<br>
> -    }<br>
> -<br>
> -    const char *renderer = (const char *) glGetString(GL_RENDERER);<br>
> -    if (glGetError() != GL_NO_ERROR || renderer == NULL) {<br>
> -        renderer = "WFLINFO_GL_ERROR";<br>
> -    }<br>
> -<br>
> -    const char *version_str = (const char *) glGetString(GL_VERSION);<br>
> -    if (glGetError() != GL_NO_ERROR || version_str == NULL) {<br>
> -        version_str = "WFLINFO_GL_ERROR";<br>
> -    }<br>
> +    const char * vendor =  get_vendor();<br>
> +    const char * renderer = get_renderer();<br>
> +    const char * version_str = get_version();<br>
<br>
</div></div>nit: usually no space after *<br>
<div class="HOEnZb"><div class="h5"><br>
>      const char *platform = enum_map_to_str(platform_map, opts->platform);<br>
>      assert(platform != NULL);<br>
> --<br>
> 2.6.4<br>
><br>
> _______________________________________________<br>
> waffle mailing list<br>
> <a href="mailto:waffle@lists.freedesktop.org">waffle@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/waffle" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/waffle</a><br>
</div></div></blockquote></div><br></div>