Corrected several compile and link problems
This commit is contained in:
parent
488355e5d9
commit
71d0033b6f
13 changed files with 62 additions and 20 deletions
|
|
@ -89,8 +89,10 @@ account_t * account_t::find_account(const string& acct_name,
|
||||||
if (has_flags(ACCOUNT_GENERATED))
|
if (has_flags(ACCOUNT_GENERATED))
|
||||||
account->add_flags(ACCOUNT_GENERATED);
|
account->add_flags(ACCOUNT_GENERATED);
|
||||||
|
|
||||||
std::pair<accounts_map::iterator, bool> result
|
#if defined(DEBUG_ON)
|
||||||
= accounts.insert(accounts_map::value_type(first, account));
|
std::pair<accounts_map::iterator, bool> result =
|
||||||
|
#endif
|
||||||
|
accounts.insert(accounts_map::value_type(first, account));
|
||||||
assert(result.second);
|
assert(result.second);
|
||||||
} else {
|
} else {
|
||||||
account = (*i).second;
|
account = (*i).second;
|
||||||
|
|
|
||||||
|
|
@ -120,11 +120,13 @@ namespace {
|
||||||
{
|
{
|
||||||
char * buf = NULL;
|
char * buf = NULL;
|
||||||
try {
|
try {
|
||||||
|
#if defined(DEBUG_ON)
|
||||||
IF_DEBUG("amount.convert") {
|
IF_DEBUG("amount.convert") {
|
||||||
char * tbuf = mpq_get_str(NULL, 10, quant);
|
char * tbuf = mpq_get_str(NULL, 10, quant);
|
||||||
DEBUG("amount.convert", "Rational to convert = " << tbuf);
|
DEBUG("amount.convert", "Rational to convert = " << tbuf);
|
||||||
std::free(tbuf);
|
std::free(tbuf);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Convert the rational number to a floating-point, extending the
|
// Convert the rational number to a floating-point, extending the
|
||||||
// floating-point to a large enough size to get a precise answer.
|
// floating-point to a large enough size to get a precise answer.
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,14 @@ void draft_t::parse_args(const value_t& args)
|
||||||
}
|
}
|
||||||
else if (check_for_date &&
|
else if (check_for_date &&
|
||||||
bool(weekday = string_to_day_of_week(what[0]))) {
|
bool(weekday = string_to_day_of_week(what[0]))) {
|
||||||
|
#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||||
|
#endif
|
||||||
short dow = static_cast<short>(*weekday);
|
short dow = static_cast<short>(*weekday);
|
||||||
|
#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
date_t date = CURRENT_DATE() - date_duration(1);
|
date_t date = CURRENT_DATE() - date_duration(1);
|
||||||
while (date.day_of_week() != dow)
|
while (date.day_of_week() != dow)
|
||||||
date -= date_duration(1);
|
date -= date_duration(1);
|
||||||
|
|
|
||||||
|
|
@ -833,10 +833,17 @@ void subtotal_posts::report_subtotal(const char * spec_fmt,
|
||||||
foreach (post_t * post, component_posts) {
|
foreach (post_t * post, component_posts) {
|
||||||
date_t date = post->date();
|
date_t date = post->date();
|
||||||
date_t value_date = post->value_date();
|
date_t value_date = post->value_date();
|
||||||
|
#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||||
|
#endif
|
||||||
if (! range_start || date < *range_start)
|
if (! range_start || date < *range_start)
|
||||||
range_start = date;
|
range_start = date;
|
||||||
if (! range_finish || value_date > *range_finish)
|
if (! range_finish || value_date > *range_finish)
|
||||||
range_finish = value_date;
|
range_finish = value_date;
|
||||||
|
#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
component_posts.clear();
|
component_posts.clear();
|
||||||
|
|
@ -880,8 +887,10 @@ void subtotal_posts::operator()(post_t& post)
|
||||||
if (i == values.end()) {
|
if (i == values.end()) {
|
||||||
value_t temp;
|
value_t temp;
|
||||||
post.add_to_value(temp, amount_expr);
|
post.add_to_value(temp, amount_expr);
|
||||||
std::pair<values_map::iterator, bool> result
|
#if defined(DEBUG_ON)
|
||||||
= values.insert(values_pair(acct->fullname(), acct_value_t(acct, temp)));
|
std::pair<values_map::iterator, bool> result =
|
||||||
|
#endif
|
||||||
|
values.insert(values_pair(acct->fullname(), acct_value_t(acct, temp)));
|
||||||
assert(result.second);
|
assert(result.second);
|
||||||
} else {
|
} else {
|
||||||
post.add_to_value((*i).second.value, amount_expr);
|
post.add_to_value((*i).second.value, amount_expr);
|
||||||
|
|
|
||||||
|
|
@ -221,8 +221,10 @@ format_t::element_t * format_t::parse_elements(const string& fmt,
|
||||||
static_cast<int>(current->max_width) : -1);
|
static_cast<int>(current->max_width) : -1);
|
||||||
else if (keyword == "left")
|
else if (keyword == "left")
|
||||||
expr << (current->has_flags(ELEMENT_ALIGN_LEFT) ? "false" : "true");
|
expr << (current->has_flags(ELEMENT_ALIGN_LEFT) ? "false" : "true");
|
||||||
|
#if defined(DEBUG_ON)
|
||||||
else
|
else
|
||||||
assert("Unrecognized format substitution keyword" == NULL);
|
assert("Unrecognized format substitution keyword" == NULL);
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
expr << *ptr++;
|
expr << *ptr++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
10
src/op.cc
10
src/op.cc
|
|
@ -38,6 +38,16 @@
|
||||||
|
|
||||||
namespace ledger {
|
namespace ledger {
|
||||||
|
|
||||||
|
void intrusive_ptr_add_ref(const expr_t::op_t * op)
|
||||||
|
{
|
||||||
|
op->acquire();
|
||||||
|
}
|
||||||
|
|
||||||
|
void intrusive_ptr_release(const expr_t::op_t * op)
|
||||||
|
{
|
||||||
|
op->release();
|
||||||
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
value_t split_cons_expr(expr_t::ptr_op_t op)
|
value_t split_cons_expr(expr_t::ptr_op_t op)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
8
src/op.h
8
src/op.h
|
|
@ -260,12 +260,8 @@ private:
|
||||||
checked_delete(this);
|
checked_delete(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
friend inline void intrusive_ptr_add_ref(const op_t * op) {
|
friend void intrusive_ptr_add_ref(const op_t * op);
|
||||||
op->acquire();
|
friend void intrusive_ptr_release(const op_t * op);
|
||||||
}
|
|
||||||
friend inline void intrusive_ptr_release(const op_t * op) {
|
|
||||||
op->release();
|
|
||||||
}
|
|
||||||
|
|
||||||
ptr_op_t copy(ptr_op_t _left = NULL, ptr_op_t _right = NULL) const {
|
ptr_op_t copy(ptr_op_t _left = NULL, ptr_op_t _right = NULL) const {
|
||||||
ptr_op_t node(new_node(kind, _left, _right));
|
ptr_op_t node(new_node(kind, _left, _right));
|
||||||
|
|
|
||||||
18
src/pool.cc
18
src/pool.cc
|
|
@ -70,9 +70,11 @@ commodity_t * commodity_pool_t::create(const string& symbol)
|
||||||
DEBUG("pool.commodities",
|
DEBUG("pool.commodities",
|
||||||
"Creating commodity '" << commodity->symbol() << "'");
|
"Creating commodity '" << commodity->symbol() << "'");
|
||||||
|
|
||||||
std::pair<commodities_map::iterator, bool> result
|
#if defined(DEBUG_ON)
|
||||||
= commodities.insert(commodities_map::value_type
|
std::pair<commodities_map::iterator, bool> result =
|
||||||
(commodity->base_symbol(), commodity));
|
#endif
|
||||||
|
commodities.insert(commodities_map::value_type
|
||||||
|
(commodity->base_symbol(), commodity));
|
||||||
assert(result.second);
|
assert(result.second);
|
||||||
|
|
||||||
commodity_price_history.add_commodity(*commodity.get());
|
commodity_price_history.add_commodity(*commodity.get());
|
||||||
|
|
@ -211,10 +213,12 @@ commodity_pool_t::create(commodity_t& comm,
|
||||||
<< "symbol " << commodity->symbol()
|
<< "symbol " << commodity->symbol()
|
||||||
<< std::endl << details);
|
<< std::endl << details);
|
||||||
|
|
||||||
std::pair<annotated_commodities_map::iterator, bool> result
|
#if defined(DEBUG_ON)
|
||||||
= annotated_commodities.insert(annotated_commodities_map::value_type
|
std::pair<annotated_commodities_map::iterator, bool> result =
|
||||||
(annotated_commodities_map::key_type
|
#endif
|
||||||
(comm.symbol(), details), commodity));
|
annotated_commodities.insert(annotated_commodities_map::value_type
|
||||||
|
(annotated_commodities_map::key_type
|
||||||
|
(comm.symbol(), details), commodity));
|
||||||
assert(result.second);
|
assert(result.second);
|
||||||
|
|
||||||
return commodity.get();
|
return commodity.get();
|
||||||
|
|
|
||||||
|
|
@ -535,6 +535,7 @@ namespace {
|
||||||
case value_t::ANY: // a pointer to an arbitrary object
|
case value_t::ANY: // a pointer to an arbitrary object
|
||||||
return object(val);
|
return object(val);
|
||||||
}
|
}
|
||||||
|
return object();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,7 @@ public:
|
||||||
assert(false);
|
assert(false);
|
||||||
return "<UNKNOWN>";
|
return "<UNKNOWN>";
|
||||||
}
|
}
|
||||||
|
return "<ERROR>";
|
||||||
}
|
}
|
||||||
|
|
||||||
void unexpected();
|
void unexpected();
|
||||||
|
|
|
||||||
|
|
@ -107,10 +107,12 @@ namespace {
|
||||||
return (in.good() && ! in.eof() &&
|
return (in.good() && ! in.eof() &&
|
||||||
(in.peek() == ' ' || in.peek() == '\t'));
|
(in.peek() == ' ' || in.peek() == '\t'));
|
||||||
}
|
}
|
||||||
|
#if defined(HAVE_BOOST_PYTHON)
|
||||||
bool peek_blank_line() {
|
bool peek_blank_line() {
|
||||||
return (in.good() && ! in.eof() &&
|
return (in.good() && ! in.eof() &&
|
||||||
(in.peek() == '\n' || in.peek() == '\r'));
|
(in.peek() == '\n' || in.peek() == '\r'));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void read_next_directive();
|
void read_next_directive();
|
||||||
|
|
||||||
|
|
@ -943,9 +945,11 @@ void instance_t::account_alias_directive(account_t * account, string alias)
|
||||||
// (account), add a reference to the account in the `account_aliases'
|
// (account), add a reference to the account in the `account_aliases'
|
||||||
// map, which is used by the post parser to resolve alias references.
|
// map, which is used by the post parser to resolve alias references.
|
||||||
trim(alias);
|
trim(alias);
|
||||||
std::pair<accounts_map::iterator, bool> result
|
#if defined(DEBUG_ON)
|
||||||
= context.journal
|
std::pair<accounts_map::iterator, bool> result =
|
||||||
->account_aliases.insert(accounts_map::value_type(alias, account));
|
#endif
|
||||||
|
context.journal->account_aliases.insert
|
||||||
|
(accounts_map::value_type(alias, account));
|
||||||
assert(result.second);
|
assert(result.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -218,6 +218,7 @@ struct date_duration_t
|
||||||
case YEARS:
|
case YEARS:
|
||||||
return date + gregorian::years(length);
|
return date + gregorian::years(length);
|
||||||
}
|
}
|
||||||
|
return date_t();
|
||||||
}
|
}
|
||||||
|
|
||||||
date_t subtract(const date_t& date) const {
|
date_t subtract(const date_t& date) const {
|
||||||
|
|
@ -233,6 +234,7 @@ struct date_duration_t
|
||||||
case YEARS:
|
case YEARS:
|
||||||
return date - gregorian::years(length);
|
return date - gregorian::years(length);
|
||||||
}
|
}
|
||||||
|
return date_t();
|
||||||
}
|
}
|
||||||
|
|
||||||
string to_string() const {
|
string to_string() const {
|
||||||
|
|
|
||||||
|
|
@ -336,7 +336,9 @@ bool xact_base_t::finalize()
|
||||||
amount_t> sorted_amounts_map;
|
amount_t> sorted_amounts_map;
|
||||||
sorted_amounts_map samp;
|
sorted_amounts_map samp;
|
||||||
foreach (const balance_t::amounts_map::value_type& pair, bal.amounts) {
|
foreach (const balance_t::amounts_map::value_type& pair, bal.amounts) {
|
||||||
|
#if defined(DEBUG_ON)
|
||||||
std::pair<sorted_amounts_map::iterator, bool> result =
|
std::pair<sorted_amounts_map::iterator, bool> result =
|
||||||
|
#endif
|
||||||
samp.insert(sorted_amounts_map::value_type
|
samp.insert(sorted_amounts_map::value_type
|
||||||
(sorted_amounts_map::key_type
|
(sorted_amounts_map::key_type
|
||||||
(pair.first->symbol(),
|
(pair.first->symbol(),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue