Skip to content

Commit 1653b6c

Browse files
committed
more qualifying
1 parent 0470345 commit 1653b6c

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

libsolidity/ast/ASTAnnotations.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ struct InlineAssemblyAnnotation: StatementAnnotation
222222
/// True, if the assembly block was annotated to be memory-safe.
223223
bool markedMemorySafe = false;
224224
/// True, if the assembly block involves any memory opcode or assigns to variables in memory.
225-
SetOnce<bool> hasMemoryEffects;
225+
util::SetOnce<bool> hasMemoryEffects;
226226
};
227227

228228
struct BlockAnnotation: StatementAnnotation, ScopableAnnotation

test/CommonSyntaxTest.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@ namespace
4242

4343
int parseUnsignedInteger(string::iterator& _it, string::iterator _end)
4444
{
45-
auto isDigit = [](char _c) -> bool {return isdigit(_c, std::locale::classic());};
46-
if (_it == _end || !isDigit(*_it))
45+
if (_it == _end || !util::isDigit(*_it))
4746
BOOST_THROW_EXCEPTION(runtime_error("Invalid test expectation. Source location expected."));
4847
int result = 0;
49-
while (_it != _end && isDigit(*_it))
48+
while (_it != _end && util::isDigit(*_it))
5049
{
5150
result *= 10;
5251
result += *_it - '0';
@@ -195,7 +194,6 @@ string CommonSyntaxTest::errorMessage(Exception const& _e)
195194

196195
vector<SyntaxTestError> CommonSyntaxTest::parseExpectations(istream& _stream)
197196
{
198-
auto isDigit = [](char _c) -> bool {return isdigit(_c, std::locale::classic());};
199197
vector<SyntaxTestError> expectations;
200198
string line;
201199
while (getline(_stream, line))
@@ -215,7 +213,7 @@ vector<SyntaxTestError> CommonSyntaxTest::parseExpectations(istream& _stream)
215213
skipWhitespace(it, line.end());
216214

217215
optional<ErrorId> errorId;
218-
if (it != line.end() && isDigit(*it))
216+
if (it != line.end() && util::isDigit(*it))
219217
errorId = ErrorId{static_cast<unsigned long long>(parseUnsignedInteger(it, line.end()))};
220218

221219
expect(it, line.end(), ':');
@@ -228,7 +226,7 @@ vector<SyntaxTestError> CommonSyntaxTest::parseExpectations(istream& _stream)
228226
if (it != line.end() && *it == '(')
229227
{
230228
++it;
231-
if (it != line.end() && !isDigit(*it))
229+
if (it != line.end() && !util::isDigit(*it))
232230
{
233231
auto sourceNameStart = it;
234232
while (it != line.end() && *it != ':')

test/libsolidity/util/TestFileParser.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -763,12 +763,11 @@ string TestFileParser::Scanner::scanString()
763763
char TestFileParser::Scanner::scanHexPart()
764764
{
765765
auto toLower = [](char _c) -> char { return tolower(_c, locale::classic()); };
766-
auto isDigit = [](char _c) -> bool { return isdigit(_c, locale::classic()); };
767766

768767
advance(); // skip 'x'
769768

770769
int value{};
771-
if (isDigit(current()))
770+
if (util::isDigit(current()))
772771
value = current() - '0';
773772
else if (toLower(current()) >= 'a' && toLower(current()) <= 'f')
774773
value = toLower(current()) - 'a' + 10;
@@ -780,7 +779,7 @@ char TestFileParser::Scanner::scanHexPart()
780779
return static_cast<char>(value);
781780

782781
value <<= 4;
783-
if (isDigit(current()))
782+
if (util::isDigit(current()))
784783
value |= current() - '0';
785784
else if (toLower(current()) >= 'a' && toLower(current()) <= 'f')
786785
value |= toLower(current()) - 'a' + 10;

0 commit comments

Comments
 (0)