diff options
author | John Wiegley <johnw@newartisans.com> | 2009-03-04 04:31:34 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-03-04 04:31:34 -0400 |
commit | 9d4e888ef57ef70acb22830c5bfb5e917208113e (patch) | |
tree | b82484469989cfa6f546d1827dfd382b3de8dfe1 | |
parent | 2d63c9364af57c732003afc7adddeb8ce62a1988 (diff) | |
download | fork-ledger-9d4e888ef57ef70acb22830c5bfb5e917208113e.tar.gz fork-ledger-9d4e888ef57ef70acb22830c5bfb5e917208113e.tar.bz2 fork-ledger-9d4e888ef57ef70acb22830c5bfb5e917208113e.zip |
Cured several harmless compiler warnings
-rw-r--r-- | src/commodity.cc | 2 | ||||
-rw-r--r-- | src/format.cc | 3 | ||||
-rw-r--r-- | src/global.cc | 2 | ||||
-rw-r--r-- | src/item.cc | 2 | ||||
-rw-r--r-- | src/stream.cc | 3 | ||||
-rw-r--r-- | src/xact.cc | 4 |
6 files changed, 12 insertions, 4 deletions
diff --git a/src/commodity.cc b/src/commodity.cc index 243d2a6c..71658103 100644 --- a/src/commodity.cc +++ b/src/commodity.cc @@ -402,10 +402,12 @@ commodity_t::exchange(const amount_t& amount, { DEBUG("commodity.prices.add", "exchange: " << amount << " for " << cost); DEBUG("commodity.prices.add", "exchange: is-per-unit = " << is_per_unit); +#if defined(DEBUG_ON) if (moment) DEBUG("commodity.prices.add", "exchange: moment = " << *moment); if (tag) DEBUG("commodity.prices.add", "exchange: tag = " << *tag); +#endif commodity_t& commodity(amount.commodity()); diff --git a/src/format.cc b/src/format.cc index 4a48808a..79f95375 100644 --- a/src/format.cc +++ b/src/format.cc @@ -360,7 +360,8 @@ void format_t::format(std::ostream& out_str, scope_t& scope) result = truncate(temp, elem->max_width); } else { result = temp.extract(); - for (int i = 0; i < (int)elem->min_width - (int)temp.length(); i++) + for (int i = 0; i < (static_cast<int>(elem->min_width) - + static_cast<int>(temp.length())); i++) result += " "; } out_str << result; diff --git a/src/global.cc b/src/global.cc index dc21012c..51760436 100644 --- a/src/global.cc +++ b/src/global.cc @@ -477,7 +477,7 @@ void global_scope_t::visit_man_page() const throw std::logic_error(_("Failed to fork child process")); } else if (pid == 0) { // child - execlp("man", "man", "1", "ledger", (char *)0); + execlp("man", "man", "1", "ledger", NULL); // We should never, ever reach here perror("execlp: man"); diff --git a/src/item.cc b/src/item.cc index 426a2f1c..032a84cf 100644 --- a/src/item.cc +++ b/src/item.cc @@ -43,12 +43,14 @@ bool item_t::has_tag(const string& tag) const return false; } string_map::const_iterator i = metadata->find(tag); +#if defined(DEBUG_ON) if (SHOW_DEBUG("item.meta")) { if (i == metadata->end()) DEBUG("item.meta", "Item does not have this tag"); else DEBUG("item.meta", "Item has the tag!"); } +#endif return i != metadata->end(); } diff --git a/src/stream.cc b/src/stream.cc index 5c109831..18f730a2 100644 --- a/src/stream.cc +++ b/src/stream.cc @@ -90,8 +90,7 @@ namespace { #else path basename(pager_path.leaf()); #endif - execlp(pager_path.string().c_str(), basename.string().c_str(), - (char *)0); + execlp(pager_path.string().c_str(), basename.string().c_str(), NULL); // We should never, ever reach here perror((std::string("execlp: ") + pager_path.string()).c_str()); diff --git a/src/xact.cc b/src/xact.cc index 5013ec15..132f2ebf 100644 --- a/src/xact.cc +++ b/src/xact.cc @@ -431,8 +431,10 @@ void auto_xact_t::extend_xact(xact_base_t& xact, bool post_handler) << "amount " << initial_post->amount << " (precision " << initial_post->amount.precision() << ")"); +#if defined(DEBUG_ON) if (initial_post->amount.keep_precision()) DEBUG("xact.extend", " precision is kept"); +#endif DEBUG("xact.extend", "Posting on line " << post->beg_line << ": " @@ -440,10 +442,12 @@ void auto_xact_t::extend_xact(xact_base_t& xact, bool post_handler) << " (precision " << post->amount.precision() << " != " << amt.precision() << ")"); +#if defined(DEBUG_ON) if (post->amount.keep_precision()) DEBUG("xact.extend", " precision is kept"); if (amt.keep_precision()) DEBUG("xact.extend", " amt precision is kept"); +#endif } account_t * account = post->account; |