diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/annotate.cc | 4 | ||||
-rw-r--r-- | src/commodity.cc | 4 | ||||
-rw-r--r-- | src/context.h | 32 | ||||
-rw-r--r-- | src/draft.cc | 2 | ||||
-rw-r--r-- | src/error.cc | 10 | ||||
-rw-r--r-- | src/error.h | 10 | ||||
-rw-r--r-- | src/expr.cc | 14 | ||||
-rw-r--r-- | src/format.cc | 4 | ||||
-rw-r--r-- | src/item.h | 14 | ||||
-rw-r--r-- | src/main.cc | 3 | ||||
-rw-r--r-- | src/op.cc | 4 | ||||
-rw-r--r-- | src/op.h | 22 | ||||
-rw-r--r-- | src/py_post.cc | 5 | ||||
-rw-r--r-- | src/pyinterp.cc | 16 | ||||
-rw-r--r-- | src/quotes.cc | 7 | ||||
-rw-r--r-- | src/stream.cc | 6 | ||||
-rw-r--r-- | src/system.hh.in | 33 | ||||
-rw-r--r-- | src/textual.cc | 31 | ||||
-rw-r--r-- | src/times.cc | 83 | ||||
-rw-r--r-- | src/token.cc | 4 | ||||
-rw-r--r-- | src/value.cc | 6 | ||||
-rw-r--r-- | src/value.h | 10 | ||||
-rw-r--r-- | src/xact.cc | 8 | ||||
-rw-r--r-- | src/xact.h | 6 |
24 files changed, 85 insertions, 253 deletions
diff --git a/src/annotate.cc b/src/annotate.cc index ab81d412..c5ccdf07 100644 --- a/src/annotate.cc +++ b/src/annotate.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -81,7 +81,7 @@ bool annotation_t::operator<(const annotation_t& rhs) const void annotation_t::parse(std::istream& in) { do { - istream_pos_type pos = in.tellg(); + std::istream::pos_type pos = in.tellg(); if (static_cast<int>(pos) < 0) return; diff --git a/src/commodity.cc b/src/commodity.cc index a8520ca1..d6d5ca98 100644 --- a/src/commodity.cc +++ b/src/commodity.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -294,7 +294,7 @@ bool commodity_t::symbol_needs_quotes(const string& symbol) void commodity_t::parse_symbol(std::istream& in, string& symbol) { - istream_pos_type pos = in.tellg(); + std::istream::pos_type pos = in.tellg(); char buf[256]; char c = peek_next_nonws(in); diff --git a/src/context.h b/src/context.h index 0af59930..ca7af060 100644 --- a/src/context.h +++ b/src/context.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -58,19 +58,19 @@ public: shared_ptr<std::istream> stream; - path pathname; - path current_directory; - journal_t * journal; - account_t * master; - scope_t * scope; - char linebuf[MAX_LINE + 1]; - istream_pos_type line_beg_pos; - istream_pos_type curr_pos; - std::size_t linenum; - std::size_t errors; - std::size_t count; - std::size_t sequence; - std::string last; + path pathname; + path current_directory; + journal_t * journal; + account_t * master; + scope_t * scope; + char linebuf[MAX_LINE + 1]; + std::istream::pos_type line_beg_pos; + std::istream::pos_type curr_pos; + std::size_t linenum; + std::size_t errors; + std::size_t count; + std::size_t sequence; + std::string last; explicit parse_context_t(const path& cwd) : current_directory(cwd), master(NULL), scope(NULL), @@ -113,11 +113,7 @@ inline parse_context_t open_for_reading(const path& pathname, const path& cwd) { path filename = resolve_path(pathname); -#if BOOST_VERSION >= 104600 && BOOST_FILESYSTEM_VERSION >= 3 filename = filesystem::absolute(filename, cwd); -#else - filename = filesystem::complete(filename, cwd); -#endif if (! exists(filename) || is_directory(filename)) throw_(std::runtime_error, _f("Cannot read journal file %1%") % filename); diff --git a/src/draft.cc b/src/draft.cc index 424b7a9a..12d7faf7 100644 --- a/src/draft.cc +++ b/src/draft.cc @@ -68,7 +68,7 @@ void draft_t::xact_template_t::dump(std::ostream& out) const } else { foreach (const post_template_t& post, posts) { out << std::endl - << _f("[Posting \"%1\"]") % (post.from ? _("from") : _("to")) + << _f("[Posting \"%1%\"]") % (post.from ? _("from") : _("to")) << std::endl; if (post.account_mask) diff --git a/src/error.cc b/src/error.cc index 7e49645b..1ab92840 100644 --- a/src/error.cc +++ b/src/error.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -78,10 +78,10 @@ string line_context(const string& line, return buf.str(); } -string source_context(const path& file, - const istream_pos_type pos, - const istream_pos_type end_pos, - const string& prefix) +string source_context(const path& file, + const std::istream::pos_type pos, + const std::istream::pos_type end_pos, + const string& prefix) { const std::streamoff len = end_pos - pos; if (! len || file.empty()) diff --git a/src/error.h b/src/error.h index bc9953cd..3bdcde98 100644 --- a/src/error.h +++ b/src/error.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -81,10 +81,10 @@ string line_context(const string& line, const string::size_type pos = 0, const string::size_type end_pos = 0); -string source_context(const path& file, - const istream_pos_type pos, - const istream_pos_type end_pos, - const string& prefix = ""); +string source_context(const path& file, + const std::istream::pos_type pos, + const std::istream::pos_type end_pos, + const string& prefix = ""); #define DECLARE_EXCEPTION(name, kind) \ class name : public kind { \ diff --git a/src/expr.cc b/src/expr.cc index 85818e4b..c8945d3d 100644 --- a/src/expr.cc +++ b/src/expr.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -94,9 +94,9 @@ void expr_t::parse(std::istream& in, const parse_flags_t& flags, const optional<string>& original_string) { parser_t parser; - istream_pos_type start_pos = in.tellg(); + std::istream::pos_type start_pos = in.tellg(); ptr = parser.parse(in, flags, original_string); - istream_pos_type end_pos = in.tellg(); + std::istream::pos_type end_pos = in.tellg(); if (original_string) { set_text(*original_string); @@ -290,10 +290,10 @@ value_t source_command(call_scope_t& args) in = &std::cin; } - symbol_scope_t file_locals(args); - std::size_t linenum = 0; - char buf[4096]; - istream_pos_type pos; + symbol_scope_t file_locals(args); + std::size_t linenum = 0; + char buf[4096]; + std::istream::pos_type pos; while (in->good() && ! in->eof()) { pos = in->tellg(); diff --git a/src/format.cc b/src/format.cc index bb578141..5b9baa21 100644 --- a/src/format.cc +++ b/src/format.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -103,7 +103,7 @@ namespace { p += std::strlen(p); } else { assert(str.good()); - istream_pos_type pos = str.tellg(); + std::istream::pos_type pos = str.tellg(); expr.set_text(string(p, p + long(pos))); p += long(pos) - 1; @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -48,12 +48,12 @@ namespace ledger { struct position_t { - path pathname; - istream_pos_type beg_pos; - std::size_t beg_line; - istream_pos_type end_pos; - std::size_t end_line; - std::size_t sequence; + path pathname; + std::istream::pos_type beg_pos; + std::size_t beg_line; + std::istream::pos_type end_pos; + std::size_t end_line; + std::size_t sequence; position_t() : beg_pos(0), beg_line(0), end_pos(0), end_line(0), sequence(0) { diff --git a/src/main.cc b/src/main.cc index 4348e8a6..218579cf 100644 --- a/src/main.cc +++ b/src/main.cc @@ -73,9 +73,6 @@ int main(int argc, char * argv[], char * envp[]) // Initialize global Boost/C++ environment std::ios::sync_with_stdio(false); -#if BOOST_VERSION < 104600 - filesystem::path::default_name_check(filesystem::portable_posix_name); -#endif std::signal(SIGINT, sigint_handler); #if !defined(_WIN32) && !defined(__CYGWIN__) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -963,7 +963,7 @@ void expr_t::op_t::dump(std::ostream& out, const int depth) const string op_context(const expr_t::ptr_op_t op, const expr_t::ptr_op_t locus) { - ostream_pos_type start_pos, end_pos; + std::ostream::pos_type start_pos, end_pos; expr_t::op_t::context_t context(op, locus, &start_pos, &end_pos); std::ostringstream buf; buf << " "; @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -285,19 +285,19 @@ public: struct context_t { - ptr_op_t expr_op; - ptr_op_t op_to_find; - ostream_pos_type * start_pos; - ostream_pos_type * end_pos; - bool relaxed; + ptr_op_t expr_op; + ptr_op_t op_to_find; + std::ostream::pos_type * start_pos; + std::ostream::pos_type * end_pos; + bool relaxed; context_t() : start_pos(NULL), end_pos(NULL), relaxed(false) {} - context_t(const ptr_op_t& _expr_op, - const ptr_op_t& _op_to_find, - ostream_pos_type * const _start_pos = NULL, - ostream_pos_type * const _end_pos = NULL, - const bool _relaxed = true) + context_t(const ptr_op_t& _expr_op, + const ptr_op_t& _op_to_find, + std::ostream::pos_type * const _start_pos = NULL, + std::ostream::pos_type * const _end_pos = NULL, + const bool _relaxed = true) : expr_op(_expr_op), op_to_find(_op_to_find), start_pos(_start_pos), end_pos(_end_pos), relaxed(_relaxed) {} diff --git a/src/py_post.cc b/src/py_post.cc index 6195570b..525b47c2 100644 --- a/src/py_post.cc +++ b/src/py_post.cc @@ -153,6 +153,11 @@ void export_post() return_value_policy<return_by_value>()), make_setter(&post_t::cost, return_value_policy<return_by_value>())) + .add_property("given_cost", + make_getter(&post_t::given_cost, + return_value_policy<return_by_value>()), + make_setter(&post_t::given_cost, + return_value_policy<return_by_value>())) .add_property("assigned_amount", make_getter(&post_t::assigned_amount, return_value_policy<return_by_value>()), diff --git a/src/pyinterp.cc b/src/pyinterp.cc index 19430bef..fad0b559 100644 --- a/src/pyinterp.cc +++ b/src/pyinterp.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -222,27 +222,13 @@ object python_interpreter_t::import_option(const string& str) python::list paths(sys_dict["path"]); if (contains(str, ".py")) { -#if BOOST_VERSION >= 103700 path& cwd(parsing_context.get_current().current_directory); -#if BOOST_VERSION >= 104600 && BOOST_FILESYSTEM_VERSION >= 3 path parent(filesystem::absolute(file, cwd).parent_path()); -#else - path parent(filesystem::complete(file, cwd).parent_path()); -#endif DEBUG("python.interp", "Adding " << parent << " to PYTHONPATH"); paths.insert(0, parent.string()); sys_dict["path"] = paths; -#if BOOST_VERSION >= 104600 name = file.stem().string(); -#else - name = file.stem(); -#endif -#else // BOOST_VERSION >= 103700 - paths.insert(0, file.branch_path().string()); - sys_dict["path"] = paths; - name = file.leaf(); -#endif // BOOST_VERSION >= 103700 } try { diff --git a/src/quotes.cc b/src/quotes.cc index 50791560..8ae8ca90 100644 --- a/src/quotes.cc +++ b/src/quotes.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -79,13 +79,8 @@ commodity_quote_from_script(commodity_t& commodity, if (optional<std::pair<commodity_t *, price_point_t> > point = commodity_pool_t::current_pool->parse_price_directive(buf)) { if (commodity_pool_t::current_pool->price_db) { -#if defined(__GNUG__) && __GNUG__ < 3 - ofstream database(*commodity_pool_t::current_pool->price_db, - ios::out | ios::app); -#else ofstream database(*commodity_pool_t::current_pool->price_db, std::ios_base::out | std::ios_base::app); -#endif database << "P " << format_datetime(point->second.when, FMT_WRITTEN) << " " << commodity.symbol() diff --git a/src/stream.cc b/src/stream.cc index c4bbb42e..91a190d8 100644 --- a/src/stream.cc +++ b/src/stream.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -89,11 +89,7 @@ namespace { else { // parent close(pfd[0]); typedef iostreams::stream<iostreams::file_descriptor_sink> fdstream; -#if BOOST_VERSION >= 104400 *os = new fdstream(pfd[1], iostreams::never_close_handle); -#else // BOOST_VERSION >= 104400 - *os = new fdstream(pfd[1]); -#endif // BOOST_VERSION >= 104400 } return pfd[1]; #else diff --git a/src/system.hh.in b/src/system.hh.in index c093e334..97651e8b 100644 --- a/src/system.hh.in +++ b/src/system.hh.in @@ -81,14 +81,9 @@ /* System includes */ /*------------------------------------------------------------------------*/ -#if defined(__GNUG__) && __GNUG__ < 3 -#define _XOPEN_SOURCE -#endif - #include <algorithm> #include <exception> #include <typeinfo> -#include <locale> #include <stdexcept> #include <iostream> #include <streambuf> @@ -105,29 +100,6 @@ #include <string> #include <vector> -#if defined(__GNUG__) && __GNUG__ < 3 - -namespace std { - inline ostream & right (ostream & i) { - i.setf(i.right, i.adjustfield); - return i; - } - inline ostream & left (ostream & i) { - i.setf(i.left, i.adjustfield); - return i; - } -} - -typedef std::streamoff istream_pos_type; -typedef std::streamoff ostream_pos_type; - -#else // ! (defined(__GNUG__) && __GNUG__ < 3) - -typedef std::istream::pos_type istream_pos_type; -typedef std::ostream::pos_type ostream_pos_type; - -#endif - #include <cassert> #include <cctype> #include <cstdarg> @@ -136,11 +108,6 @@ typedef std::ostream::pos_type ostream_pos_type; #include <cstring> #include <csignal> -#if defined __FreeBSD__ && __FreeBSD__ <= 4 -// FreeBSD has a broken isspace macro, so don't use it -#undef isspace(c) -#endif - #if defined(_WIN32) || defined(__CYGWIN__) #include <io.h> #else diff --git a/src/textual.cc b/src/textual.cc index 3416073b..04e90e45 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -557,7 +557,7 @@ void instance_t::option_directive(char * line) void instance_t::automated_xact_directive(char * line) { - istream_pos_type pos = context.line_beg_pos; + std::istream::pos_type pos = context.line_beg_pos; bool reveal_context = true; @@ -653,7 +653,7 @@ void instance_t::automated_xact_directive(char * line) void instance_t::period_xact_directive(char * line) { - istream_pos_type pos = context.line_beg_pos; + std::istream::pos_type pos = context.line_beg_pos; bool reveal_context = true; @@ -743,17 +743,8 @@ void instance_t::include_directive(char * line) DEBUG("textual.include", "resolved path: " << filename.string()); mask_t glob; -#if BOOST_VERSION >= 103700 path parent_path = filename.parent_path(); -#if BOOST_VERSION >= 104600 glob.assign_glob('^' + filename.filename().string() + '$'); -#else - glob.assign_glob('^' + filename.filename() + '$'); -#endif -#else // BOOST_VERSION >= 103700 - path parent_path = filename.branch_path(); - glob.assign_glob('^' + filename.leaf() + '$'); -#endif // BOOST_VERSION >= 103700 bool files_found = false; if (exists(parent_path)) { @@ -761,21 +752,9 @@ void instance_t::include_directive(char * line) for (filesystem::directory_iterator iter(parent_path); iter != end; ++iter) { -#if BOOST_VERSION <= 103500 - if (is_regular(*iter)) -#else if (is_regular_file(*iter)) -#endif { -#if BOOST_VERSION >= 103700 -#if BOOST_VERSION >= 104600 string base = (*iter).path().filename().string(); -#else - string base = (*iter).filename(); -#endif -#else // BOOST_VERSION >= 103700 - string base = (*iter).leaf(); -#endif // BOOST_VERSION >= 103700 if (glob.match(base)) { journal_t * journal = context.journal; account_t * master = top_account(); @@ -916,8 +895,8 @@ void instance_t::end_apply_directive(char * kind) void instance_t::account_directive(char * line) { - istream_pos_type beg_pos = context.line_beg_pos; - std::size_t beg_linenum = context.linenum; + std::istream::pos_type beg_pos = context.line_beg_pos; + std::size_t beg_linenum = context.linenum; char * p = skip_ws(line); account_t * account = diff --git a/src/times.cc b/src/times.cc index eda71ae7..db0d74ff 100644 --- a/src/times.cc +++ b/src/times.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -43,23 +43,11 @@ optional<datetime_t> epoch; date_time::weekdays start_of_week = gregorian::Sunday; -//#define USE_BOOST_FACETS 1 -#if defined(USE_BOOST_FACETS) -#error "Boost facets are not quite working yet" -#endif - namespace { template <typename T, typename InputFacetType, typename OutputFacetType> class temporal_io_t : public noncopyable { - string fmt_str; -#if defined(USE_BOOST_FACETS) - std::istringstream input_stream; - std::ostringstream output_stream; - InputFacetType * input_facet; - OutputFacetType * output_facet; - std::string temp_string; -#endif // USE_BOOST_FACETS + string fmt_str; public: date_traits_t traits; @@ -71,15 +59,6 @@ namespace { icontains(fmt_str, "%m") || icontains(fmt_str, "%b"), icontains(fmt_str, "%d")), input(_input) { -#if defined(USE_BOOST_FACETS) - if (input) { - input_facet = new InputFacetType(fmt_str); - input_stream.imbue(std::locale(std::locale::classic(), input_facet)); - } else { - output_facet = new OutputFacetType(fmt_str); - output_stream.imbue(std::locale(std::locale::classic(), output_facet)); - } -#endif // USE_BOOST_FACETS } void set_format(const char * fmt) { @@ -88,29 +67,15 @@ namespace { icontains(fmt_str, "%m") || icontains(fmt_str, "%b"), icontains(fmt_str, "%d")); -#if defined(USE_BOOST_FACETS) - if (input) - input_facet->format(fmt_str); - else - output_facet->format(fmt_str); -#endif // USE_BOOST_FACETS } T parse(const char *) {} std::string format(const T& when) { -#if defined(USE_BOOST_FACETS) - output_stream.str(temp_string); - output_stream.seekp(std::ios_base::beg); - output_stream.clear(); - output_stream << when; - return output_stream.str(); -#else // USE_BOOST_FACETS std::tm data(to_tm(when)); char buf[128]; std::strftime(buf, 127, fmt_str.c_str(), &data); return buf; -#endif // USE_BOOST_FACETS } }; @@ -119,34 +84,12 @@ namespace { posix_time::time_facet> ::parse(const char * str) { -#if defined(USE_BOOST_FACETS) - input_stream.seekg(std::ios_base::beg); - input_stream.clear(); - input_stream.str(str); - - datetime_t when; - input_stream >> when; -#if DEBUG_ON - if (when.is_not_a_date_time()) - DEBUG("times.parse", "Failed to parse date/time '" << str - << "' using pattern '" << fmt_str << "'"); -#endif - - if (! when.is_not_a_date_time() && - input_stream.good() && ! input_stream.eof() && - input_stream.peek() != EOF) { - DEBUG("times.parse", "This string has leftovers: '" << str << "'"); - return datetime_t(); - } - return when; -#else // USE_BOOST_FACETS std::tm data; std::memset(&data, 0, sizeof(std::tm)); if (strptime(str, fmt_str.c_str(), &data)) return posix_time::ptime_from_tm(data); else return datetime_t(); -#endif // USE_BOOST_FACETS } template <> @@ -154,27 +97,6 @@ namespace { gregorian::date_facet> ::parse(const char * str) { -#if defined(USE_BOOST_FACETS) - input_stream.seekg(std::ios_base::beg); - input_stream.clear(); - input_stream.str(str); - - date_t when; - input_stream >> when; -#if DEBUG_ON - if (when.is_not_a_date()) - DEBUG("times.parse", "Failed to parse date '" << str - << "' using pattern '" << fmt_str << "'"); -#endif - - if (! when.is_not_a_date() && - input_stream.good() && ! input_stream.eof() && - input_stream.peek() != EOF) { - DEBUG("times.parse", "This string has leftovers: '" << str << "'"); - return date_t(); - } - return when; -#else // USE_BOOST_FACETS std::tm data; std::memset(&data, 0, sizeof(std::tm)); data.tm_year = CURRENT_DATE().year() - 1900; @@ -183,7 +105,6 @@ namespace { return gregorian::date_from_tm(data); else return date_t(); -#endif // USE_BOOST_FACETS } typedef temporal_io_t<datetime_t, posix_time::time_input_facet, diff --git a/src/token.cc b/src/token.cc index 1ec052ed..76bf5106 100644 --- a/src/token.cc +++ b/src/token.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -380,7 +380,7 @@ void expr_t::token_t::next(std::istream& in, const parse_flags_t& pflags) break; default: { - istream_pos_type pos = in.tellg(); + std::istream::pos_type pos = in.tellg(); // First, check to see if it's a reserved word, such as: and or not int result = parse_reserved_word(in); diff --git a/src/value.cc b/src/value.cc index 1841505d..5ce30530 100644 --- a/src/value.cc +++ b/src/value.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -129,11 +129,7 @@ value_t::operator bool() const void value_t::set_type(type_t new_type) { if (new_type == VOID) { -#if BOOST_VERSION >= 103700 storage.reset(); -#else - storage = intrusive_ptr<storage_t>(); -#endif } else { if (! storage || storage->refc > 1) storage = new storage_t; diff --git a/src/value.h b/src/value.h index 35581bfb..e44f9354 100644 --- a/src/value.h +++ b/src/value.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2018, John Wiegley. All rights reserved. + * Copyright (c) 2003-2019, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -878,22 +878,14 @@ public: VERIFY(! is_null()); if (! is_sequence()) { -#if BOOST_VERSION >= 103700 storage.reset(); -#else - storage = intrusive_ptr<storage_t>(); -#endif } else { as_sequence_lval().pop_back(); const sequence_t& seq(as_sequence()); std::size_t new_size = seq.size(); if (new_size == 0) { -#if BOOST_VERSION >= 103700 storage.reset(); -#else - storage = intrusive_ptr<storage_t>(); -#endif } else if (new_size == 1) { *this = seq.front(); diff --git a/src/xact.cc b/src/xact.cc index 5df9ebc5..10a7106a 100644 --- a/src/xact.cc +++ b/src/xact.cc @@ -395,10 +395,12 @@ bool xact_base_t::finalize() some_null = true; } - if (post->has_flags(POST_DEFERRED)) - post->account->add_deferred_post(id(), post); - else + if (post->has_flags(POST_DEFERRED)) { + if (!post->amount.is_null()) + post->account->add_deferred_post(id(), post); + } else { post->account->add_post(post); + } post->xdata().add_flags(POST_EXT_VISITED); post->account->xdata().add_flags(ACCOUNT_EXT_VISITED); @@ -115,7 +115,7 @@ public: virtual string description() { if (pos) { std::ostringstream buf; - buf << _f("transaction at line %1") << pos->beg_line; + buf << _f("transaction at line %1%") % pos->beg_line; return buf.str(); } else { return string(_("generated transaction")); @@ -177,7 +177,7 @@ public: virtual string description() { if (pos) { std::ostringstream buf; - buf << _f("automated transaction at line %1") << pos->beg_line; + buf << _f("automated transaction at line %1%") % pos->beg_line; return buf.str(); } else { return string(_("generated automated transaction")); @@ -220,7 +220,7 @@ class period_xact_t : public xact_base_t virtual string description() { if (pos) { std::ostringstream buf; - buf << _f("periodic transaction at line %1") << pos->beg_line; + buf << _f("periodic transaction at line %1%") % pos->beg_line; return buf.str(); } else { return string(_("generated periodic transaction")); |