aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-08-08 23:07:25 +0800
committerGitHub <noreply@github.com>2018-08-08 23:07:25 +0800
commit90627040545f0257b01cc24f95edea1c89cdbbf3 (patch)
tree2a22ee42a7a2f0a146bc22b47d801f5d63ddca2c /libsolidity
parentefeffa808371b64e6aa7eb5d340baf5989af2cd5 (diff)
parente902ce1aa02dc5d19cc9dd231fa538646884826d (diff)
downloaddexon-solidity-90627040545f0257b01cc24f95edea1c89cdbbf3.tar.gz
dexon-solidity-90627040545f0257b01cc24f95edea1c89cdbbf3.tar.zst
dexon-solidity-90627040545f0257b01cc24f95edea1c89cdbbf3.zip
Merge pull request #4753 from mattaereal/boost-to-string-patch
Replace boost:lexical_cast<std::string> for std::to_string.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/ast/ASTJsonConverter.cpp2
-rw-r--r--libsolidity/ast/Types.cpp14
-rw-r--r--libsolidity/codegen/ContractCompiler.cpp2
-rw-r--r--libsolidity/inlineasm/AsmAnalysis.cpp10
-rw-r--r--libsolidity/inlineasm/AsmParser.cpp8
-rw-r--r--libsolidity/interface/CompilerStack.cpp6
-rw-r--r--libsolidity/interface/Exceptions.h2
7 files changed, 22 insertions, 22 deletions
diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp
index a8ede66a..72b20b3b 100644
--- a/libsolidity/ast/ASTJsonConverter.cpp
+++ b/libsolidity/ast/ASTJsonConverter.cpp
@@ -126,7 +126,7 @@ string ASTJsonConverter::sourceLocationToString(SourceLocation const& _location)
int length = -1;
if (_location.start >= 0 && _location.end >= 0)
length = _location.end - _location.start;
- return std::to_string(_location.start) + ":" + std::to_string(length) + ":" + std::to_string(sourceIndex);
+ return to_string(_location.start) + ":" + to_string(length) + ":" + to_string(sourceIndex);
}
string ASTJsonConverter::namePathToString(std::vector<ASTString> const& _namePath)
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index 565d197a..349a59d4 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -478,7 +478,7 @@ string IntegerType::richIdentifier() const
if (isAddress())
return "t_address";
else
- return "t_" + string(isSigned() ? "" : "u") + "int" + std::to_string(numBits());
+ return "t_" + string(isSigned() ? "" : "u") + "int" + to_string(numBits());
}
bool IntegerType::isImplicitlyConvertibleTo(Type const& _convertTo) const
@@ -644,7 +644,7 @@ FixedPointType::FixedPointType(unsigned _totalBits, unsigned _fractionalDigits,
string FixedPointType::richIdentifier() const
{
- return "t_" + string(isSigned() ? "" : "u") + "fixed" + std::to_string(m_totalBits) + "x" + std::to_string(m_fractionalDigits);
+ return "t_" + string(isSigned() ? "" : "u") + "fixed" + to_string(m_totalBits) + "x" + to_string(m_fractionalDigits);
}
bool FixedPointType::isImplicitlyConvertibleTo(Type const& _convertTo) const
@@ -1390,7 +1390,7 @@ MemberList::MemberMap FixedBytesType::nativeMembers(const ContractDefinition*) c
string FixedBytesType::richIdentifier() const
{
- return "t_bytes" + std::to_string(m_bytes);
+ return "t_bytes" + to_string(m_bytes);
}
bool FixedBytesType::operator==(Type const& _other) const
@@ -1833,7 +1833,7 @@ TypePointer ArrayType::copyForLocation(DataLocation _location, bool _isPointer)
string ContractType::richIdentifier() const
{
- return (m_super ? "t_super" : "t_contract") + parenthesizeUserIdentifier(m_contract.name()) + std::to_string(m_contract.id());
+ return (m_super ? "t_super" : "t_contract") + parenthesizeUserIdentifier(m_contract.name()) + to_string(m_contract.id());
}
bool ContractType::operator==(Type const& _other) const
@@ -1947,7 +1947,7 @@ bool StructType::isImplicitlyConvertibleTo(const Type& _convertTo) const
string StructType::richIdentifier() const
{
- return "t_struct" + parenthesizeUserIdentifier(m_struct.name()) + std::to_string(m_struct.id()) + identifierLocationSuffix();
+ return "t_struct" + parenthesizeUserIdentifier(m_struct.name()) + to_string(m_struct.id()) + identifierLocationSuffix();
}
bool StructType::operator==(Type const& _other) const
@@ -2173,7 +2173,7 @@ TypePointer EnumType::unaryOperatorResult(Token::Value _operator) const
string EnumType::richIdentifier() const
{
- return "t_enum" + parenthesizeUserIdentifier(m_enum.name()) + std::to_string(m_enum.id());
+ return "t_enum" + parenthesizeUserIdentifier(m_enum.name()) + to_string(m_enum.id());
}
bool EnumType::operator==(Type const& _other) const
@@ -3143,7 +3143,7 @@ string ModifierType::toString(bool _short) const
string ModuleType::richIdentifier() const
{
- return "t_module_" + std::to_string(m_sourceUnit.id());
+ return "t_module_" + to_string(m_sourceUnit.id());
}
bool ModuleType::operator==(Type const& _other) const
diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp
index f9493d6d..02274d60 100644
--- a/libsolidity/codegen/ContractCompiler.cpp
+++ b/libsolidity/codegen/ContractCompiler.cpp
@@ -50,7 +50,7 @@ class StackHeightChecker
public:
explicit StackHeightChecker(CompilerContext const& _context):
m_context(_context), stackHeight(m_context.stackHeight()) {}
- void check() { solAssert(m_context.stackHeight() == stackHeight, std::string("I sense a disturbance in the stack: ") + std::to_string(m_context.stackHeight()) + " vs " + std::to_string(stackHeight)); }
+ void check() { solAssert(m_context.stackHeight() == stackHeight, std::string("I sense a disturbance in the stack: ") + to_string(m_context.stackHeight()) + " vs " + to_string(stackHeight)); }
private:
CompilerContext const& m_context;
unsigned stackHeight;
diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp
index ea804cf5..9a0110cf 100644
--- a/libsolidity/inlineasm/AsmAnalysis.cpp
+++ b/libsolidity/inlineasm/AsmAnalysis.cpp
@@ -85,7 +85,7 @@ bool AsmAnalyzer::operator()(assembly::Literal const& _literal)
{
m_errorReporter.typeError(
_literal.location,
- "String literal too long (" + boost::lexical_cast<std::string>(_literal.value.size()) + " > 32)"
+ "String literal too long (" + to_string(_literal.value.size()) + " > 32)"
);
return false;
}
@@ -185,7 +185,7 @@ bool AsmAnalyzer::operator()(assembly::ExpressionStatement const& _statement)
Error::Type errorType = m_flavour == AsmFlavour::Loose ? *m_errorTypeForLoose : Error::Type::TypeError;
string msg =
"Top-level expressions are not supposed to return values (this expression returns " +
- boost::lexical_cast<string>(m_stackHeight - initialStackHeight) +
+ to_string(m_stackHeight - initialStackHeight) +
" value" +
(m_stackHeight - initialStackHeight == 1 ? "" : "s") +
"). Use ``pop()`` or assign them.";
@@ -322,8 +322,8 @@ bool AsmAnalyzer::operator()(assembly::FunctionCall const& _funCall)
{
m_errorReporter.typeError(
_funCall.functionName.location,
- "Expected " + boost::lexical_cast<string>(arguments) + " arguments but got " +
- boost::lexical_cast<string>(_funCall.arguments.size()) + "."
+ "Expected " + to_string(arguments) + " arguments but got " +
+ to_string(_funCall.arguments.size()) + "."
);
success = false;
}
@@ -477,7 +477,7 @@ bool AsmAnalyzer::expectDeposit(int _deposit, int _oldHeight, SourceLocation con
m_errorReporter.typeError(
_location,
"Expected expression to return one item to the stack, but did return " +
- boost::lexical_cast<string>(m_stackHeight - _oldHeight) +
+ to_string(m_stackHeight - _oldHeight) +
" items."
);
return false;
diff --git a/libsolidity/inlineasm/AsmParser.cpp b/libsolidity/inlineasm/AsmParser.cpp
index cd429a98..f34bbffe 100644
--- a/libsolidity/inlineasm/AsmParser.cpp
+++ b/libsolidity/inlineasm/AsmParser.cpp
@@ -279,7 +279,7 @@ assembly::Expression Parser::parseExpression()
"Expected '(' (instruction \"" +
instructionNames().at(instr.instruction) +
"\" expects " +
- boost::lexical_cast<string>(args) +
+ to_string(args) +
" arguments)"
));
}
@@ -502,7 +502,7 @@ assembly::Expression Parser::parseCall(Parser::ElementaryOperation&& _initialOp)
"Expected expression (instruction \"" +
instructionNames().at(instr) +
"\" expects " +
- boost::lexical_cast<string>(args) +
+ to_string(args) +
" arguments)"
));
@@ -514,7 +514,7 @@ assembly::Expression Parser::parseCall(Parser::ElementaryOperation&& _initialOp)
"Expected ',' (instruction \"" +
instructionNames().at(instr) +
"\" expects " +
- boost::lexical_cast<string>(args) +
+ to_string(args) +
" arguments)"
));
else
@@ -527,7 +527,7 @@ assembly::Expression Parser::parseCall(Parser::ElementaryOperation&& _initialOp)
"Expected ')' (instruction \"" +
instructionNames().at(instr) +
"\" expects " +
- boost::lexical_cast<string>(args) +
+ to_string(args) +
" arguments)"
));
expectToken(Token::RParen);
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp
index 5cfd1758..836e30d2 100644
--- a/libsolidity/interface/CompilerStack.cpp
+++ b/libsolidity/interface/CompilerStack.cpp
@@ -925,17 +925,17 @@ string CompilerStack::computeSourceMapping(eth::AssemblyItems const& _items) con
if (components-- > 0)
{
if (location.start != prevStart)
- ret += std::to_string(location.start);
+ ret += to_string(location.start);
if (components-- > 0)
{
ret += ':';
if (length != prevLength)
- ret += std::to_string(length);
+ ret += to_string(length);
if (components-- > 0)
{
ret += ':';
if (sourceIndex != prevSourceIndex)
- ret += std::to_string(sourceIndex);
+ ret += to_string(sourceIndex);
if (components-- > 0)
{
ret += ':';
diff --git a/libsolidity/interface/Exceptions.h b/libsolidity/interface/Exceptions.h
index 7c66d572..629b8f3f 100644
--- a/libsolidity/interface/Exceptions.h
+++ b/libsolidity/interface/Exceptions.h
@@ -117,7 +117,7 @@ public:
if (occurrences > 32)
{
infos.resize(32);
- _message += " Truncated from " + boost::lexical_cast<std::string>(occurrences) + " to the first 32 occurrences.";
+ _message += " Truncated from " + std::to_string(occurrences) + " to the first 32 occurrences.";
}
}