summaryrefslogtreecommitdiffstats
path: root/src/mapi/glapi
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-08-25 17:27:08 -0700
committerIan Romanick <[email protected]>2011-08-26 23:33:12 -0700
commitf40c291ed637a916414d1367de379a0980488b4b (patch)
tree59f033f20bdd7c2e6713dabbedba0a206a9b1ca4 /src/mapi/glapi
parent5266c87c873057d9d3ecdaf1745d99225a5dc292 (diff)
mapi: Silence many "warning: unused parameter"
When generating dispatch templates, emit the '(void) blah;' magic to make GCC happy. This reduces a lot of warning spam if you build with -Wunused-parameter or -Wextra. Reviewed-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'src/mapi/glapi')
-rw-r--r--src/mapi/glapi/gen/gl_apitemp.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mapi/glapi/gen/gl_apitemp.py b/src/mapi/glapi/gen/gl_apitemp.py
index 41a40fbeb68..72c2e46c37e 100644
--- a/src/mapi/glapi/gen/gl_apitemp.py
+++ b/src/mapi/glapi/gen/gl_apitemp.py
@@ -64,6 +64,8 @@ class PrintGlOffsets(gl_XML.gl_print_base):
n = f.static_name(name)
+ silence = ''
+ space = ''
for p in f.parameterIterator():
if p.is_padding:
continue
@@ -78,6 +80,9 @@ class PrintGlOffsets(gl_XML.gl_print_base):
o_string = o_string + comma + cast + p.name
comma = ", "
+ silence += "%s(void) %s;" % (space, p.name);
+ space = ' '
+
if f.return_type != 'void':
dispatch = "RETURN_DISPATCH"
@@ -97,6 +102,8 @@ class PrintGlOffsets(gl_XML.gl_print_base):
print '%s %s KEYWORD2 NAME(%s)(%s)' % (keyword, f.return_type, n, f.get_parameter_string(name))
print '{'
+ if silence:
+ print ' %s' % (silence)
if p_string == "":
print ' %s(%s, (), (F, "gl%s();\\n"));' \
% (dispatch, f.name, name)