Skip to content

Commit fe8e7f9

Browse files
committed
Cleanup warnings
1 parent 43462ba commit fe8e7f9

File tree

10 files changed

+34
-30
lines changed

10 files changed

+34
-30
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" OR ${CMAKE_CXX_COMPILER_ID} MATCHES
2929
endif ()
3030
else ()
3131
# MSVC
32-
3332
if (NOT DEFINED MSVC_RUNTIME_TYPE)
3433
set (MSVC_RUNTIME_TYPE "/MD")
3534
endif ()

src/expression_parser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ ExpressionEvaluatorPtr<Expression> ExpressionParser::ParseLogicalCompare(LexScan
126126
break;
127127
case Token::Is:
128128
{
129-
Token tok = lexer.NextToken();
130-
if (tok != Token::Identifier)
129+
Token nextTok = lexer.NextToken();
130+
if (nextTok != Token::Identifier)
131131
return ExpressionEvaluatorPtr<Expression>();
132132

133-
std::string name = tok.value.asString();
133+
std::string name = nextTok.value.asString();
134134
bool valid = true;
135135
CallParams params;
136136

src/lexer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ bool Lexer::Preprocess()
7171
return result;
7272
}
7373

74-
bool Lexer::ProcessNumber(const lexertk::token& token, Token& newToken)
74+
bool Lexer::ProcessNumber(const lexertk::token&, Token& newToken)
7575
{
7676
newToken.type = Token::FloatNum;
7777
newToken.value = m_helper->GetAsValue(newToken.range, newToken.type);

src/lexer.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ struct Token
2020
enum Type
2121
{
2222
Unknown,
23+
24+
// One-symbol operators
25+
Lt = '<',
26+
Gt = '>',
27+
Plus = '+',
28+
Minus = '-',
29+
Percent = '%',
30+
Mul = '*',
31+
Div = '/',
32+
LBracket = '(',
33+
RBracket = ')',
34+
LSqBracket = '[',
35+
RSqBracket = ']',
36+
LCrlBracket = '{',
37+
RCrlBracket = '}',
2338
Eof = 256,
2439

2540
// General

src/renderer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class RawTextRenderer : public RendererBase
4949
{
5050
}
5151

52-
void Render(OutStream& os, RenderContext& values) override
52+
void Render(OutStream& os, RenderContext&) override
5353
{
5454
os.WriteChunk(m_offset, m_length);
5555
}

src/statements.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void ElseBranchStatement::Render(OutStream& os, RenderContext& values)
120120
m_mainBody->Render(os, values);
121121
}
122122

123-
void SetStatement::Render(OutStream& os, RenderContext& values)
123+
void SetStatement::Render(OutStream&, RenderContext& values)
124124
{
125125
if (m_expr)
126126
{

src/template_parser.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ bool StatementsParser::ParseFor(LexScanner& lexer, StatementInfoList& statements
8787
return true;
8888
}
8989

90-
bool StatementsParser::ParseEndFor(LexScanner& lexer, StatementInfoList& statementsInfo, size_t pos)
90+
bool StatementsParser::ParseEndFor(LexScanner& /*lexer*/, StatementInfoList& statementsInfo, size_t /*pos*/)
9191
{
9292
if (statementsInfo.empty())
9393
return false;
@@ -121,7 +121,7 @@ bool StatementsParser::ParseIf(LexScanner& lexer, StatementInfoList& statementsI
121121
return true;
122122
}
123123

124-
bool StatementsParser::ParseElse(LexScanner& lexer, StatementInfoList& statementsInfo, size_t pos)
124+
bool StatementsParser::ParseElse(LexScanner& /*lexer*/, StatementInfoList& statementsInfo, size_t pos)
125125
{
126126
auto renderer = std::make_shared<ElseBranchStatement>(ExpressionEvaluatorPtr<>());
127127
StatementInfo statementInfo = StatementInfo::Create(StatementInfo::ElseIfStatement, pos);
@@ -144,7 +144,7 @@ bool StatementsParser::ParseElIf(LexScanner& lexer, StatementInfoList& statement
144144
return true;
145145
}
146146

147-
bool StatementsParser::ParseEndIf(LexScanner& lexer, StatementInfoList& statementsInfo, size_t pos)
147+
bool StatementsParser::ParseEndIf(LexScanner& /*lexer*/, StatementInfoList& statementsInfo, size_t /*pos*/)
148148
{
149149
if (statementsInfo.empty())
150150
return false;
@@ -178,7 +178,7 @@ bool StatementsParser::ParseEndIf(LexScanner& lexer, StatementInfoList& statemen
178178
return true;
179179
}
180180

181-
bool StatementsParser::ParseSet(LexScanner& lexer, StatementInfoList& statementsInfo, size_t pos)
181+
bool StatementsParser::ParseSet(LexScanner& lexer, StatementInfoList& statementsInfo, size_t /*pos*/)
182182
{
183183
std::vector<std::string> vars;
184184

@@ -220,7 +220,7 @@ bool StatementsParser::ParseSet(LexScanner& lexer, StatementInfoList& statements
220220
return true;
221221
}
222222

223-
bool StatementsParser::ParseEndSet(LexScanner& lexer, StatementInfoList& statementsInfo, size_t pos)
223+
bool StatementsParser::ParseEndSet(LexScanner& /*lexer*/, StatementInfoList& /*statementsInfo*/, size_t /*pos*/)
224224
{
225225
return false;
226226
}

src/template_parser.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ struct ParserTraits<wchar_t>
124124
#endif
125125
return result;
126126
}
127-
static Value RangeToNum(const std::wstring& str, CharRange rante, Token::Type hint)
127+
static Value RangeToNum(const std::wstring& /*str*/, CharRange /*range*/, Token::Type /*hint*/)
128128
{
129129
return Value();
130130
}
@@ -270,7 +270,7 @@ class TemplateParser : public LexerHelper
270270

271271
return true;
272272
}
273-
bool ParseRoughMatch(sregex_iterator& curMatch, const sregex_iterator& endMatch)
273+
bool ParseRoughMatch(sregex_iterator& curMatch, const sregex_iterator& /*endMatch*/)
274274
{
275275
auto& match = *curMatch;
276276
int matchType = RM_Unknown;
@@ -502,7 +502,7 @@ class TemplateParser : public LexerHelper
502502

503503
return Token::Unknown;
504504
}
505-
char GetCharAt(size_t pos) override
505+
char GetCharAt(size_t /*pos*/) override
506506
{
507507
return '\0';
508508
}

src/testers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace jinja2
66
namespace testers
77
{
88

9-
bool Defined::Test(const Value& baseVal, RenderContext& context)
9+
bool Defined::Test(const Value& baseVal, RenderContext& /*context*/)
1010
{
1111
return boost::get<EmptyValue>(&baseVal.data()) == nullptr;
1212
}

src/value.cpp

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ struct ValueRenderer : boost::static_visitor<std::string>
6464
return result;
6565
}
6666

67-
std::string operator() (const GenericMap& val) const
67+
std::string operator() (const GenericMap& /*val*/) const
6868
{
6969
return "";
7070
}
7171

72-
std::string operator() (const GenericList& val) const
72+
std::string operator() (const GenericList& /*val*/) const
7373
{
7474
return "";
7575
}
@@ -125,20 +125,10 @@ struct SubscriptionVisitor : public boost::static_visitor<Value>
125125
}
126126

127127
template<typename T, typename U>
128-
Value operator() (T&& first, U&& second) const
128+
Value operator() (T&& /*first*/, U&& /*second*/) const
129129
{
130-
return Test<U>::Foo(first);
130+
return Value();
131131
}
132-
133-
template<typename U>
134-
struct Test
135-
{
136-
template<typename T>
137-
static Value Foo(T&&)
138-
{
139-
return Value();
140-
}
141-
};
142132
};
143133

144134
} //

0 commit comments

Comments
 (0)