From 992e4ecd700a099b5f59b1b182a26b18fba44965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Thu, 16 Mar 2017 12:19:39 +0200 Subject: [PATCH] mesa: fix a duplicate 'const' declaration specifier warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit marshal_generated.c:15836:10: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] const const GLvoid * pointer = cmd->pointer; Signed-off-by: Tapani Pälli --- src/mapi/glapi/gen/gl_marshal.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py index fe03090..2c84c31 100644 --- a/src/mapi/glapi/gen/gl_marshal.py +++ b/src/mapi/glapi/gen/gl_marshal.py @@ -177,12 +177,15 @@ class PrintCode(gl_XML.gl_print_base): out('{') with indent(): for p in func.fixed_params: + decl_spec = 'const' + if p.string().startswith("const"): + decl_spec = '' if p.count: - out('const {0} * {1} = cmd->{1};'.format( - p.get_base_type_string(), p.name)) + out('{0} {1} * {2} = cmd->{2};'.format( + decl_spec, p.get_base_type_string(), p.name)) else: - out('const {0} {1} = cmd->{1};'.format( - p.type_string(), p.name)) + out('{0} {1} {2} = cmd->{2};'.format( + decl_spec, p.type_string(), p.name)) if func.variable_params: for p in func.variable_params: out('const {0} * {1};'.format( -- 2.9.3