Remove warnings from generated adaptors.
This patch modifies the dbusxx-xml2cpp's generate_adaptor function so that it prevents generation of the MessageIter ri in cases where an interface method has no input arguments. By making this element conditional based on the presence of input arguments we avoid "unused-but-set-variable" warning in code that uses the DBus-C++ adaptor glue headers. Change-Id: I0f04439bf7b2b3cecb9d639e61c2b6dedc148e51 Type: Code Improvement
This commit is contained in:
parent
63edf7777f
commit
63c7175250
1 changed files with 6 additions and 3 deletions
|
@ -485,9 +485,12 @@ void generate_adaptor(Xml::Document &doc, const char *filename)
|
||||||
Xml::Nodes args_out = args.select("direction", "out");
|
Xml::Nodes args_out = args.select("direction", "out");
|
||||||
|
|
||||||
body << tab << "::DBus::Message " << stub_name(method.get("name")) << "(const ::DBus::CallMessage &call)" << endl
|
body << tab << "::DBus::Message " << stub_name(method.get("name")) << "(const ::DBus::CallMessage &call)" << endl
|
||||||
<< tab << "{" << endl
|
<< tab << "{" << endl;
|
||||||
<< tab << tab << "::DBus::MessageIter ri = call.reader();" << endl
|
if(!args_in.empty())
|
||||||
<< endl;
|
{
|
||||||
|
body << tab << tab << "::DBus::MessageIter ri = call.reader();" << endl;
|
||||||
|
body << endl;
|
||||||
|
}
|
||||||
|
|
||||||
// generate the 'in' variables
|
// generate the 'in' variables
|
||||||
unsigned int i = 1;
|
unsigned int i = 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue