Skip to content

Commit 144a9f7

Browse files
committed
fix new warnings
1 parent a1b67a6 commit 144a9f7

4 files changed

Lines changed: 36 additions & 36 deletions

File tree

lib/filesettings.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ class FileWithDetails
4646
throw std::runtime_error("empty path specified");
4747
}
4848

49-
void setPath(std::string path)
49+
void setPath(std::string p)
5050
{
51-
mPath = std::move(path);
51+
mPath = std::move(p);
5252
mPathSimplified = Path::simplifyPath(mPath);
5353
mPathAbsolute.clear();
5454
}
@@ -76,9 +76,9 @@ class FileWithDetails
7676
return mSize;
7777
}
7878

79-
void setLang(Standards::Language lang)
79+
void setLang(Standards::Language language)
8080
{
81-
mLang = lang;
81+
mLang = language;
8282
}
8383

8484
Standards::Language lang() const

lib/token.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -249,35 +249,35 @@ class CPPCHECKLIB Token {
249249
* For example index 1 would return next token, and 2
250250
* would return next from that one.
251251
*/
252-
const Token *tokAt(int index) const
252+
const Token *tokAt(int idx) const
253253
{
254-
return tokAtImpl(this, index);
254+
return tokAtImpl(this, idx);
255255
}
256-
Token *tokAt(int index)
256+
Token *tokAt(int idx)
257257
{
258-
return tokAtImpl(this, index);
258+
return tokAtImpl(this, idx);
259259
}
260260

261261
/**
262262
* @return the link to the token in given index, related to this token.
263263
* For example index 1 would return the link to next token.
264264
*/
265-
const Token *linkAt(int index) const
265+
const Token *linkAt(int idx) const
266266
{
267-
return linkAtImpl(this, index);
267+
return linkAtImpl(this, idx);
268268
}
269-
Token *linkAt(int index)
269+
Token *linkAt(int idx)
270270
{
271-
return linkAtImpl(this, index);
271+
return linkAtImpl(this, idx);
272272
}
273273

274274
/**
275275
* @return String of the token in given index, related to this token.
276276
* If that token does not exist, an empty string is being returned.
277277
*/
278-
const std::string &strAt(int index) const
278+
const std::string &strAt(int idx) const
279279
{
280-
const Token *tok = this->tokAt(index);
280+
const Token *tok = this->tokAt(idx);
281281
return tok ? tok->mStr : mEmptyString;
282282
}
283283

@@ -604,11 +604,11 @@ class CPPCHECKLIB Token {
604604
bool hasAttributeCleanup() const {
605605
return !mImpl->mAttributeCleanup.empty();
606606
}
607-
void setCppcheckAttribute(CppcheckAttributesType type, MathLib::bigint value) {
608-
mImpl->setCppcheckAttribute(type, value);
607+
void setCppcheckAttribute(CppcheckAttributesType attrType, MathLib::bigint value) {
608+
mImpl->setCppcheckAttribute(attrType, value);
609609
}
610-
bool getCppcheckAttribute(CppcheckAttributesType type, MathLib::bigint &value) const {
611-
return mImpl->getCppcheckAttribute(type, value);
610+
bool getCppcheckAttribute(CppcheckAttributesType attrType, MathLib::bigint &value) const {
611+
return mImpl->getCppcheckAttribute(attrType, value);
612612
}
613613
// cppcheck-suppress unusedFunction
614614
bool hasCppcheckAttributes() const {
@@ -891,15 +891,15 @@ class CPPCHECKLIB Token {
891891

892892
private:
893893
template<class T, REQUIRES("T must be a Token class", std::is_convertible<T*, const Token*> )>
894-
static T *tokAtImpl(T *tok, int index)
894+
static T *tokAtImpl(T *tok, int idx)
895895
{
896-
while (index > 0 && tok) {
896+
while (idx > 0 && tok) {
897897
tok = tok->next();
898-
--index;
898+
--idx;
899899
}
900-
while (index < 0 && tok) {
900+
while (idx < 0 && tok) {
901901
tok = tok->previous();
902-
++index;
902+
++idx;
903903
}
904904
return tok;
905905
}
@@ -908,9 +908,9 @@ class CPPCHECKLIB Token {
908908
* @throws InternalError thrown if index is out of range
909909
*/
910910
template<class T, REQUIRES("T must be a Token class", std::is_convertible<T*, const Token*> )>
911-
static T *linkAtImpl(T *thisTok, int index)
911+
static T *linkAtImpl(T *thisTok, int idx)
912912
{
913-
T *tok = thisTok->tokAt(index);
913+
T *tok = thisTok->tokAt(idx);
914914
if (!tok) {
915915
throw InternalError(thisTok, "Internal error. Token::linkAt called with index outside the tokens range.");
916916
}

lib/tokenize.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -568,23 +568,23 @@ namespace {
568568
const std::pair<Token*, Token*> rangeBefore(start, Token::findsimplematch(start, "{"));
569569

570570
// find typedef name token
571-
Token* nameToken = rangeBefore.second->link()->next();
572-
while (Token::Match(nameToken, "%name%|* %name%|*"))
573-
nameToken = nameToken->next();
574-
const std::pair<Token*, Token*> rangeQualifiers(rangeBefore.second->link()->next(), nameToken);
571+
Token* nameTok = rangeBefore.second->link()->next();
572+
while (Token::Match(nameTok, "%name%|* %name%|*"))
573+
nameTok = nameTok->next();
574+
const std::pair<Token*, Token*> rangeQualifiers(rangeBefore.second->link()->next(), nameTok);
575575

576-
if (Token::Match(nameToken, "%name% ;")) {
576+
if (Token::Match(nameTok, "%name% ;")) {
577577
if (Token::Match(rangeBefore.second->previous(), "enum|struct|union|class {"))
578-
rangeBefore.second->previous()->insertToken(nameToken->str());
578+
rangeBefore.second->previous()->insertToken(nameTok->str());
579579
mRangeType = rangeBefore;
580580
mRangeTypeQualifiers = rangeQualifiers;
581581
Token* typeName = rangeBefore.second->previous();
582582
if (typeName->isKeyword()) {
583583
// TODO typeName->insertToken("T:" + std::to_string(num++));
584-
typeName->insertToken(nameToken->str());
584+
typeName->insertToken(nameTok->str());
585585
}
586-
mNameToken = nameToken;
587-
mEndToken = nameToken->next();
586+
mNameTok = nameTok;
587+
mEndToken = nameTok->next();
588588
return;
589589
}
590590
}

test/testpreprocessor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ class TestPreprocessor : public TestFixture {
140140
cfgs = preprocessor.getConfigs();
141141
for (const std::string & config : cfgs) {
142142
try {
143-
const bool writeLocations = (strstr(code, "#file") != nullptr) || (strstr(code, "#include") != nullptr);
144-
cfgcode[config] = preprocessor.getcode(config, files, writeLocations);
143+
const bool writeLocs = (strstr(code, "#file") != nullptr) || (strstr(code, "#include") != nullptr);
144+
cfgcode[config] = preprocessor.getcode(config, files, writeLocs);
145145
} catch (const simplecpp::Output &) {
146146
cfgcode[config] = "";
147147
}

0 commit comments

Comments
 (0)