Skip to content

Commit e40299a

Browse files
committed
fix new warnings
1 parent 9819ab5 commit e40299a

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 {
@@ -899,15 +899,15 @@ class CPPCHECKLIB Token {
899899

900900
private:
901901
template<class T, REQUIRES("T must be a Token class", std::is_convertible<T*, const Token*> )>
902-
static T *tokAtImpl(T *tok, int index)
902+
static T *tokAtImpl(T *tok, int idx)
903903
{
904-
while (index > 0 && tok) {
904+
while (idx > 0 && tok) {
905905
tok = tok->next();
906-
--index;
906+
--idx;
907907
}
908-
while (index < 0 && tok) {
908+
while (idx < 0 && tok) {
909909
tok = tok->previous();
910-
++index;
910+
++idx;
911911
}
912912
return tok;
913913
}
@@ -916,9 +916,9 @@ class CPPCHECKLIB Token {
916916
* @throws InternalError thrown if index is out of range
917917
*/
918918
template<class T, REQUIRES("T must be a Token class", std::is_convertible<T*, const Token*> )>
919-
static T *linkAtImpl(T *thisTok, int index)
919+
static T *linkAtImpl(T *thisTok, int idx)
920920
{
921-
T *tok = thisTok->tokAt(index);
921+
T *tok = thisTok->tokAt(idx);
922922
if (!tok) {
923923
throw InternalError(thisTok, "Internal error. Token::linkAt called with index outside the tokens range.");
924924
}

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<const 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<const 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<const 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+
mNameToken = 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
@@ -146,8 +146,8 @@ class TestPreprocessor : public TestFixture {
146146
}
147147
for (const std::string & config : cfgs) {
148148
try {
149-
const bool writeLocations = (strstr(code, "#include") != nullptr);
150-
cfgcode[config] = preprocessor.getcode(config, files, writeLocations);
149+
const bool writeLocs = (strstr(code, "#include") != nullptr);
150+
cfgcode[config] = preprocessor.getcode(config, files, writeLocs);
151151
} catch (const simplecpp::Output &) {
152152
cfgcode[config] = "";
153153
}

0 commit comments

Comments
 (0)