diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-06-17 17:31:23 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-06-24 10:36:07 +0200 |
| commit | 8f85650fe8066c5903e865aedb3d92d863243996 (patch) | |
| tree | efdef02a00572d16a46f5309fc30b7ce0408bea7 /sources/shiboken6/ApiExtractor/addedfunction.cpp | |
| parent | 12e370d38ab0f88c6ae555793ed5ac6a18343255 (diff) | |
shiboken6: Fix static analysis warnings
- Initialize variables
- Use auto *
- Use const references to prevent copies
- Remove const from function returns
- Remove repeated return types
- Fix else after return/throw
- Make functions const/static where appropriate
- Add missing override
- Fix some invocations of static methods
- Fix some int types (qsizetype) to avoid lossy conversions
- Minor cleanups
- Remove some macros
Change-Id: I414b8451703b136f135383289de49e743e84fb3a
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/addedfunction.cpp')
| -rw-r--r-- | sources/shiboken6/ApiExtractor/addedfunction.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sources/shiboken6/ApiExtractor/addedfunction.cpp b/sources/shiboken6/ApiExtractor/addedfunction.cpp index 9d95b734c..ac2ca5f34 100644 --- a/sources/shiboken6/ApiExtractor/addedfunction.cpp +++ b/sources/shiboken6/ApiExtractor/addedfunction.cpp @@ -84,7 +84,7 @@ Arguments splitParameters(QStringView paramString, QString *errorMessage) // Check defaultValue, "int @b@=5" const auto equalPos = t.lastIndexOf(u'='); if (equalPos != -1) { - const int defaultValuePos = equalPos + 1; + const auto defaultValuePos = equalPos + 1; argument.defaultValue = t.mid(defaultValuePos, t.size() - defaultValuePos).trimmed().toString(); } @@ -92,8 +92,8 @@ Arguments splitParameters(QStringView paramString, QString *errorMessage) // Check @name@ const auto atPos = typeString.indexOf(u'@'); if (atPos != -1) { - const int namePos = atPos + 1; - const int nameEndPos = typeString.indexOf(u'@', namePos); + const auto namePos = atPos + 1; + const auto nameEndPos = typeString.indexOf(u'@', namePos); if (nameEndPos == -1) { if (errorMessage != nullptr) { *errorMessage = u"Mismatched @ in \""_s @@ -142,8 +142,8 @@ AddedFunction::AddedFunctionPtr ? callOperator.size() : 0; const auto openParenPos = signature.indexOf(u'(', parenSearchStartPos); if (openParenPos < 0) { - return AddedFunctionPtr(new AddedFunction(signature.toString(), - arguments, returnType)); + return std::make_shared<AddedFunction>(signature.toString(), + arguments, returnType); } const QString name = signature.left(openParenPos).trimmed().toString(); |
