Added code to use boost::lexical_cast<>.
This commit is contained in:
parent
f0508a9f86
commit
f9f24fab93
8 changed files with 22 additions and 21 deletions
20
configure
vendored
20
configure
vendored
|
|
@ -1,6 +1,6 @@
|
|||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.61 for ledger 3.0-git.
|
||||
# Generated by GNU Autoconf 2.61 for ledger 3.0-git-lexical_cast.
|
||||
#
|
||||
# Report bugs to <johnw@newartisans.com>.
|
||||
#
|
||||
|
|
@ -728,8 +728,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
|||
# Identity of this package.
|
||||
PACKAGE_NAME='ledger'
|
||||
PACKAGE_TARNAME='ledger'
|
||||
PACKAGE_VERSION='3.0-git'
|
||||
PACKAGE_STRING='ledger 3.0-git'
|
||||
PACKAGE_VERSION='3.0-git-lexical_cast'
|
||||
PACKAGE_STRING='ledger 3.0-git-lexical_cast'
|
||||
PACKAGE_BUGREPORT='johnw@newartisans.com'
|
||||
|
||||
ac_unique_file="ledger"
|
||||
|
|
@ -1424,7 +1424,7 @@ if test "$ac_init_help" = "long"; then
|
|||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures ledger 3.0-git to adapt to many kinds of systems.
|
||||
\`configure' configures ledger 3.0-git-lexical_cast to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
|
|
@ -1494,7 +1494,7 @@ fi
|
|||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of ledger 3.0-git:";;
|
||||
short | recursive ) echo "Configuration of ledger 3.0-git-lexical_cast:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
|
|
@ -1605,7 +1605,7 @@ fi
|
|||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
ledger configure 3.0-git
|
||||
ledger configure 3.0-git-lexical_cast
|
||||
generated by GNU Autoconf 2.61
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
||||
|
|
@ -1619,7 +1619,7 @@ cat >config.log <<_ACEOF
|
|||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by ledger $as_me 3.0-git, which was
|
||||
It was created by ledger $as_me 3.0-git-lexical_cast, which was
|
||||
generated by GNU Autoconf 2.61. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
|
|
@ -2310,7 +2310,7 @@ fi
|
|||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='ledger'
|
||||
VERSION='3.0-git'
|
||||
VERSION='3.0-git-lexical_cast'
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
|
|
@ -21967,7 +21967,7 @@ exec 6>&1
|
|||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by ledger $as_me 3.0-git, which was
|
||||
This file was extended by ledger $as_me 3.0-git-lexical_cast, which was
|
||||
generated by GNU Autoconf 2.61. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
|
|
@ -22020,7 +22020,7 @@ Report bugs to <bug-autoconf@gnu.org>."
|
|||
_ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF
|
||||
ac_cs_version="\\
|
||||
ledger config.status 3.0-git
|
||||
ledger config.status 3.0-git-lexical_cast
|
||||
configured by $0, generated by GNU Autoconf 2.61,
|
||||
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
AC_PREREQ(2.59)
|
||||
|
||||
AC_INIT(ledger, 3.0-git, johnw@newartisans.com)
|
||||
AC_INIT(ledger, 3.0-git-lexical_cast, johnw@newartisans.com)
|
||||
AC_CONFIG_SRCDIR(ledger)
|
||||
AM_INIT_AUTOMAKE
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ void BasicAmountTestCase::testConstructors()
|
|||
amount_t x3(123.456);
|
||||
amount_t x5("123456");
|
||||
amount_t x6("123.456");
|
||||
amount_t x7(std::string("123456"));
|
||||
amount_t x8(std::string("123.456"));
|
||||
amount_t x7(string("123456"));
|
||||
amount_t x8(string("123.456"));
|
||||
amount_t x9(x3);
|
||||
amount_t x10(x6);
|
||||
amount_t x11(x8);
|
||||
|
|
@ -76,8 +76,8 @@ void BasicAmountTestCase::testAssignment()
|
|||
x3 = 123.456;
|
||||
x5 = "123456";
|
||||
x6 = "123.456";
|
||||
x7 = std::string("123456");
|
||||
x8 = std::string("123.456");
|
||||
x7 = string("123456");
|
||||
x8 = string("123.456");
|
||||
x9 = x3;
|
||||
x10 = amount_t(x6);
|
||||
|
||||
|
|
@ -415,8 +415,8 @@ void BasicAmountTestCase::testNegation()
|
|||
amount_t x3(-123.456);
|
||||
amount_t x5("-123456");
|
||||
amount_t x6("-123.456");
|
||||
amount_t x7(std::string("-123456"));
|
||||
amount_t x8(std::string("-123.456"));
|
||||
amount_t x7(string("-123456"));
|
||||
amount_t x8(string("-123.456"));
|
||||
amount_t x9(- x3);
|
||||
|
||||
assertEqual(amount_t(0L), x0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue