| commit | fab674162cad142777adad18d2be14fe12be9cc2 | [log] [tgz] |
|---|---|---|
| author | Elly Jones <[email protected]> | Thu May 12 20:09:05 2011 |
| committer | Elly Jones <[email protected]> | Thu May 12 20:21:52 2011 |
| tree | d423300a54db3c62e30cf12ac116bb714afbd745 | |
| parent | a40d85989ce82e7cf9bff815770294adc3db3532 [diff] |
dbusxx-xml2cpp: Only generate argument reader if there are arguments. This shuts gcc-4.6 up about a variable being written to but not used. See http://code.google.com/p/chromium-os/issues/detail?id=15109 for an example. BUG=chromium-os:15109 TEST=Adhoc Built, built cromo, built gobi-cromo-plugin. Change-Id: I0ad5185b4f5a91b9ea7c4d5fdcfb10debcbac66b Signed-off-by: Elly Jones <[email protected]> Reviewed-on: http://gerrit.chromium.org/gerrit/789 Reviewed-by: Jason Glasgow <[email protected]>
diff --git a/tools/generate_adaptor.cpp b/tools/generate_adaptor.cpp index a179ba8..ebae98f 100644 --- a/tools/generate_adaptor.cpp +++ b/tools/generate_adaptor.cpp
@@ -408,9 +408,11 @@ body << tab << "::DBus::Message " << stub_name(method.get("name")) << "(const ::DBus::CallMessage &call)" << endl - << tab << "{" << endl - << tab << tab << "::DBus::MessageIter ri = call.reader();" << endl - << endl; + << tab << "{" << endl; + + if (args_in.size() > 0) + body << tab << tab << "::DBus::MessageIter ri = call.reader();" << endl + << endl; body << tab << tab << "::DBus::Error error;" << endl; // generate the 'in' variables