aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-09-29 10:32:50 +0200
committerChristian Tismer <tismer@stackless.com>2017-09-29 08:38:05 +0000
commit9f74476af5c45ac562fb95bf47c06ee8ef3d2c78 (patch)
tree4f5bf1c4cbef5d5ed1ff8226bb15ec34983b8dfe
parente062958e59129bb4cdfa2056f8023b1ba4dc9670 (diff)
Signature: Remove pre 5.7 parts, fix coding style
Complements 30a1c9c41e5e6d4166f171b9477c6f46cafa782f. Task-number: PYSIDE-510 Change-Id: I76e433dc35dbe88dbf254b19b82b8c392af0dad4 Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.cpp19
-rw-r--r--sources/shiboken2/libshiboken/signature.cpp2
2 files changed, 5 insertions, 16 deletions
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
index 12212849..f8dc430c 100644
--- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
@@ -4420,18 +4420,10 @@ void CppGenerator::writeSignatureInfo(QTextStream &s, const AbstractMetaFunction
int idx = overloads.length() - 1;
bool multiple = idx > 0;
-// after merging, the #if may be removed!
-#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
for (const AbstractMetaFunction *f : overloads) {
QStringList args;
const AbstractMetaArgumentList &arguments = f->arguments();
- for (AbstractMetaArgument *arg : arguments) {
-#else
- foreach (const AbstractMetaFunction *f, overloads) {
- QStringList args;
- const AbstractMetaArgumentList &arguments = f->arguments();
- foreach (const AbstractMetaArgument *arg, arguments) {
-#endif
+ for (const AbstractMetaArgument *arg : arguments) {
QString strArg = resolveRetOrArgType(arg->type());
if (!arg->defaultValueExpression().isEmpty()) {
strArg += QLatin1Char('=');
@@ -4449,9 +4441,8 @@ void CppGenerator::writeSignatureInfo(QTextStream &s, const AbstractMetaFunction
// now calculate the return type.
s << funcName << '(' << args.join(QLatin1Char(',')) << ')';
AbstractMetaType *returnType = getTypeWithoutContainer(f->type());
- if (returnType) {
+ if (returnType)
s << "->" << resolveRetOrArgType(returnType);
- }
s << endl;
}
}
@@ -4778,9 +4769,8 @@ void CppGenerator::writeClassRegister(QTextStream &s,
s << "// Multiple signatures have their index \"n:\" in front." << endl;
s << "const char " << initFunctionName << "_SignaturesString[] = \"\"" << endl;
QString line;
- while (signatureStream.readLineInto(&line)) {
+ while (signatureStream.readLineInto(&line))
s << INDENT << '"' << line << "\\n\"" << endl;
- }
s << ';' << endl << endl;
s << "void init_" << initFunctionName;
s << "(PyObject* " << enclosingObjectVariable << ")" << endl;
@@ -5649,9 +5639,8 @@ bool CppGenerator::finishGeneration()
s << "// Multiple signatures have their index \"n:\" in front." << endl;
s << "const char " << moduleName() << "_SignaturesString[] = \"\"" << endl;
QString line;
- while (signatureStream.readLineInto(&line)) {
+ while (signatureStream.readLineInto(&line))
s << INDENT << '"' << line << "\\n\"" << endl;
- }
s << ';' << endl;
// finish the rest of __signature__ initialization.
s << INDENT << "FinishSignatureInitialization(module, " << moduleName()
diff --git a/sources/shiboken2/libshiboken/signature.cpp b/sources/shiboken2/libshiboken/signature.cpp
index 883ef739..e6d64c16 100644
--- a/sources/shiboken2/libshiboken/signature.cpp
+++ b/sources/shiboken2/libshiboken/signature.cpp
@@ -308,7 +308,7 @@ GetSignature_TypeMod(PyObject *ob)
}
-const char *PySide_PythonCode = (const char *)
+static const char PySide_PythonCode[] =
"from __future__ import print_function, absolute_import\n"
"import sys, os, traceback\n"