diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-12-28 16:51:08 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-12-28 16:51:08 -0300 |
commit | 731a68999274ab58fb35f3d3238f713fbf91c878 (patch) | |
tree | a6ceccd4e61199b2a2e7f45029ffe33686632620 /shibokengenerator.cpp | |
parent | e489074ccb5bf5b98564d9752907a5657506f4e4 (diff) |
Modifies ShibokenGenerator::writeCodeSnips semantics.
A NULL pointer in the "lastArg" parameter of writeCodeSnips means that
the function being processed will be called without arguments. The
behavior prior to this change was that a NULL lastArg indicates that
all arguments are to be used.
Diffstat (limited to 'shibokengenerator.cpp')
-rw-r--r-- | shibokengenerator.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/shibokengenerator.cpp b/shibokengenerator.cpp index d8b4aefb2..933aca5fa 100644 --- a/shibokengenerator.cpp +++ b/shibokengenerator.cpp @@ -930,14 +930,13 @@ void ShibokenGenerator::writeCodeSnips(QTextStream& s, const AbstractMetaArgument* arg = func->arguments().at(i); QString argReplacement; if (snip.language == TypeSystem::TargetLangCode) { - if (func->argumentRemoved(i+1)) { + if (!lastArg || func->argumentRemoved(i+1)) { if (!arg->defaultValueExpression().isEmpty()) argReplacement = arg->defaultValueExpression(); removed++; - } - - if (lastArg && arg->argumentIndex() > lastArg->argumentIndex()) + } else if (lastArg && (arg->argumentIndex() > lastArg->argumentIndex())) { argReplacement = arg->defaultValueExpression(); + } if (argReplacement.isEmpty()) { argReplacement = QString("cpp_arg%1").arg(i - removed); |