aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppeditor/cppfunctiondecldeflink.h
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2017-06-01 13:32:23 +0200
committerNikolai Kosjar <nikolai.kosjar@qt.io>2017-06-01 13:33:21 +0000
commit39dea0979463fa834d99b76c6d286c0cb045f4d3 (patch)
tree922b7138accebdd5df533f61c730cfb0aa0adea3 /src/plugins/cppeditor/cppfunctiondecldeflink.h
parenta3a62e78f7378182138555936b45a885865c00ad (diff)
CppEditor: Fix uninitialized value warnings
...from coverity scan. Change-Id: I1b1fb919e77f1407fe2e4319392c28413a296493 Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Diffstat (limited to 'src/plugins/cppeditor/cppfunctiondecldeflink.h')
-rw-r--r--src/plugins/cppeditor/cppfunctiondecldeflink.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/plugins/cppeditor/cppfunctiondecldeflink.h b/src/plugins/cppeditor/cppfunctiondecldeflink.h
index 888e2035eb..0698521bcd 100644
--- a/src/plugins/cppeditor/cppfunctiondecldeflink.h
+++ b/src/plugins/cppeditor/cppfunctiondecldeflink.h
@@ -68,6 +68,7 @@ class FunctionDeclDefLink
{
Q_DECLARE_TR_FUNCTIONS(CppEditor::Internal::FunctionDeclDefLink)
Q_DISABLE_COPY(FunctionDeclDefLink)
+ FunctionDeclDefLink() = default;
public:
class Marker {};
@@ -88,26 +89,24 @@ public:
// The 'source' prefix denotes information about the original state
// of the function before the user did any edits.
CPlusPlus::Document::Ptr sourceDocument;
- CPlusPlus::Function *sourceFunction;
- CPlusPlus::DeclarationAST *sourceDeclaration;
- CPlusPlus::FunctionDeclaratorAST *sourceFunctionDeclarator;
+ CPlusPlus::Function *sourceFunction = nullptr;
+ CPlusPlus::DeclarationAST *sourceDeclaration = nullptr;
+ CPlusPlus::FunctionDeclaratorAST *sourceFunctionDeclarator = nullptr;
// The 'target' prefix denotes information about the remote declaration matching
// the 'source' declaration, where we will try to apply the user changes.
// 1-based line and column
- unsigned targetLine;
- unsigned targetColumn;
+ unsigned targetLine = 0;
+ unsigned targetColumn = 0;
QString targetInitial;
CppTools::CppRefactoringFileConstPtr targetFile;
- CPlusPlus::Function *targetFunction;
- CPlusPlus::DeclarationAST *targetDeclaration;
- CPlusPlus::FunctionDeclaratorAST *targetFunctionDeclarator;
+ CPlusPlus::Function *targetFunction = nullptr;
+ CPlusPlus::DeclarationAST *targetDeclaration = nullptr;
+ CPlusPlus::FunctionDeclaratorAST *targetFunctionDeclarator = nullptr;
private:
- FunctionDeclDefLink();
-
- bool hasMarker;
+ bool hasMarker = false;
friend class FunctionDeclDefLinkFinder;
};