summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-10-28 15:00:59 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2010-10-28 15:12:05 -0200
commit6de649a4f272bb98048602738af511d102cd5209 (patch)
treee1d02f743e078cc3f94458f4d133e3b6c6058094
parentaee6f385b5ffbed54df2e18ece072a7cc3281768 (diff)
downloadshiboken-6de649a4f272bb98048602738af511d102cd5209.tar.gz
shiboken-6de649a4f272bb98048602738af511d102cd5209.tar.xz
shiboken-6de649a4f272bb98048602738af511d102cd5209.zip
Uses a constant to define the cpp_arg variable, now called cppArg.
-rw-r--r--generator/cppgenerator.cpp8
-rw-r--r--generator/shibokengenerator.cpp4
-rw-r--r--generator/shibokengenerator.h2
3 files changed, 8 insertions, 6 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index 32ee06d8..77c75187 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -1738,7 +1738,7 @@ void CppGenerator::writeSingleFunctionCall(QTextStream& s, const OverloadData& o
argType = buildAbstractMetaTypeFromString(typeReplaced);
if (argType) {
- QString argName = QString("cpp_arg%1").arg(i - removedArgs);
+ QString argName = QString(CPP_ARG"%1").arg(i - removedArgs);
QString pyArgName = usePyArgs ? QString("pyargs[%1]").arg(i - removedArgs) : "arg";
QString defaultValue = guessScopeForDefaultValue(func, arg);
@@ -1930,7 +1930,7 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f
if (hasConversionRule) {
argName = arg->name() + "_out";
} else {
- argName = QString("cpp_arg%1").arg(idx);
+ argName = QString(CPP_ARG"%1").arg(idx);
}
userArgs << argName;
}
@@ -1980,7 +1980,7 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f
}
} else if (func->isOperatorOverload()) {
QString firstArg("(*" CPP_SELF_VAR ")");
- QString secondArg("cpp_arg0");
+ QString secondArg(CPP_ARG0);
if (!func->isUnaryOperator() && shouldDereferenceArgumentPointer(func->arguments().first())) {
secondArg.prepend('(');
secondArg.append(')');
@@ -2005,7 +2005,7 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f
QString className = wrapperName(func->ownerClass());
mc << "new " << className << '(';
if (func->isCopyConstructor() && maxArgs == 1) {
- mc << "cpp_arg0";
+ mc << CPP_ARG0;
} else {
mc << userArgs.join(", ");
}
diff --git a/generator/shibokengenerator.cpp b/generator/shibokengenerator.cpp
index aafa3c50..b93009e5 100644
--- a/generator/shibokengenerator.cpp
+++ b/generator/shibokengenerator.cpp
@@ -1208,7 +1208,7 @@ void ShibokenGenerator::writeCodeSnips(QTextStream& s,
if (arg->type()->typeEntry()->isCustom()) {
argReplacement = usePyArgs ? QString("pyargs[%1]").arg(i - removed) : "arg";
} else {
- argReplacement = QString("cpp_arg%1").arg(i - removed);
+ argReplacement = QString(CPP_ARG"%1").arg(i - removed);
}
}
} else {
@@ -1233,7 +1233,7 @@ void ShibokenGenerator::writeCodeSnips(QTextStream& s,
if (lastArg && arg->argumentIndex() > lastArg->argumentIndex()) {
argName = arg->defaultValueExpression();
} else {
- argName = QString("cpp_arg%1").arg(arg->argumentIndex() - removed);
+ argName = QString(CPP_ARG"%1").arg(arg->argumentIndex() - removed);
}
argumentNames << argName;
} else {
diff --git a/generator/shibokengenerator.h b/generator/shibokengenerator.h
index 1a7c5a63..7695d112 100644
--- a/generator/shibokengenerator.h
+++ b/generator/shibokengenerator.h
@@ -28,6 +28,8 @@
#define CPP_RETURN_VAR "cppResult"
#define THREAD_STATE_SAVER_VAR "threadStateSaver"
#define CPP_SELF_VAR "cppSelf"
+#define CPP_ARG "cppArg"
+#define CPP_ARG0 (CPP_ARG "0")
#include <generator.h>
#include <QtCore/QTextStream>