summaryrefslogtreecommitdiff
path: root/tools/glib-client-gen.py
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd@luon.net>2008-03-23 11:22:51 +0000
committerSjoerd Simons <sjoerd@luon.net>2008-03-23 11:22:51 +0000
commit259b55bb3782ca63be5d16039ce3489417f3289b (patch)
tree8fb897d11c435108f7906b6979b314199c1d6b99 /tools/glib-client-gen.py
parentf46f774cca6a1166d5be9d26c1396cad91154536 (diff)
Let the code generation add G_GNUC_UNUSED to function arguments where applicable
Diffstat (limited to 'tools/glib-client-gen.py')
-rw-r--r--tools/glib-client-gen.py38
1 files changed, 21 insertions, 17 deletions
diff --git a/tools/glib-client-gen.py b/tools/glib-client-gen.py
index c96558aa9..81d3aed23 100644
--- a/tools/glib-client-gen.py
+++ b/tools/glib-client-gen.py
@@ -142,7 +142,7 @@ class Generator(object):
if args:
self.b('static void')
- self.b('%s (DBusGProxy *proxy,' % collect_name)
+ self.b('%s (DBusGProxy *proxy G_GNUC_UNUSED,' % collect_name)
for arg in args:
name, info, tp_type, elt = arg
@@ -208,7 +208,7 @@ class Generator(object):
self.b('static void')
self.b('%s (TpProxy *tpproxy,' % invoke_name)
- self.b(' GError *error,')
+ self.b(' GError *error G_GNUC_UNUSED,')
self.b(' GValueArray *args,')
self.b(' GCallback generic_callback,')
self.b(' gpointer user_data,')
@@ -802,12 +802,12 @@ class Generator(object):
member_lc)
self.b('static void')
- self.b('%s (TpProxy *self,' % reentrant_invoke)
+ self.b('%s (TpProxy *self G_GNUC_UNUSED,' % reentrant_invoke)
self.b(' GError *error,')
self.b(' GValueArray *args,')
- self.b(' GCallback unused,')
- self.b(' gpointer user_data,')
- self.b(' GObject *unused2)')
+ self.b(' GCallback unused G_GNUC_UNUSED,')
+ self.b(' gpointer user_data G_GNUC_UNUSED,')
+ self.b(' GObject *unused2 G_GNUC_UNUSED)')
self.b('{')
self.b(' _%s_%s_run_state_%s *state = user_data;'
% (self.prefix_lc, iface_lc, member_lc))
@@ -1027,17 +1027,18 @@ class Generator(object):
signals = node.getElementsByTagName('signal')
methods = node.getElementsByTagName('method')
- self.b('static inline void')
- self.b('%s_add_signals_for_%s (DBusGProxy *proxy)'
- % (self.prefix_lc, name.lower()))
- self.b('{')
+ if signals:
+ self.b('static inline void')
+ self.b('%s_add_signals_for_%s (DBusGProxy *proxy)'
+ % (self.prefix_lc, name.lower()))
+ self.b('{')
- for signal in signals:
- self.do_signal_add(signal)
+ for signal in signals:
+ self.do_signal_add(signal)
- self.b('}')
- self.b('')
- self.b('')
+ self.b('}')
+ self.b('')
+ self.b('')
for signal in signals:
self.do_signal(name, signal)
@@ -1081,17 +1082,20 @@ class Generator(object):
self.b(' * #TpProxy::interface-added.')
self.b(' */')
self.b('static void')
- self.b('%s_%s_add_signals (TpProxy *self,'
+ self.b('%s_%s_add_signals (TpProxy *self G_GNUC_UNUSED,'
% (self.prefix_lc, self.group))
self.b(' guint quark,')
self.b(' DBusGProxy *proxy,')
- self.b(' gpointer unused)')
+ self.b(' gpointer unused G_GNUC_UNUSED)')
self.b('{')
for node in nodes:
iface = node.getElementsByTagName('interface')[0]
self.iface_dbus = iface.getAttribute('name')
+ signals = node.getElementsByTagName('signal')
+ if not signals:
+ continue
name = node.getAttribute('name').replace('/', '').lower()
self.iface_uc = name.upper()
self.b(' if (quark == %s)' % self.get_iface_quark())