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/clangparser/clangparser.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/clangparser/clangparser.cpp')
| -rw-r--r-- | sources/shiboken6/ApiExtractor/clangparser/clangparser.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sources/shiboken6/ApiExtractor/clangparser/clangparser.cpp b/sources/shiboken6/ApiExtractor/clangparser/clangparser.cpp index 6c0cf3ae2..43334c306 100644 --- a/sources/shiboken6/ApiExtractor/clangparser/clangparser.cpp +++ b/sources/shiboken6/ApiExtractor/clangparser/clangparser.cpp @@ -127,10 +127,10 @@ std::string_view BaseVisitor::getCodeSnippet(const CXCursor &cursor) bool BaseVisitor::_handleVisitLocation(const CXSourceLocation &location) { - CXFile cxFile; // void * - unsigned line; - unsigned column; - unsigned offset; + CXFile cxFile{}; // void * + unsigned line{}; + unsigned column{}; + unsigned offset{}; clang_getExpansionLocation(location, &cxFile, &line, &column, &offset); if (cxFile == m_currentCxFile) // Same file? @@ -264,7 +264,7 @@ static CXTranslationUnit createTranslationUnit(CXIndex index, QScopedArrayPointer<const char *> argv(byteArrayListToFlatArgV(clangArgs)); qDebug().noquote().nospace() << msgCreateTranslationUnit(clangArgs, flags); - CXTranslationUnit tu; + CXTranslationUnit tu{}; CXErrorCode err = clang_parseTranslationUnit2(index, nullptr, argv.data(), clangArgs.size(), nullptr, 0, defaultFlags | flags, &tu); |
