On 21 August 2017 at 14:27, Eric Engestrom <eric.engest...@imgtec.com> wrote: > On Monday, 2017-08-21 11:27:19 +0100, Emil Velikov wrote: >> From: Emil Velikov <emil.veli...@collabora.com> >> >> The same declaration was being used for two distinct things - a short >> list of EGL and the core GL extensions. >> >> In the former it is a const string, while the latter is a dynamically >> managed list of extensions. >> >> Define the variables within the specific scope. >> >> Signed-off-by: Emil Velikov <emil.veli...@collabora.com> >> --- >> run.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/run.c b/run.c >> index c001447..afc5ba0 100644 >> --- a/run.c >> +++ b/run.c >> @@ -446,8 +446,8 @@ main(int argc, char **argv) >> "EGL_KHR_create_context", >> "EGL_KHR_surfaceless_context" >> }; >> - char *extension_string = eglQueryString(egl_dpy, EGL_EXTENSIONS); >> for (int i = 0; i < ARRAY_SIZE(egl_extension); i++) { >> + const char *extension_string = eglQueryString(egl_dpy, >> EGL_EXTENSIONS); > > Not sure moving the query inside the loop is a good idea. (it's > a relatively small loop, but still, on principle) > > Keeping just the second hunk below already achieves what you want, but > with variable shadowing, which I'm not a fan of. > How about renaming the two `extension_string` variables throughout the > function to `{egl,gl}_extension_string` (on top on the 2nd hunk)? > Indeed - current patch is a silly. Barring any objections, I'll respin with your suggestion tomorrow.
-Emil _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev