From 7dae58cbcc3df64e6add31020a7f44de1b28b3de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Aereal=20Ae=C3=B3n?= Date: Wed, 8 Aug 2018 03:55:43 -0300 Subject: [PATCH] Replace boost:lexical_cast for std::to_string. --- libdevcore/Exceptions.cpp | 2 +- libsolidity/inlineasm/AsmAnalysis.cpp | 10 +++++----- libsolidity/inlineasm/AsmParser.cpp | 8 ++++---- libsolidity/interface/Exceptions.h | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libdevcore/Exceptions.cpp b/libdevcore/Exceptions.cpp index f204dbc2e..c614aeceb 100644 --- a/libdevcore/Exceptions.cpp +++ b/libdevcore/Exceptions.cpp @@ -43,7 +43,7 @@ string Exception::lineInfo() const ret += *file; ret += ':'; if (line) - ret += boost::lexical_cast(*line); + ret += std::to_string(*line); return ret; } diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp index d5580dd27..97e1023b3 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(_literal.value.size()) + " > 32)" + "String literal too long (" + std::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(m_stackHeight - initialStackHeight) + + std::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(arguments) + " arguments but got " + - boost::lexical_cast(_funCall.arguments.size()) + "." + "Expected " + std::to_string(arguments) + " arguments but got " + + std::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(m_stackHeight - _oldHeight) + + std::to_string(m_stackHeight - _oldHeight) + " items." ); return false; diff --git a/libsolidity/inlineasm/AsmParser.cpp b/libsolidity/inlineasm/AsmParser.cpp index cd429a98e..06f9a587a 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(args) + + std::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(args) + + std::to_string(args) + " arguments)" )); @@ -514,7 +514,7 @@ assembly::Expression Parser::parseCall(Parser::ElementaryOperation&& _initialOp) "Expected ',' (instruction \"" + instructionNames().at(instr) + "\" expects " + - boost::lexical_cast(args) + + std::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(args) + + std::to_string(args) + " arguments)" )); expectToken(Token::RParen); diff --git a/libsolidity/interface/Exceptions.h b/libsolidity/interface/Exceptions.h index 7c66d5721..629b8f3fa 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(occurrences) + " to the first 32 occurrences."; + _message += " Truncated from " + std::to_string(occurrences) + " to the first 32 occurrences."; } }