Skip to content

Commit b7383c5

Browse files
committed
mitigated unusedFunction nogui selfcheck warnings
1 parent 62770f6 commit b7383c5

5 files changed

Lines changed: 4 additions & 43 deletions

File tree

lib/checkleakautovar.cpp

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -104,47 +104,6 @@ static bool isVarTokComparison(const Token * tok, const Token ** vartok,
104104

105105
//---------------------------------------------------------------------------
106106

107-
void VarInfo::print()
108-
{
109-
std::cout << "size=" << alloctype.size() << std::endl;
110-
for (std::map<int, AllocInfo>::const_iterator it = alloctype.cbegin(); it != alloctype.cend(); ++it) {
111-
std::string strusage;
112-
const auto use = possibleUsage.find(it->first);
113-
if (use != possibleUsage.end())
114-
strusage = use->second.first->str();
115-
116-
std::string status;
117-
switch (it->second.status) {
118-
case OWNED:
119-
status = "owned";
120-
break;
121-
case DEALLOC:
122-
status = "dealloc";
123-
break;
124-
case ALLOC:
125-
status = "alloc";
126-
break;
127-
case NOALLOC:
128-
status = "noalloc";
129-
break;
130-
case REALLOC:
131-
status = "realloc";
132-
break;
133-
default:
134-
status = "?";
135-
break;
136-
}
137-
138-
std::cout << "status=" << status << " "
139-
<< "alloctype='" << it->second.type << "' "
140-
<< "possibleUsage='" << strusage << "' "
141-
<< "conditionalAlloc=" << (conditionalAlloc.find(it->first) != conditionalAlloc.end() ? "yes" : "no") << " "
142-
<< "referenced=" << (referenced.find(it->first) != referenced.end() ? "yes" : "no") << " "
143-
<< "reallocedFrom=" << it->second.reallocedFromType
144-
<< std::endl;
145-
}
146-
}
147-
148107
void VarInfo::possibleUsageAll(const std::pair<const Token*, Usage>& functionUsage)
149108
{
150109
possibleUsage.clear();

lib/checkleakautovar.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ class CPPCHECKLIB VarInfo {
9393

9494
/** set possible usage for all variables */
9595
void possibleUsageAll(const std::pair<const Token*, Usage>& functionUsage);
96-
97-
void print();
9896
};
9997

10098

lib/errorlogger.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ class CPPCHECKLIB ErrorMessage {
186186
}
187187

188188
/** Verbose message (may be the same as the short message) */
189+
// cppcheck-suppress unusedFunction - used by GUI only
189190
const std::string &verboseMessage() const {
190191
return mVerboseMessage;
191192
}

lib/importproject.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,6 +1324,7 @@ void ImportProject::selectOneVsConfig(Platform::Type platform)
13241324
}
13251325
}
13261326

1327+
// cppcheck-suppress unusedFunction - used by GUI only
13271328
void ImportProject::selectVsConfigurations(Platform::Type platform, const std::vector<std::string> &configurations)
13281329
{
13291330
for (std::list<FileSettings>::iterator it = fileSettings.begin(); it != fileSettings.end();) {
@@ -1348,6 +1349,7 @@ void ImportProject::selectVsConfigurations(Platform::Type platform, const std::v
13481349
}
13491350
}
13501351

1352+
// cppcheck-suppress unusedFunction - used by GUI only
13511353
std::list<std::string> ImportProject::getVSConfigs()
13521354
{
13531355
return std::list<std::string>(mAllVSConfigs.cbegin(), mAllVSConfigs.cend());

lib/suppressions.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ bool SuppressionList::Suppression::isMatch(const SuppressionList::ErrorMessage &
390390
return true;
391391
}
392392

393+
// cppcheck-suppress unusedFunction - used by GUI only
393394
std::string SuppressionList::Suppression::getText() const
394395
{
395396
std::string ret;

0 commit comments

Comments
 (0)