[waffle] [PATCH v2 1/4] wflinfo.c: split out flags struct

Emil Velikov emil.l.velikov at gmail.com
Wed Jan 6 13:28:16 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>
>
> This is groundwork for adding a json interface to wflinfo.
>
> v2: - remove extra return statement (Frank)
>     - rename flags to context_flags (Chad)
> ---
>  src/utils/wflinfo.c | 33 +++++++++++++++++----------------
>  1 file changed, 17 insertions(+), 16 deletions(-)
>
> diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c
> index 268d4b8..eefb605 100644
> --- a/src/utils/wflinfo.c
> +++ b/src/utils/wflinfo.c
> @@ -487,23 +487,24 @@ print_extensions(bool use_stringi)
>      printf("\n");
>  }
>
> +static struct {
> +    GLint flag;
> +    char *str;
> +} context_flags[] = {
One could use a few const qualifiers in here (and yes, it was supposed
to be a simple move), if this gets to v3.

> +    { GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT, "FORWARD_COMPATIBLE" },
> +    { GL_CONTEXT_FLAG_DEBUG_BIT, "DEBUG" },
> +    { GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB, "ROBUST_ACCESS" },
> +};
> +
>  static void
>  print_context_flags(void)
>  {
> -    static struct {
> -        GLint flag;
> -        char *str;
> -    } flags[] = {
> -        { GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT, "FORWARD_COMPATIBLE" },
> -        { GL_CONTEXT_FLAG_DEBUG_BIT, "DEBUG" },
> -        { GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB, "ROBUST_ACCESS" },
> -    };
> -    int flag_count = sizeof(flags) / sizeof(flags[0]);
> -    GLint context_flags = 0;
> +    int flag_count = sizeof(context_flags) / sizeof(context_flags[0]);
> +    GLint gl_context_flags = 0;
Proposed name (annoyingly) clashes with the existing variable, but
neither this or the previous is a deal breaker.

-Emil


More information about the waffle mailing list