Skip to content

Commit 220d886

Browse files
authored
Merge pull request doxygen#12216 from albert-github/feature/bug_void
Remove some not necessary `(void)` constructs
2 parents 04457ac + be01906 commit 220d886

5 files changed

Lines changed: 12 additions & 20 deletions

File tree

src/docsets.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ void DocSets::decContentsDepth()
222222
//printf("DocSets::decContentsDepth() depth=%zu\n",p->indentStack.size());
223223
}
224224

225-
void DocSets::addContentsItem(bool isDir,
225+
void DocSets::addContentsItem(bool /*isDir*/,
226226
const QCString &name,
227227
const QCString &ref,
228228
const QCString &file,
@@ -232,7 +232,6 @@ void DocSets::addContentsItem(bool isDir,
232232
const Definition * /*def*/,
233233
const QCString & /* nameAsHtml */)
234234
{
235-
(void)isDir;
236235
//printf("DocSets::addContentsItem(%s) depth=%zu\n",name,p->indentStack.size());
237236
if (ref==nullptr)
238237
{
@@ -508,8 +507,7 @@ void DocSets::writeToken(TextStream &t,
508507
t << " </Token>\n";
509508
}
510509

511-
void DocSets::addIndexFile(const QCString &name)
510+
void DocSets::addIndexFile(const QCString &/*name*/)
512511
{
513-
(void)name;
514512
}
515513

src/fortranscanner.l

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3116,10 +3116,9 @@ static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool b
31163116
yyextra->current->inbodyDocs = "";
31173117

31183118
// strip \\param or @param, so we can do some extra checking. We will add it later on again.
3119-
if (!loc_doc.stripPrefix("\\param") &&
3120-
!loc_doc.stripPrefix("@param")
3121-
) (void)loc_doc; // Do nothing work has been done by stripPrefix; (void)loc_doc: to overcome 'empty controlled statement' warning
3122-
loc_doc.stripWhiteSpace();
3119+
if (loc_doc.stripPrefix("\\param") ||
3120+
loc_doc.stripPrefix("@param")
3121+
) loc_doc = loc_doc.stripWhiteSpace();
31233122

31243123
// direction as defined with the declaration of the parameter
31253124
int dir1 = yyextra->modifiers[yyextra->current_root][yyextra->argName.lower().str()].direction;
@@ -3220,12 +3219,11 @@ static void subrHandleCommentBlockResult(yyscan_t yyscanner,const QCString &doc,
32203219
yyextra->current->inbodyDocs = "";
32213220

32223221
// strip \\returns or @returns. We will add it later on again.
3223-
if (!loc_doc.stripPrefix("\\returns") &&
3224-
!loc_doc.stripPrefix("\\return") &&
3225-
!loc_doc.stripPrefix("@returns") &&
3226-
!loc_doc.stripPrefix("@return")
3227-
) (void)loc_doc; // Do nothing work has been done by stripPrefix; (void)loc_doc: to overcome 'empty controlled statement' warning
3228-
loc_doc.stripWhiteSpace();
3222+
if (loc_doc.stripPrefix("\\returns") ||
3223+
loc_doc.stripPrefix("\\return") ||
3224+
loc_doc.stripPrefix("@returns") ||
3225+
loc_doc.stripPrefix("@return")
3226+
) loc_doc = loc_doc.stripWhiteSpace();
32293227

32303228
if (!loc_doc.isEmpty() && (loc_doc.lower() != yyextra->argName.lower()))
32313229
{

src/memberlist.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -496,11 +496,9 @@ void MemberList::writePlainDeclarations(OutputList &ol, bool inGroup,
496496
*/
497497
void MemberList::writeDeclarations(OutputList &ol,
498498
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
499-
const QCString &title,const QCString &subtitle, bool showEnumValues,
499+
const QCString &title,const QCString &subtitle, bool /*showEnumValues*/,
500500
bool showInline,const ClassDef *inheritedFrom,MemberListType lt,bool showSectionTitle) const
501501
{
502-
(void)showEnumValues; // unused
503-
504502
//printf("----- writeDeclaration() this=%p ---- inheritedFrom=%p\n",this,inheritedFrom);
505503
bool optimizeVhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
506504
QCString inheritId;

src/qhp.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,6 @@ void Qhp::addContentsItem(bool /* isDir */, const QCString & name, const QCStrin
367367
void Qhp::addIndexItem(const Definition *context,const MemberDef *md,
368368
const QCString &sectionAnchor,const QCString &word)
369369
{
370-
(void)word;
371370
//printf("addIndexItem(%s %s %s\n",
372371
// context?context->name().data():"<none>",
373372
// md?md->name().data():"<none>",

src/vhdljjparser.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,10 +628,9 @@ QCString VHDLOutlineParser::popLabel(QCString & q)
628628

629629

630630
void VHDLOutlineParser::addProto(const QCString &s1,const QCString &s2,const QCString &s3,
631-
const QCString &s4,const QCString &s5,const QCString &s6)
631+
const QCString &s4,const QCString &/*s5*/,const QCString &s6)
632632
{
633633
VhdlParser::SharedState *s = &p->shared;
634-
(void)s5; // avoid unused warning
635634
StringVector ql=split(s2.str(),",");
636635

637636
for (const auto &n : ql)

0 commit comments

Comments
 (0)