Whitespace fix

This commit is contained in:
John Wiegley 2012-04-04 01:36:31 -05:00
parent 1809e63fb0
commit fcabd64a89
5 changed files with 22 additions and 28 deletions

View file

@ -117,8 +117,7 @@ item_t::set_tag(const string& tag,
<< (value ? *value : string_value("<none>")) << "'"); << (value ? *value : string_value("<none>")) << "'");
optional<value_t> data = value; optional<value_t> data = value;
if (data && if (data && (data->is_null() ||
(data->is_null() ||
(data->is_string() && data->as_string().empty()))) (data->is_string() && data->as_string().empty())))
data = none; data = none;

View file

@ -118,8 +118,7 @@ public:
optional<string_map> metadata; optional<string_map> metadata;
item_t(flags_t _flags = ITEM_NORMAL, const optional<string>& _note = none) item_t(flags_t _flags = ITEM_NORMAL, const optional<string>& _note = none)
: supports_flags<uint_least16_t>(_flags), _state(UNCLEARED), : supports_flags<uint_least16_t>(_flags), _state(UNCLEARED), note(_note)
note(_note)
{ {
TRACE_CTOR(item_t, "flags_t, const string&"); TRACE_CTOR(item_t, "flags_t, const string&");
} }

View file

@ -93,17 +93,11 @@ date_t post_t::date() const
return xdata_->date; return xdata_->date;
if (item_t::use_aux_date) { if (item_t::use_aux_date) {
if (_date_aux) if (optional<date_t> aux = aux_date())
return *_date_aux; return *aux;
else if (xact && xact->_date_aux)
return *xact->_date_aux;
} }
if (! _date) { return primary_date();
assert(xact);
return xact->date();
}
return *_date;
} }
date_t post_t::primary_date() const date_t post_t::primary_date() const
@ -174,7 +168,8 @@ namespace {
return string_value(post.payee()); return string_value(post.payee());
} }
value_t get_note(post_t& post) { value_t get_note(post_t& post)
{
if (post.note || post.xact->note) { if (post.note || post.xact->note) {
string note = post.note ? *post.note : empty_string; string note = post.note ? *post.note : empty_string;
note += post.xact->note ? *post.xact->note : empty_string; note += post.xact->note ? *post.xact->note : empty_string;
@ -188,7 +183,8 @@ namespace {
return post.xact->magnitude(); return post.xact->magnitude();
} }
value_t get_amount(post_t& post) { value_t get_amount(post_t& post)
{
if (post.has_xdata() && post.xdata().has_flags(POST_EXT_COMPOUND)) if (post.has_xdata() && post.xdata().has_flags(POST_EXT_COMPOUND))
return post.xdata().compound_value; return post.xdata().compound_value;
else if (post.amount.is_null()) else if (post.amount.is_null())
@ -215,7 +211,8 @@ namespace {
} }
} }
value_t get_commodity_is_primary(post_t& post) { value_t get_commodity_is_primary(post_t& post)
{
if (post.has_xdata() && if (post.has_xdata() &&
post.xdata().has_flags(POST_EXT_COMPOUND)) post.xdata().has_flags(POST_EXT_COMPOUND))
return post.xdata().compound_value.to_amount() return post.xdata().compound_value.to_amount()

View file

@ -1124,8 +1124,7 @@ void instance_t::tag_directive(char * line)
if (keyword == "assert" || keyword == "check") { if (keyword == "assert" || keyword == "check") {
context.journal->tag_check_exprs.insert context.journal->tag_check_exprs.insert
(tag_check_exprs_map::value_type (tag_check_exprs_map::value_type
(string(p), (string(p), expr_t::check_expr_pair(expr_t(b),
expr_t::check_expr_pair(expr_t(b),
keyword == "assert" ? keyword == "assert" ?
expr_t::EXPR_ASSERTION : expr_t::EXPR_ASSERTION :
expr_t::EXPR_CHECK))); expr_t::EXPR_CHECK)));