Skip to content

Commit ef06c8d

Browse files
committed
Coverity uninitialized
Fixing a number of uninitialized variables based on the coverity output of November 30, 2019
1 parent 9b14bf5 commit ef06c8d

21 files changed

+352
-352
lines changed

addon/doxmlparser/src/basehandler.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ template<class T> class ElementMapper
5757
void operator()(const QXmlAttributes &attrib)
5858
{ if (m_parent) (m_parent->*m_handler)(attrib); }
5959
private:
60-
T *m_parent;
60+
T *m_parent = 0;
6161
Handler m_handler;
6262
};
6363

@@ -71,7 +71,7 @@ template<class T> class ElementMapper
7171
void operator()()
7272
{ if (m_parent) (m_parent->*m_handler)(); }
7373
private:
74-
T *m_parent;
74+
T *m_parent = 0;
7575
Handler m_handler;
7676
};
7777

@@ -277,9 +277,9 @@ template<class T> class BaseHandler : public QXmlDefaultHandler,
277277
protected:
278278
QString m_curString;
279279
QString m_skipUntil;
280-
int m_skipCount;
281-
QXmlDefaultHandler *m_delegateHandler;
282-
IFallBackHandler *m_fallBackHandler;
280+
int m_skipCount = 0;
281+
QXmlDefaultHandler *m_delegateHandler = 0;
282+
IFallBackHandler *m_fallBackHandler = 0;
283283
};
284284

285285
//-----------------------------------------------------------------------------

addon/doxmlparser/src/compoundhandler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class CompoundIdIterator : public ICompoundIterator,
8686
{ delete this; }
8787

8888
private:
89-
const MainHandler *m_mainHandler;
89+
const MainHandler *m_mainHandler = 0;
9090
};
9191

9292
//----------------------------------------------------------------------------

addon/doxmlparser/src/compoundhandler.h

+20-20
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ class IncludeHandler : public IInclude, public BaseHandler<IncludeHandler>
5454
{ return m_isLocal; }
5555

5656
private:
57-
IBaseHandler *m_parent;
57+
IBaseHandler *m_parent = 0;
5858
StringImpl m_name; // element's content
5959
StringImpl m_refId; // refid
60-
bool m_isLocal; // local
60+
bool m_isLocal = false; // local
6161
};
6262

6363
class IncludeIterator : public BaseIterator<IIncludeIterator,IInclude,IncludeHandler>
@@ -86,10 +86,10 @@ class RelatedCompound : public IRelatedCompound
8686
virtual const IString *name() const { return &m_name; }
8787

8888
private:
89-
CompoundHandler *m_parent;
89+
CompoundHandler *m_parent = 0;
9090
QString m_id; // refid
91-
Protection m_protection; // prot
92-
Kind m_kind; // virt
91+
Protection m_protection = Public; // prot
92+
Kind m_kind = Normal; // virt
9393
StringImpl m_name; // element's content
9494
};
9595

@@ -193,42 +193,42 @@ class CompoundHandler : public IClass,
193193
// XML elements:
194194
// -------------
195195
StringImpl m_name; // compoundname
196-
TitleHandler* m_titleHandler; // title
196+
TitleHandler* m_titleHandler = 0; // title
197197
QList<RelatedCompound> m_subClasses; // basecompoundref
198198
QList<RelatedCompound> m_superClasses; // derivedcompoundref
199199
QList<IncludeHandler> m_includes; // includes
200200
QList<IncludeHandler> m_includedBy; // includedBy
201-
GraphHandler* m_includeDependencyGraph; // incdepgraph
202-
GraphHandler* m_includedByDependencyGraph; // invincdepgraph
201+
GraphHandler* m_includeDependencyGraph = 0;// incdepgraph
202+
GraphHandler* m_includedByDependencyGraph = 0; // invincdepgraph
203203
QList<QString> m_innerCompounds; // innerdir/innerfile/innerclass/innernamespace/innergroup
204204
TemplateParamListHandler* m_templateParamList; // templateparamlist
205205
QList<SectionHandler> m_sections; // sectiondef
206-
DocHandler* m_brief; // briefdescription
207-
DocHandler* m_detailed; // detaileddescription
208-
GraphHandler* m_inheritanceGraph; // inheritancegraph
209-
GraphHandler* m_collaborationGraph; // collaborationgraph
210-
ProgramListingHandler* m_programListing; // programlisting
206+
DocHandler* m_brief = 0; // briefdescription
207+
DocHandler* m_detailed = 0; // detaileddescription
208+
GraphHandler* m_inheritanceGraph = 0; // inheritancegraph
209+
GraphHandler* m_collaborationGraph = 0; // collaborationgraph
210+
ProgramListingHandler* m_programListing = 0; // programlisting
211211
// location
212212
StringImpl m_defFile; // - file
213-
int m_defLine; // - line
213+
int m_defLine = 0; // - line
214214
StringImpl m_defBodyFile; // - bodyfile
215-
int m_defBodyStart; // - bodystart
216-
int m_defBodyEnd; // - bodyend
217-
ListOfAllMembersHandler* m_members; // listofallmember
215+
int m_defBodyStart = 0; // - bodystart
216+
int m_defBodyEnd = 0; // - bodyend
217+
ListOfAllMembersHandler* m_members = 0; // listofallmember
218218

219219
// XML attributes:
220220
// ---------------
221221
StringImpl m_id; // id
222-
CompoundKind m_kind; // kind
222+
CompoundKind m_kind = Invalid; // kind
223223
StringImpl m_kindString; // kind as a string
224224
StringImpl m_protection; // prot
225225

226226
// local variables
227227
QString m_xmlDir; // directory where the info is found
228-
int m_refCount; // object reference counter
228+
int m_refCount = 0; // object reference counter
229229
QDict<MemberHandler> m_memberDict; // id->member lookup
230230
QDict<QList<MemberHandler> > m_memberNameDict; // name->memberlist lookup
231-
MainHandler* m_mainHandler; // parent object
231+
MainHandler* m_mainHandler = 0; // parent object
232232
};
233233

234234
void compoundhandler_init();

addon/doxmlparser/src/linkedtexthandler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class LT_Ref : public LinkedTextImpl, public ILT_Ref
5151
StringImpl m_refId;
5252
StringImpl m_extId;
5353
StringImpl m_text;
54-
TargetKind m_targetKind;
54+
TargetKind m_targetKind = TargetKind::Member;
5555
};
5656

5757
LinkedTextHandler::LinkedTextHandler(IBaseHandler *parent,

addon/doxywizard/wizard.h

+57-57
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ class TuneColorDialog : public QDialog
5050
void updateImage(int hue,int sat,int val);
5151

5252
private:
53-
QImage *m_image;
54-
QLabel *m_imageLab;
55-
int m_hue;
56-
int m_sat;
57-
int m_gam;
53+
QImage *m_image = 0;
54+
QLabel *m_imageLab = 0;
55+
int m_hue = 0;
56+
int m_sat = 0;
57+
int m_gam = 0;
5858
};
5959

6060
class ColorPicker : public QWidget
@@ -89,11 +89,11 @@ public slots:
8989
void setSat(int v);
9090
void setGam(int v);
9191

92-
QPixmap *m_pix;
93-
Mode m_mode;
94-
int m_gam;
95-
int m_hue;
96-
int m_sat;
92+
QPixmap *m_pix = 0;
93+
Mode m_mode = Hue;
94+
int m_gam = 0;
95+
int m_hue = 0;
96+
int m_sat = 0;
9797

9898
};
9999

@@ -118,16 +118,16 @@ class Step1 : public QWidget
118118
void setRecursiveScan(int);
119119

120120
private:
121-
QLineEdit *m_projName;
122-
QLineEdit *m_projBrief;
123-
QLineEdit *m_projNumber;
124-
QLineEdit *m_sourceDir;
125-
QLineEdit *m_destDir;
126-
QLabel *m_projIconLab;
127-
QCheckBox *m_recursive;
128-
QPushButton *m_srcSelectDir;
129-
QPushButton *m_dstSelectDir;
130-
Wizard *m_wizard;
121+
QLineEdit *m_projName = 0;
122+
QLineEdit *m_projBrief = 0;
123+
QLineEdit *m_projNumber = 0;
124+
QLineEdit *m_sourceDir = 0;
125+
QLineEdit *m_destDir = 0;
126+
QLabel *m_projIconLab = 0;
127+
QCheckBox *m_recursive = 0;
128+
QPushButton *m_srcSelectDir = 0;
129+
QPushButton *m_dstSelectDir = 0;
130+
Wizard *m_wizard = 0;
131131
const QHash<QString,Input *> &m_modelData;
132132
};
133133

@@ -144,12 +144,12 @@ class Step2 : public QWidget
144144
void changeCrossRefState(int choice);
145145

146146
private:
147-
QGroupBox *m_extractMode;
148-
QGroupBox *m_optimizeLang;
149-
QButtonGroup *m_extractModeGroup;
150-
QButtonGroup *m_optimizeLangGroup;
151-
QCheckBox *m_crossRef;
152-
Wizard *m_wizard;
147+
QGroupBox *m_extractMode = 0;
148+
QGroupBox *m_optimizeLang = 0;
149+
QButtonGroup *m_extractModeGroup = 0;
150+
QButtonGroup *m_optimizeLangGroup = 0;
151+
QCheckBox *m_crossRef = 0;
152+
Wizard *m_wizard = 0;
153153
const QHash<QString,Input *> &m_modelData;
154154
};
155155

@@ -173,18 +173,18 @@ class Step3 : public QWidget
173173
void tuneColorDialog();
174174

175175
private:
176-
QGroupBox *m_texOptions;
177-
QButtonGroup *m_texOptionsGroup;
178-
QGroupBox *m_htmlOptions;
179-
QButtonGroup *m_htmlOptionsGroup;
180-
QCheckBox *m_htmlEnabled;
181-
QCheckBox *m_latexEnabled;
182-
QCheckBox *m_manEnabled;
183-
QCheckBox *m_rtfEnabled;
184-
QCheckBox *m_xmlEnabled;
185-
QCheckBox *m_searchEnabled;
186-
QPushButton *m_tuneColor;
187-
Wizard *m_wizard;
176+
QGroupBox *m_texOptions = 0;
177+
QButtonGroup *m_texOptionsGroup = 0;
178+
QGroupBox *m_htmlOptions = 0;
179+
QButtonGroup *m_htmlOptionsGroup = 0;
180+
QCheckBox *m_htmlEnabled = 0;
181+
QCheckBox *m_latexEnabled = 0;
182+
QCheckBox *m_manEnabled = 0;
183+
QCheckBox *m_rtfEnabled = 0;
184+
QCheckBox *m_xmlEnabled = 0;
185+
QCheckBox *m_searchEnabled = 0;
186+
QPushButton *m_tuneColor = 0;
187+
Wizard *m_wizard = 0;
188188
const QHash<QString,Input *> &m_modelData;
189189
};
190190

@@ -207,17 +207,17 @@ class Step4 : public QWidget
207207
void setCallerGraphEnabled(int state);
208208

209209
private:
210-
QGroupBox *m_diagramMode;
211-
QButtonGroup *m_diagramModeGroup;
212-
QGroupBox *m_dotGroup;
213-
QCheckBox *m_dotClass;
214-
QCheckBox *m_dotCollaboration;
215-
QCheckBox *m_dotInclude;
216-
QCheckBox *m_dotIncludedBy;
217-
QCheckBox *m_dotInheritance;
218-
QCheckBox *m_dotCall;
219-
QCheckBox *m_dotCaller;
220-
Wizard *m_wizard;
210+
QGroupBox *m_diagramMode = 0;
211+
QButtonGroup *m_diagramModeGroup = 0;
212+
QGroupBox *m_dotGroup = 0;
213+
QCheckBox *m_dotClass = 0;
214+
QCheckBox *m_dotCollaboration = 0;
215+
QCheckBox *m_dotInclude = 0;
216+
QCheckBox *m_dotIncludedBy = 0;
217+
QCheckBox *m_dotInheritance = 0;
218+
QCheckBox *m_dotCall = 0;
219+
QCheckBox *m_dotCaller = 0;
220+
Wizard *m_wizard = 0;
221221
const QHash<QString,Input *> &m_modelData;
222222
};
223223

@@ -241,14 +241,14 @@ class Wizard : public QSplitter
241241

242242
private:
243243
const QHash<QString,Input *> &m_modelData;
244-
QTreeWidget *m_treeWidget;
245-
QStackedWidget *m_topicStack;
246-
Step1 *m_step1;
247-
Step2 *m_step2;
248-
Step3 *m_step3;
249-
Step4 *m_step4;
250-
QPushButton *m_next;
251-
QPushButton *m_prev;
244+
QTreeWidget *m_treeWidget = 0;
245+
QStackedWidget *m_topicStack = 0;
246+
Step1 *m_step1 = 0;
247+
Step2 *m_step2 = 0;
248+
Step3 *m_step3 = 0;
249+
Step4 *m_step4 = 0;
250+
QPushButton *m_next = 0;
251+
QPushButton *m_prev = 0;
252252
};
253253

254254
#endif

0 commit comments

Comments
 (0)