From: Thomas Jarosch Date: Thu, 8 Mar 2007 10:57:15 +0000 (+0000) Subject: libt2n, info_mqueue_ui: (tomj) fix generated code for functions without return type... X-Git-Tag: v0.3~2 X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=commitdiff_plain;h=9c627fabb9df8ed74cdfa83f83cb7bd996ee1004 libt2n, info_mqueue_ui: (tomj) fix generated code for functions without return type but with arguments --- diff --git a/codegen/main.cpp b/codegen/main.cpp index cd483b6..c7f5b2c 100644 --- a/codegen/main.cpp +++ b/codegen/main.cpp @@ -486,19 +486,25 @@ void output_server_cpp(std::ostream &o, const std::string &group, const std::lis for (std::list::const_iterator it=procs.begin();it!=procs.end();++it) { o << *it << ";\n"; o << "libt2n::result* " << it->cmd_classname() << "::operator()() { "; - if (it->hasReturn()) { - o << "return new " << it->ret_classname() << "(" << it->name << "("; - for (t2n_procedure::Args::const_iterator ait=it->args.begin();ait!=it->args.end();++ait) { - if (ait!=it->args.begin()) o << ", "; - // get pointer - if (ait->second.name.find_first_of('*')!=std::string::npos) - o << '&'; - o << ait->first; - } - o << "));"; - }else{ - o << it->name << "(); return new " << it->ret_classname() << "();"; + + if (it->hasReturn()) + o << "return new " << it->ret_classname() << "("; + + // output function name and args + o << it->name << "("; + for (t2n_procedure::Args::const_iterator ait=it->args.begin();ait!=it->args.end();++ait) { + if (ait!=it->args.begin()) o << ", "; + // get pointer + if (ait->second.name.find_first_of('*')!=std::string::npos) + o << '&'; + o << ait->first; } + + if (it->hasReturn()) + o << "));"; + else + o << "); return new " << it->ret_classname() << "();"; + o << " }\n"; } o << "#include \"" << common_cpp << "\"\n"; diff --git a/configure.in b/configure.in index eeb1172..c293a10 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ AC_INIT(configure.in) AM_CONFIG_HEADER(config.h) dnl AC_CONFIG_HEADERS([config.h:config.h.in]) -AM_INIT_AUTOMAKE(libt2n, 0.2) +AM_INIT_AUTOMAKE(libt2n, 0.3) AC_DEFINE(PROTOCOL_VERSION, 1, [protocol version used (integers, increase version if incompatible)])