Skip to content

Commit 6b70d80

Browse files
committed
Fixing warnings like: Use the "nullptr" literal
Fixing sonar cloud warnings like: `Use the "nullptr" literal`
1 parent d1594b9 commit 6b70d80

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+816
-816
lines changed

addon/doxywizard/adapter.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ class TextCodecAdapter
3232
TextCodecAdapter(const QByteArray &name)
3333
{
3434
m_codec = QTextCodec::codecForName(name);
35-
if (m_codec==0) // fallback: use UTF-8
35+
if (m_codec==nullptr) // fallback: use UTF-8
3636
{
3737
m_codec = QTextCodec::codecForName("UTF-8");
3838
}
3939
}
4040
QByteArray encode(const QString &input) { return m_codec ? m_codec->fromUnicode(input) : input.toLatin1(); }
4141
QString decode(const QByteArray &input) { return m_codec ? m_codec->toUnicode(input) : QString::fromLatin1(input); }
4242
void applyToStream(QTextStream &t) { t.setCodec(m_codec); }
43-
bool isValid() const { return m_codec!=0; }
43+
bool isValid() const { return m_codec!=nullptr; }
4444
private:
45-
QTextCodec *m_codec = 0; // object is owned by Qt
45+
QTextCodec *m_codec = nullptr; // object is owned by Qt
4646
};
4747
#else // Qt6+
4848
#include <QStringEncoder>

addon/doxywizard/config_doxyw.l

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,20 @@ struct ConfigFileState
5858
QString fileName;
5959
};
6060

61-
static const QHash<QString,Input*> *g_options;
62-
static FILE *g_file;
61+
static const QHash<QString,Input*> *g_options=nullptr;
62+
static FILE *g_file=nullptr;
6363
static QString g_yyFileName;
6464
static QString g_includeName;
6565
static QVariant g_includePathList;
6666
static QStack<ConfigFileState*> g_includeStack;
67-
static int g_includeDepth;
68-
static QVariant *g_arg;
69-
static Input *g_curOption=0;
67+
static int g_includeDepth=0;
68+
static QVariant *g_arg=nullptr;
69+
static Input *g_curOption=nullptr;
7070
static QByteArray g_str;
7171
static std::unique_ptr<TextCodecAdapter> g_codec = std::make_unique<TextCodecAdapter>("UTF-8");
7272
static QString g_codecName = QString::fromLatin1("UTF-8");
7373
static QString g_cmd;
74-
static bool g_isEnum;
74+
static bool g_isEnum=false;
7575

7676
static const char *stateToString(int state);
7777

@@ -405,7 +405,7 @@ static const char *stateToString(int state);
405405
g_cmd = g_codec->decode(yytext);
406406
g_cmd=g_cmd.left(g_cmd.length()-1).trimmed();
407407
g_curOption = g_options->value(g_cmd);
408-
if (g_curOption==0) // oops not known
408+
if (g_curOption==nullptr) // oops not known
409409
{
410410
config_warn("ignoring unsupported tag '%s' at line %d, file %s\n",
411411
qPrintable(g_cmd),yylineno,qPrintable(g_yyFileName));
@@ -464,7 +464,7 @@ static const char *stateToString(int state);
464464
g_cmd=g_codec->decode(yytext);
465465
g_cmd=g_cmd.left(g_cmd.length()-2).trimmed();
466466
g_curOption = g_options->value(g_cmd);
467-
if (g_curOption==0) // oops not known
467+
if (g_curOption==nullptr) // oops not known
468468
{
469469
config_warn("ignoring unsupported tag '%s' at line %d, file %s\n",
470470
yytext,yylineno,qPrintable(g_yyFileName));
@@ -741,7 +741,7 @@ bool parseConfig(
741741
config_open();
742742
QHashIterator<QString, Input*> i(options);
743743
g_file = fopen(fileName.toLocal8Bit(),"r");
744-
if (g_file==NULL) return false;
744+
if (g_file==nullptr) return false;
745745

746746
// reset all values
747747
i.toFront();

addon/doxywizard/wizard.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,31 +118,31 @@ static bool getBoolOption(
118118
const QHash<QString,Input*>&model,const QString &name)
119119
{
120120
Input *option = model[name];
121-
Q_ASSERT(option!=0);
121+
Q_ASSERT(option!=nullptr);
122122
return stringVariantToBool(option->value());
123123
}
124124

125125
static int getIntOption(
126126
const QHash<QString,Input*>&model,const QString &name)
127127
{
128128
Input *option = model[name];
129-
Q_ASSERT(option!=0);
129+
Q_ASSERT(option!=nullptr);
130130
return option->value().toInt();
131131
}
132132

133133
static QString getStringOption(
134134
const QHash<QString,Input*>&model,const QString &name)
135135
{
136136
Input *option = model[name];
137-
Q_ASSERT(option!=0);
137+
Q_ASSERT(option!=nullptr);
138138
return option->value().toString();
139139
}
140140

141141
static void updateBoolOption(
142142
const QHash<QString,Input*>&model,const QString &name,bool bNew)
143143
{
144144
Input *option = model[name];
145-
Q_ASSERT(option!=0);
145+
Q_ASSERT(option!=nullptr);
146146
bool bOld = stringVariantToBool(option->value());
147147
if (bOld!=bNew)
148148
{
@@ -155,7 +155,7 @@ static void updateIntOption(
155155
const QHash<QString,Input*>&model,const QString &name,int iNew)
156156
{
157157
Input *option = model[name];
158-
Q_ASSERT(option!=0);
158+
Q_ASSERT(option!=nullptr);
159159
int iOld = option->value().toInt();
160160
if (iOld!=iNew)
161161
{
@@ -169,7 +169,7 @@ static void updateStringOption(
169169
const QHash<QString,Input*>&model,const QString &name,const QString &s)
170170
{
171171
Input *option = model[name];
172-
Q_ASSERT(option!=0);
172+
Q_ASSERT(option!=nullptr);
173173
if (option->value().toString()!=s)
174174
{
175175
option->value() = s;
@@ -333,7 +333,7 @@ ColorPicker::ColorPicker(Mode m)
333333
m_gam = 100;
334334
m_sat = 100;
335335
m_mode = m;
336-
m_pix = 0;
336+
m_pix = nullptr;
337337
}
338338

339339
ColorPicker::~ColorPicker()
@@ -403,7 +403,7 @@ void ColorPicker::setHue(int h)
403403
{
404404
if (h==m_hue) return;
405405
m_hue = qMax(0,qMin(h,359));
406-
delete m_pix; m_pix=0;
406+
delete m_pix; m_pix=nullptr;
407407
repaint();
408408
emit newHsv(m_hue,m_sat,m_gam);
409409
}
@@ -412,7 +412,7 @@ void ColorPicker::setSat(int s)
412412
{
413413
if (s==m_sat) return;
414414
m_sat = qMax(0,qMin(s,255));
415-
delete m_pix; m_pix=0;
415+
delete m_pix; m_pix=nullptr;
416416
repaint();
417417
emit newHsv(m_hue,m_sat,m_gam);
418418
}
@@ -421,7 +421,7 @@ void ColorPicker::setGam(int g)
421421
{
422422
if (g==m_gam) return;
423423
m_gam = qMax(40,qMin(g,240));
424-
delete m_pix; m_pix=0;
424+
delete m_pix; m_pix=nullptr;
425425
repaint();
426426
emit newHsv(m_hue,m_sat,m_gam);
427427
}
@@ -433,7 +433,7 @@ void ColorPicker::setCol(int h, int s, int g)
433433
m_hue = h;
434434
m_sat = s;
435435
m_gam = g;
436-
delete m_pix; m_pix=0;
436+
delete m_pix; m_pix=nullptr;
437437
repaint();
438438
}
439439
}
@@ -919,8 +919,8 @@ void Step2::init()
919919
Step3::Step3(Wizard *wizard,const QHash<QString,Input*> &modelData)
920920
: m_wizard(wizard), m_modelData(modelData)
921921
{
922-
QVBoxLayout *vbox = 0;
923-
QRadioButton *r = 0;
922+
QVBoxLayout *vbox = nullptr;
923+
QRadioButton *r = nullptr;
924924

925925
QGridLayout *gbox = new QGridLayout( this );
926926
gbox->addWidget(new QLabel(tr("Select the output format(s) to generate")),0,0);

addon/doxywizard/wizard.h

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class TuneColorDialog : public QDialog
3636
Q_OBJECT
3737

3838
public:
39-
TuneColorDialog(int hue,int sat,int gamma,QWidget *parent=0);
39+
TuneColorDialog(int hue,int sat,int gamma,QWidget *parent=nullptr);
4040
int getHue() const;
4141
int getSaturation() const;
4242
int getGamma() const;
@@ -45,8 +45,8 @@ class TuneColorDialog : public QDialog
4545
void updateImage(int hue,int sat,int val);
4646

4747
private:
48-
QImage *m_image = 0;
49-
QLabel *m_imageLab = 0;
48+
QImage *m_image = nullptr;
49+
QLabel *m_imageLab = nullptr;
5050
int m_hue = 0;
5151
int m_sat = 0;
5252
int m_gam = 0;
@@ -84,7 +84,7 @@ public slots:
8484
void setSat(int v);
8585
void setGam(int v);
8686

87-
QPixmap *m_pix = 0;
87+
QPixmap *m_pix = nullptr;
8888
Mode m_mode = Hue;
8989
int m_gam = 0;
9090
int m_hue = 0;
@@ -113,16 +113,16 @@ class Step1 : public QWidget
113113
void setRecursiveScan(int);
114114

115115
private:
116-
QLineEdit *m_projName = 0;
117-
QLineEdit *m_projBrief = 0;
118-
QLineEdit *m_projNumber = 0;
119-
QLineEdit *m_sourceDir = 0;
120-
QLineEdit *m_destDir = 0;
121-
QLabel *m_projIconLab = 0;
122-
QCheckBox *m_recursive = 0;
123-
QPushButton *m_srcSelectDir = 0;
124-
QPushButton *m_dstSelectDir = 0;
125-
Wizard *m_wizard = 0;
116+
QLineEdit *m_projName = nullptr;
117+
QLineEdit *m_projBrief = nullptr;
118+
QLineEdit *m_projNumber = nullptr;
119+
QLineEdit *m_sourceDir = nullptr;
120+
QLineEdit *m_destDir = nullptr;
121+
QLabel *m_projIconLab = nullptr;
122+
QCheckBox *m_recursive = nullptr;
123+
QPushButton *m_srcSelectDir = nullptr;
124+
QPushButton *m_dstSelectDir = nullptr;
125+
Wizard *m_wizard = nullptr;
126126
const QHash<QString,Input *> &m_modelData;
127127
};
128128

@@ -139,12 +139,12 @@ class Step2 : public QWidget
139139
void changeCrossRefState(int choice);
140140

141141
private:
142-
QGroupBox *m_extractMode = 0;
143-
QGroupBox *m_optimizeLang = 0;
144-
QButtonGroup *m_extractModeGroup = 0;
145-
QButtonGroup *m_optimizeLangGroup = 0;
146-
QCheckBox *m_crossRef = 0;
147-
Wizard *m_wizard = 0;
142+
QGroupBox *m_extractMode = nullptr;
143+
QGroupBox *m_optimizeLang = nullptr;
144+
QButtonGroup *m_extractModeGroup = nullptr;
145+
QButtonGroup *m_optimizeLangGroup = nullptr;
146+
QCheckBox *m_crossRef = nullptr;
147+
Wizard *m_wizard = nullptr;
148148
const QHash<QString,Input *> &m_modelData;
149149
};
150150

@@ -169,19 +169,19 @@ class Step3 : public QWidget
169169
void tuneColorDialog();
170170

171171
private:
172-
QGroupBox *m_texOptions = 0;
173-
QButtonGroup *m_texOptionsGroup = 0;
174-
QGroupBox *m_htmlOptions = 0;
175-
QButtonGroup *m_htmlOptionsGroup = 0;
176-
QCheckBox *m_htmlEnabled = 0;
177-
QCheckBox *m_latexEnabled = 0;
178-
QCheckBox *m_manEnabled = 0;
179-
QCheckBox *m_rtfEnabled = 0;
180-
QCheckBox *m_xmlEnabled = 0;
181-
QCheckBox *m_docbookEnabled = 0;
182-
QCheckBox *m_searchEnabled = 0;
183-
QPushButton *m_tuneColor = 0;
184-
Wizard *m_wizard = 0;
172+
QGroupBox *m_texOptions = nullptr;
173+
QButtonGroup *m_texOptionsGroup = nullptr;
174+
QGroupBox *m_htmlOptions = nullptr;
175+
QButtonGroup *m_htmlOptionsGroup = nullptr;
176+
QCheckBox *m_htmlEnabled = nullptr;
177+
QCheckBox *m_latexEnabled = nullptr;
178+
QCheckBox *m_manEnabled = nullptr;
179+
QCheckBox *m_rtfEnabled = nullptr;
180+
QCheckBox *m_xmlEnabled = nullptr;
181+
QCheckBox *m_docbookEnabled = nullptr;
182+
QCheckBox *m_searchEnabled = nullptr;
183+
QPushButton *m_tuneColor = nullptr;
184+
Wizard *m_wizard = nullptr;
185185
const QHash<QString,Input *> &m_modelData;
186186
};
187187

@@ -204,25 +204,25 @@ class Step4 : public QWidget
204204
void setCallerGraphEnabled(int state);
205205

206206
private:
207-
QGroupBox *m_diagramMode = 0;
208-
QButtonGroup *m_diagramModeGroup = 0;
209-
QGroupBox *m_dotGroup = 0;
210-
QCheckBox *m_dotClass = 0;
211-
QCheckBox *m_dotCollaboration = 0;
212-
QCheckBox *m_dotInclude = 0;
213-
QCheckBox *m_dotIncludedBy = 0;
214-
QCheckBox *m_dotInheritance = 0;
215-
QCheckBox *m_dotCall = 0;
216-
QCheckBox *m_dotCaller = 0;
217-
Wizard *m_wizard = 0;
207+
QGroupBox *m_diagramMode = nullptr;
208+
QButtonGroup *m_diagramModeGroup = nullptr;
209+
QGroupBox *m_dotGroup = nullptr;
210+
QCheckBox *m_dotClass = nullptr;
211+
QCheckBox *m_dotCollaboration = nullptr;
212+
QCheckBox *m_dotInclude = nullptr;
213+
QCheckBox *m_dotIncludedBy = nullptr;
214+
QCheckBox *m_dotInheritance = nullptr;
215+
QCheckBox *m_dotCall = nullptr;
216+
QCheckBox *m_dotCaller = nullptr;
217+
Wizard *m_wizard = nullptr;
218218
const QHash<QString,Input *> &m_modelData;
219219
};
220220

221221
class Wizard : public QSplitter
222222
{
223223
Q_OBJECT
224224
public:
225-
Wizard(const QHash<QString,Input*> &modelData, QWidget *parent=0);
225+
Wizard(const QHash<QString,Input*> &modelData, QWidget *parent=nullptr);
226226
~Wizard();
227227

228228
public slots:
@@ -238,14 +238,14 @@ class Wizard : public QSplitter
238238

239239
private:
240240
const QHash<QString,Input *> &m_modelData;
241-
QTreeWidget *m_treeWidget = 0;
242-
QStackedWidget *m_topicStack = 0;
243-
Step1 *m_step1 = 0;
244-
Step2 *m_step2 = 0;
245-
Step3 *m_step3 = 0;
246-
Step4 *m_step4 = 0;
247-
QPushButton *m_next = 0;
248-
QPushButton *m_prev = 0;
241+
QTreeWidget *m_treeWidget = nullptr;
242+
QStackedWidget *m_topicStack = nullptr;
243+
Step1 *m_step1 = nullptr;
244+
Step2 *m_step2 = nullptr;
245+
Step3 *m_step3 = nullptr;
246+
Step4 *m_step4 = nullptr;
247+
QPushButton *m_next = nullptr;
248+
QPushButton *m_prev = nullptr;
249249
};
250250

251251
#endif

libxml/xml.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ struct xmlYY_state
4040
{
4141
std::string fileName;
4242
int lineNr = 1;
43-
const char * inputString = 0; //!< the code fragment as text
44-
int inputPosition = 0; //!< read offset during parsing
43+
const char * inputString = nullptr; //!< the code fragment as text
44+
int inputPosition = 0; //!< read offset during parsing
4545
std::string name;
4646
bool isEnd = false;
4747
bool selfClose = false;

0 commit comments

Comments
 (0)