diff options
43 files changed, 70 insertions, 70 deletions
diff --git a/src/account.cc b/src/account.cc index 3e0ad086..36070a52 100644 --- a/src/account.cc +++ b/src/account.cc @@ -45,7 +45,7 @@ account_t::~account_t() if (! pair.second->has_flags(ACCOUNT_TEMP) || has_flags(ACCOUNT_TEMP)) { checked_delete(pair.second); - } + } } } diff --git a/src/amount.cc b/src/amount.cc index bc7e9918..808f118d 100644 --- a/src/amount.cc +++ b/src/amount.cc @@ -152,7 +152,7 @@ namespace { if (mpfr_asprintf(&buf, "%.*RNf", precision, tempfb) < 0) throw_(amount_error, _("Cannot output amount to a floating-point representation")); - + DEBUG("amount.convert", "mpfr_print = " << buf << " (precision " << precision << ", zeros_prec " << zeros_prec << ")"); diff --git a/src/amount.h b/src/amount.h index 8a2ebf04..f7e877a7 100644 --- a/src/amount.h +++ b/src/amount.h @@ -349,7 +349,7 @@ public: return temp; } void in_place_truncate(); - + /** Yields an amount which has lost all of its extra precision, beyond what the display precision of the commodity would have printed. */ amount_t floored() const { @@ -358,7 +358,7 @@ public: return temp; } void in_place_floor(); - + /** Yields an amount whose display precision is never truncated, even though its commodity normally displays only rounded values. */ amount_t unrounded() const { diff --git a/src/commodity.cc b/src/commodity.cc index f8a4b364..5685059d 100644 --- a/src/commodity.cc +++ b/src/commodity.cc @@ -444,7 +444,7 @@ commodity_t::find_price(const optional<commodity_t&>& commodity, return point; } return none; -} +} optional<price_point_t> commodity_t::check_for_updated_price(const optional<price_point_t>& point, @@ -758,7 +758,7 @@ void to_xml(std::ostream& out, const commodity_t& comm, out << '"'; x.close_attrs(); - + { push_xml y(out, "symbol"); out << y.guard(comm.symbol()); diff --git a/src/commodity.h b/src/commodity.h index fcd26da0..d7747b2a 100644 --- a/src/commodity.h +++ b/src/commodity.h @@ -376,7 +376,7 @@ public: #if defined(DEBUG_ON) , const int indent = 0 #endif - ) const; + ) const; optional<price_point_t> check_for_updated_price(const optional<price_point_t>& point, diff --git a/src/compare.h b/src/compare.h index 0ba9d424..0e7bf5e5 100644 --- a/src/compare.h +++ b/src/compare.h @@ -58,7 +58,7 @@ class compare_items expr_t sort_order; compare_items(); - + public: compare_items(const compare_items& other) : sort_order(other.sort_order) { TRACE_CTOR(compare_items, "copy"); diff --git a/src/convert.cc b/src/convert.cc index 5d4925c4..493fbb7a 100644 --- a/src/convert.cc +++ b/src/convert.cc @@ -95,7 +95,7 @@ value_t convert_command(call_scope_t& args) foreach (post_t * post, xact->posts) post->amount.in_place_negate(); } - + bool matched = false; if (! xact->posts.front()->amount.is_null()) { post_map_t::iterator i = post_map.find(- xact->posts.front()->amount); @@ -289,7 +289,7 @@ xact_t * csv_reader::read_xact(journal_t& journal, account_t * bucket) amt.set_commodity(*commodity_pool_t::current_pool->default_commodity); post->assigned_amount = amt; } - + xact->add_post(post.release()); return xact.release(); diff --git a/src/error.cc b/src/error.cc index 02413ef6..542d12b9 100644 --- a/src/error.cc +++ b/src/error.cc @@ -93,10 +93,10 @@ string source_context(const path& file, assert(len < 8192); std::ostringstream out; - + ifstream in(file); in.seekg(pos, std::ios::beg); - + scoped_array<char> buf(new char[static_cast<std::size_t>(len) + 1]); in.read(buf.get(), static_cast<std::streamsize>(len)); assert(in.gcount() == static_cast<std::streamsize>(len)); diff --git a/src/exprbase.h b/src/exprbase.h index 83ef34ff..d86ee14c 100644 --- a/src/exprbase.h +++ b/src/exprbase.h @@ -130,7 +130,7 @@ public: const optional<string>& original_string = none) { set_text(original_string ? *original_string : "<stream>"); } - + virtual void mark_uncompiled() { compiled = false; } diff --git a/src/filters.cc b/src/filters.cc index a08e5d25..5bad0414 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -53,7 +53,7 @@ void post_splitter::flush() { foreach (value_to_posts_map::value_type& pair, posts_map) { preflush_func(pair.first); - + foreach (post_t * post, pair.second) (*post_chain)(*post); @@ -415,7 +415,7 @@ void collapse_posts::report_subtotal() bind_scope_t bound_scope(report, *post); if (only_predicate(bound_scope) && display_predicate(bound_scope)) displayed_count++; - } + } if (displayed_count == 1) { item_handler<post_t>::operator()(*last_post); @@ -734,7 +734,7 @@ void changed_value_posts::output_intermediate_prices(post_t& post, case value_t::DATE: default: assert(false); - break; + break; } bind_scope_t inner_scope(report, temp); diff --git a/src/filters.h b/src/filters.h index 4c096571..e7a2eefa 100644 --- a/src/filters.h +++ b/src/filters.h @@ -73,10 +73,10 @@ public: post_splitter(post_handler_ptr _post_chain, report_t& _report, expr_t _group_by_expr) - : post_chain(_post_chain), report(_report), + : post_chain(_post_chain), report(_report), group_by_expr(_group_by_expr) { TRACE_CTOR(post_splitter, "scope_t&, post_handler_ptr, expr_t"); - preflush_func = bind(&post_splitter::print_title, this, _1); + preflush_func = bind(&post_splitter::print_title, this, _1); } virtual ~post_splitter() { TRACE_DTOR(post_splitter); @@ -310,7 +310,7 @@ public: virtual void clear() { sorter.clear(); last_xact = NULL; - + item_handler<post_t>::clear(); } }; @@ -382,7 +382,7 @@ public: temps.clear(); comms.clear(); last_xact = NULL; - + item_handler<post_t>::clear(); } }; @@ -458,7 +458,7 @@ public: } virtual void flush() { - report_subtotal(); + report_subtotal(); item_handler<post_t>::flush(); } @@ -479,7 +479,7 @@ public: temps.clear(); create_accounts(); component_posts.clear(); - + item_handler<post_t>::clear(); } }; diff --git a/src/generate.cc b/src/generate.cc index 60c6955e..185e23e7 100644 --- a/src/generate.cc +++ b/src/generate.cc @@ -271,14 +271,14 @@ void generate_posts_iterator::generate_date(std::ostream& out) out.width(4); out.fill('0'); out << year_gen(); - + out.width(1); out << '/'; out.width(2); out.fill('0'); out << mon_gen(); - + out.width(1); out << '/'; diff --git a/src/generate.h b/src/generate.h index f9207ff5..47abcd94 100644 --- a/src/generate.h +++ b/src/generate.h @@ -106,7 +106,7 @@ public: virtual ~generate_posts_iterator() throw() { TRACE_DTOR(generate_posts_iterator); } - + virtual void increment(); protected: diff --git a/src/item.cc b/src/item.cc index 9a9ab833..7e7cda0d 100644 --- a/src/item.cc +++ b/src/item.cc @@ -535,7 +535,7 @@ string item_context(const item_t& item, const string& desc) assert(len < 8192); std::ostringstream out; - + if (item.pos->pathname == path("/dev/stdin")) { out << desc << _(" from standard input:"); return out.str(); diff --git a/src/journal.cc b/src/journal.cc index fd6d3eac..2a9adeeb 100644 --- a/src/journal.cc +++ b/src/journal.cc @@ -74,7 +74,7 @@ journal_t::~journal_t() foreach (period_xact_t * xact, period_xacts) checked_delete(xact); - + checked_delete(master); } diff --git a/src/lookup.cc b/src/lookup.cc index 28007d9a..452727d6 100644 --- a/src/lookup.cc +++ b/src/lookup.cc @@ -92,7 +92,7 @@ lookup_probable_account(const string& ident, if ((CURRENT_DATE() - xact->date()).days() > 700) continue; #endif - + // An exact match is worth a score of 100 and terminates the search if (ident == xact->payee) { DEBUG("lookup", " we have an exact match, score = 100"); @@ -438,7 +438,7 @@ value_t expr_t::op_t::calc(scope_t& scope, ptr_op_t * locus, const int depth) return result; } - catch (const std::exception&) { + catch (const std::exception&) { if (locus && ! *locus) *locus = this; throw; diff --git a/src/option.cc b/src/option.cc index dae0f0af..f7008b47 100644 --- a/src/option.cc +++ b/src/option.cc @@ -89,7 +89,7 @@ namespace { catch (const std::exception&) { if (name[0] == '-') add_error_context(_("While parsing option '%1'") << name); - + else add_error_context(_("While parsing environent variable '%1'") << name); throw; @@ -156,7 +156,7 @@ namespace { op_bool_char_tuple(expr_t::ptr_op_t _op, bool _truth, char _ch) : op(_op), truth(_truth), ch(_ch) {} }; -} +} strings_list process_arguments(strings_list args, scope_t& scope) { diff --git a/src/option.h b/src/option.h index eacc65d1..8f89d081 100644 --- a/src/option.h +++ b/src/option.h @@ -214,7 +214,7 @@ public: #define DECL1(type, name, vartype, var, value) \ vartype var ; \ name ## option_t() : option_t<type>(#name), var(value) - + #define DO() virtual void handler_thunk(call_scope_t&) #define DO_(var) virtual void handler_thunk(call_scope_t& var) diff --git a/src/pool.cc b/src/pool.cc index aa56efff..65edbd6a 100644 --- a/src/pool.cc +++ b/src/pool.cc @@ -298,7 +298,7 @@ commodity_pool_t::exchange(const amount_t& amount, annotation.add_flags(ANNOTATION_DATE_CALCULATED); if (tag) annotation.add_flags(ANNOTATION_TAG_CALCULATED); - + breakdown.amount = amount_t(amount, annotation); DEBUG("commodity.prices.add", diff --git a/src/post.cc b/src/post.cc index ca03a675..4178c8bc 100644 --- a/src/post.cc +++ b/src/post.cc @@ -115,7 +115,7 @@ date_t post_t::actual_date() const return xact->date(); } return *_date; -} +} optional<date_t> post_t::effective_date() const { @@ -341,7 +341,7 @@ namespace { value_t get_value_date(post_t& post) { if (post.has_xdata()) { post_t::xdata_t& xdata(post.xdata()); - if (! xdata.value_date.is_not_a_date()) + if (! xdata.value_date.is_not_a_date()) return xdata.value_date; } return post.date(); diff --git a/src/pstream.h b/src/pstream.h index 5fac20bd..8134495d 100644 --- a/src/pstream.h +++ b/src/pstream.h @@ -99,7 +99,7 @@ class ptristream : public std::istream protected: ptrinbuf buf; -public: +public: ptristream(char * ptr, std::size_t len = 0) : std::istream(0), buf(ptr, len) { rdbuf(&buf); diff --git a/src/py_balance.cc b/src/py_balance.cc index eba5761d..540b3221 100644 --- a/src/py_balance.cc +++ b/src/py_balance.cc @@ -56,7 +56,7 @@ namespace { datetime_t& moment) { return balance.value(moment, in_terms_of); } - + boost::optional<amount_t> py_commodity_amount_0(const balance_t& balance) { return balance.commodity_amount(); diff --git a/src/py_commodity.cc b/src/py_commodity.cc index 783171dd..6d8a29b3 100644 --- a/src/py_commodity.cc +++ b/src/py_commodity.cc @@ -181,7 +181,7 @@ namespace { const datetime_t& date, const amount_t& price) { commodity.add_price(date, price); } - + void py_add_price_3(commodity_t& commodity, const datetime_t& date, const amount_t& price, const bool reflexive) { commodity.add_price(date, price, reflexive); diff --git a/src/py_xact.cc b/src/py_xact.cc index b7582854..adaf81a2 100644 --- a/src/py_xact.cc +++ b/src/py_xact.cc @@ -140,7 +140,7 @@ void export_xact() class_< period_xact_t, bases<xact_base_t> > ("PeriodicTransaction") .def(init<string>()) - + .add_property("period", make_getter(&period_xact_t::period), make_setter(&period_xact_t::period)) diff --git a/src/pyinterp.cc b/src/pyinterp.cc index e0801604..e0fd2d59 100644 --- a/src/pyinterp.cc +++ b/src/pyinterp.cc @@ -126,7 +126,7 @@ void python_interpreter_t::initialize() void python_interpreter_t::hack_system_paths() { // Hack ledger.__path__ so it points to a real location - python::object sys_module = python::import("sys"); + python::object sys_module = python::import("sys"); python::object sys_dict = sys_module.attr("__dict__"); python::list paths(sys_dict["path"]); @@ -177,7 +177,7 @@ object python_interpreter_t::import_into_main(const string& str) if (! mod) throw_(std::runtime_error, _("Failed to import Python module %1") << str); - + // Import all top-level entries directly into the main namespace main_nspace.update(mod.attr("__dict__")); @@ -193,7 +193,7 @@ object python_interpreter_t::import_option(const string& str) { path file(str); - python::object sys_module = python::import("sys"); + python::object sys_module = python::import("sys"); python::object sys_dict = sys_module.attr("__dict__"); python::list paths(sys_dict["path"]); @@ -312,7 +312,7 @@ value_t python_interpreter_t::python_command(call_scope_t& args) delete[] argv; throw; } - + for (std::size_t i = 0; i < args.size() + 1; i++) delete[] argv[i]; delete[] argv; @@ -445,7 +445,7 @@ namespace { } } } - + value_t python_interpreter_t::functor_t::operator()(call_scope_t& args) { try { diff --git a/src/pyinterp.h b/src/pyinterp.h index 1dfd0747..ea947c5a 100644 --- a/src/pyinterp.h +++ b/src/pyinterp.h @@ -48,7 +48,7 @@ public: : session_t(), main_nspace(), is_initialized(false) { TRACE_CTOR(python_interpreter_t, ""); } - + virtual ~python_interpreter_t() { TRACE_DTOR(python_interpreter_t); diff --git a/src/pyutils.h b/src/pyutils.h index efb1b858..7e016502 100644 --- a/src/pyutils.h +++ b/src/pyutils.h @@ -173,7 +173,7 @@ namespace boost { namespace python { arg_to_python(T const& x) \ : python::handle<>(expr) {} \ }; \ - } + } // Specialize argument and return value converters for T using expr # define BOOST_PYTHON_TO_PYTHON_BY_VALUE(T, expr, pytype) \ diff --git a/src/query.cc b/src/query.cc index b93c6534..5c11add5 100644 --- a/src/query.cc +++ b/src/query.cc @@ -295,7 +295,7 @@ query_t::parser_t::parse_query_term(query_t::lexer_t::token_t::kind_t tok_contex if (tok.kind != lexer_t::token_t::TERM) throw_(parse_error, _("Metadata equality operator not followed by term")); - + expr_t::ptr_op_t arg2 = new expr_t::op_t(expr_t::op_t::VALUE); assert(tok.value); arg2->set_value(mask_t(*tok.value)); @@ -309,7 +309,7 @@ query_t::parser_t::parse_query_term(query_t::lexer_t::token_t::kind_t tok_contex } break; } - + default: { node = new expr_t::op_t(expr_t::op_t::O_MATCH); diff --git a/src/report.cc b/src/report.cc index 473308a0..d3a219a0 100644 --- a/src/report.cc +++ b/src/report.cc @@ -289,7 +289,7 @@ void report_t::parse_query_args(const value_t& args, const string& whence) normalize_period(); // it needs normalization } -} +} namespace { struct posts_flusher diff --git a/src/report.h b/src/report.h index d0a49476..e142b0dc 100644 --- a/src/report.h +++ b/src/report.h @@ -68,7 +68,7 @@ class xact_t; // --- The details of #1 and #2 together represent the ItemHandler. // // 3. Mode of the report. Currently there are four modes: -// +// // a. Posting or commodity iteration. In this mode, all the journal's // xacts, the postings of a specific xact, or all the journal's // commodities are walked. In the first two cases, it's the underlying @@ -86,7 +86,7 @@ class xact_t; // c. Write journal. In this mode, a single function is called that output // the journal object as a textual file. #2 is used to print out each // posting in the journal. -// +// // d. Dump binary file. This is just like 'c', except that it dumps out a // binary file and #2 is completely ignored. // diff --git a/src/scope.h b/src/scope.h index ea030b16..71894d00 100644 --- a/src/scope.h +++ b/src/scope.h @@ -646,7 +646,7 @@ class value_scope_t : public child_scope_t public: value_scope_t(scope_t& _parent, const value_t& _value) : child_scope_t(_parent), value(_value) {} - + virtual string description() { return parent->description(); } diff --git a/src/session.cc b/src/session.cc index fdb0ad1d..72e29895 100644 --- a/src/session.cc +++ b/src/session.cc @@ -178,7 +178,7 @@ void session_t::close_journal_files() { journal.reset(); amount_t::shutdown(); - + journal.reset(new journal_t); amount_t::initialize(); } diff --git a/src/system.hh.in b/src/system.hh.in index 2077d3a8..f063a761 100644 --- a/src/system.hh.in +++ b/src/system.hh.in @@ -205,7 +205,7 @@ namespace serialization { template <class Archive> void serialize(Archive& ar, boost::filesystem::path& p, const unsigned int) { - std::string s; + std::string s; if (Archive::is_saving::value) s = p.string(); diff --git a/src/textual.cc b/src/textual.cc index ecdf53d4..341271b6 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -129,7 +129,7 @@ namespace { (in.peek() == ' ' || in.peek() == '\t')); } - void read_next_directive(); + void read_next_directive(); #if defined(TIMELOG_SUPPORT) void clock_in_directive(char * line, bool capitalized); @@ -270,7 +270,7 @@ void instance_t::parse() string err_context = error_context(); if (! err_context.empty()) std::cerr << err_context << std::endl; - + if (! current_context.empty()) std::cerr << current_context << std::endl; @@ -442,7 +442,7 @@ void instance_t::clock_in_directive(char * line, bool /*capitalized*/) } void instance_t::clock_out_directive(char * line, bool /*capitalized*/) -{ +{ string datetime(line, 2, 19); char * p = skip_ws(line + 22); @@ -546,7 +546,7 @@ void instance_t::automated_xact_directive(char * line) try { query_t query; keep_details_t keeper(true, true, true); - expr_t::ptr_op_t expr = + expr_t::ptr_op_t expr = query.parse_args(string_value(skip_ws(line + 1)).to_sequence(), keeper, false, true); @@ -831,7 +831,7 @@ void instance_t::alias_directive(char * line) void instance_t::fixed_directive(char * line) { - if (optional<std::pair<commodity_t *, price_point_t> > price_point = + if (optional<std::pair<commodity_t *, price_point_t> > price_point = commodity_pool_t::current_pool->parse_price_directive(trim_ws(line), true)) { context.state_stack.push_front(fixed_rate_t(price_point->first, diff --git a/src/times.cc b/src/times.cc index 851da938..7fc9c21e 100644 --- a/src/times.cc +++ b/src/times.cc @@ -280,7 +280,7 @@ optional<date_time::weekdays> string_to_day_of_week(const std::string& str) else return none; } - + optional<date_time::months_of_year> string_to_month_of_year(const std::string& str) { diff --git a/src/times.h b/src/times.h index 1ff08739..fed47ae3 100644 --- a/src/times.h +++ b/src/times.h @@ -203,7 +203,7 @@ struct date_duration_t } ~date_duration_t() throw() { TRACE_DTOR(date_duration_t); - } + } date_t add(const date_t& date) const { switch (quantum) { @@ -431,7 +431,7 @@ public: out << "from" << range_begin->to_string(); if (range_end) out << " to" << range_end->to_string(); - + return out.str(); } diff --git a/src/value.cc b/src/value.cc index 6de40d5b..1ecfffe7 100644 --- a/src/value.cc +++ b/src/value.cc @@ -760,7 +760,7 @@ bool value_t::is_equal_to(const value_t& val) const switch (type()) { case VOID: return val.type() == VOID; - + case BOOLEAN: if (val.is_boolean()) return as_boolean() == val.as_boolean(); diff --git a/src/value.h b/src/value.h index 1176ad09..7c507712 100644 --- a/src/value.h +++ b/src/value.h @@ -139,7 +139,7 @@ private: scope_t *, // SCOPE boost::any // ANY > data; - + type_t type; /** diff --git a/src/xact.cc b/src/xact.cc index 1acbd0a4..7f0b1afe 100644 --- a/src/xact.cc +++ b/src/xact.cc @@ -192,7 +192,7 @@ bool xact_base_t::finalize() DEBUG("xact.finalize", "there were no costs, and a valid top_post"); balance_t::amounts_map::const_iterator a = bal.amounts.begin(); - + const amount_t * x = &(*a++).second; const amount_t * y = &(*a++).second; @@ -418,7 +418,7 @@ bool xact_base_t::verify() amount_t& p(post->cost ? *post->cost : post->amount); assert(! p.is_null()); - + // If the amount was a cost, it very likely has the "keep_precision" flag // set, meaning commodity display precision is ignored when displaying the // amount. We never want this set for the balance, so we must clear the @@ -609,7 +609,7 @@ namespace { .match(post.reported_account()->fullname()); else break; - + case expr_t::op_t::O_NOT: return ! post_pred(op->left(), post); @@ -61,7 +61,7 @@ public: xact_base_t() : item_t(), journal(NULL) { TRACE_CTOR(xact_base_t, ""); } - xact_base_t(const xact_base_t& e); + xact_base_t(const xact_base_t& e); virtual ~xact_base_t(); diff --git a/tools/configure.ac b/tools/configure.ac index c3a913e6..e078ebc4 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -66,7 +66,7 @@ AC_ARG_ENABLE(doxygen, AM_CONDITIONAL(USE_DOXYGEN, test x$doxygen = xtrue) AC_ARG_ENABLE(cache, - [ --enable-cache Enable use of the --cache option], + [ --enable-cache Enable use of the --cache option], [case "${enableval}" in yes) cache=true ;; no) cache=false ;; @@ -76,7 +76,7 @@ AC_ARG_ENABLE(cache, AM_CONDITIONAL(USE_CACHE_OPTION, test x$cache = xtrue) AC_ARG_ENABLE(python, - [ --enable-python Turn on Python support (experimental)], + [ --enable-python Turn on Python support (experimental)], [case "${enableval}" in yes) python=true ;; no) python=false ;; |