From e35394a70defbffc7464713aaa700693e97ef358 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 12 Nov 2009 18:23:22 -0500 Subject: --data shouldn't modify the underlying item --- src/filters.cc | 2 +- src/item.h | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/filters.cc b/src/filters.cc index 8c5d099e..811067fc 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -710,7 +710,7 @@ void transfer_details::operator()(post_t& post) switch (which_element) { case SET_DATE: - xact.set_date(substitute.to_date()); + temp.xdata().date = substitute.to_date(); break; case SET_ACCOUNT: { diff --git a/src/item.h b/src/item.h index 13332f0b..84385eb7 100644 --- a/src/item.h +++ b/src/item.h @@ -172,12 +172,6 @@ public: virtual optional effective_date() const { return _date_eff; } - virtual void set_date(const date_t& date) { - if (use_effective_date) - _date_eff = date; - else - _date = date; - } void set_state(state_t new_state) { _state = new_state; -- cgit v1.2.3 From f50ea971ef12929d015657f22942b1cc0e328165 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 13 Nov 2009 01:48:13 -0500 Subject: Fixed some debug output --- src/utils.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/utils.cc b/src/utils.cc index d661f410..f2460ba1 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -550,8 +550,13 @@ bool logger_func(log_level_t level) logger_has_run = true; logger_start = TRUE_CURRENT_TIME(); +#if defined(VERIFY_ON) IF_VERIFY() *_log_stream << " TIME OBJSZ MEMSZ" << std::endl; +#else + IF_VERIFY() + *_log_stream << " TIME" << std::endl; +#endif } *_log_stream << std::right << std::setw(5) -- cgit v1.2.3 From 2986bc779e055fe8bd3511994c539d65d3a7aa57 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 13 Nov 2009 01:48:32 -0500 Subject: Stylistic change: assert(0) -> assert(false) --- src/draft.h | 2 +- src/query.cc | 2 +- src/query.h | 4 ++-- src/times.cc | 8 ++++---- src/times.h | 4 ++-- src/value.cc | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/draft.h b/src/draft.h index 277b4ff8..003dcefa 100644 --- a/src/draft.h +++ b/src/draft.h @@ -93,7 +93,7 @@ public: void parse_args(const value_t& args); virtual result_type real_calc(scope_t&) { - assert(0); + assert(false); return true; } diff --git a/src/query.cc b/src/query.cc index de1c5631..21304f92 100644 --- a/src/query.cc +++ b/src/query.cc @@ -333,7 +333,7 @@ query_t::parser_t::parse_query_term(query_t::lexer_t::token_t::kind_t tok_contex case lexer_t::token_t::TOK_NOTE: ident->set_ident("note"); break; default: - assert(0); break; + assert(false); break; } expr_t::ptr_op_t mask = new expr_t::op_t(expr_t::op_t::VALUE); diff --git a/src/query.h b/src/query.h index e3545396..73639263 100644 --- a/src/query.h +++ b/src/query.h @@ -157,12 +157,12 @@ public: case END_REACHED: return ""; case TERM: - assert(0); + assert(false); return ""; case UNKNOWN: default: - assert(0); + assert(false); return ""; } } diff --git a/src/times.cc b/src/times.cc index b737b2a0..6afbab0a 100644 --- a/src/times.cc +++ b/src/times.cc @@ -789,8 +789,8 @@ std::string format_datetime(const datetime_t& when, return printed_datetime_io->format(when); } else { - assert(0); - return ""; + assert(false); + return empty_string; } } @@ -815,8 +815,8 @@ std::string format_date(const date_t& when, return printed_date_io->format(when); } else { - assert(0); - return ""; + assert(false); + return empty_string; } } diff --git a/src/times.h b/src/times.h index 3cd359d2..77f25d9e 100644 --- a/src/times.h +++ b/src/times.h @@ -174,7 +174,7 @@ public: case YEARS: return date + gregorian::years(length); default: - assert(0); return date_t(); + assert(false); return date_t(); } } @@ -189,7 +189,7 @@ public: case YEARS: return date - gregorian::years(length); default: - assert(0); return date_t(); + assert(false); return date_t(); } } diff --git a/src/value.cc b/src/value.cc index 910a9140..ce852c2d 100644 --- a/src/value.cc +++ b/src/value.cc @@ -696,7 +696,7 @@ value_t& value_t::operator/=(const value_t& val) as_amount_lval() /= simpler.as_amount(); break; default: - assert(0); + assert(false); break; } return *this; -- cgit v1.2.3