summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cc2
-rw-r--r--src/system.hh1
-rw-r--r--src/textual.cc2
-rw-r--r--src/value.cc2
-rw-r--r--src/xpath.cc2
5 files changed, 5 insertions, 4 deletions
diff --git a/src/main.cc b/src/main.cc
index ade5b6a1..ae3d0d46 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -408,7 +408,7 @@ int main(int argc, char * argv[], char * envp[])
#if defined(TRACING_ON)
if (i + 1 < argc && std::strcmp(argv[i], "--trace") == 0) {
ledger::_log_level = LOG_TRACE;
- ledger::_trace_level = std::atoi(argv[i + 1]);
+ ledger::_trace_level = lexical_cast<int>(argv[i + 1]);
i++;
}
#endif
diff --git a/src/system.hh b/src/system.hh
index fe1e7b7f..34319d75 100644
--- a/src/system.hh
+++ b/src/system.hh
@@ -106,6 +106,7 @@ extern "C" {
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
+#include <boost/lexical_cast.hpp>
#include <boost/operators.hpp>
#include <boost/optional.hpp>
#include <boost/ptr_container/ptr_list.hpp>
diff --git a/src/textual.cc b/src/textual.cc
index 0a4c7333..5fe13e6d 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -774,7 +774,7 @@ unsigned int textual_parser_t::parse(std::istream& in,
case 'Y': // set current year
#if 0
// jww (2007-04-18): Need to set this up again
- date_t::current_year = std::atoi(skip_ws(line + 1));
+ date_t::current_year = lexical_cast<int>(skip_ws(line + 1));
#endif
break;
diff --git a/src/value.cc b/src/value.cc
index d5d4e655..b181df8f 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -1647,7 +1647,7 @@ void value_t::in_place_cast(type_t cast_type)
break;
}
if (alldigits) {
- long temp = std::atol((*(string **) data)->c_str());
+ long temp = lexical_cast<long>((*(string **) data)->c_str());
destroy();
*(long *) data = temp;
} else {
diff --git a/src/xpath.cc b/src/xpath.cc
index 1dabd871..a7e1e661 100644
--- a/src/xpath.cc
+++ b/src/xpath.cc
@@ -654,7 +654,7 @@ xpath_t::parse_value_term(std::istream& in, unsigned short tflags) const
int id = -1;
if (std::isdigit(ident[0])) {
node.reset(new op_t(op_t::ARG_INDEX));
- node->arg_index = std::atol(ident.c_str());
+ node->arg_index = lexical_cast<unsigned int>(ident.c_str());
}
else if ((id = document_t::lookup_builtin_id(ident)) != -1) {
node.reset(new op_t(op_t::NODE_ID));