summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-10-31 04:50:07 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-10-31 04:50:07 -0400
commit3909d2678ede154f9a7fe19617973d4daa173c47 (patch)
treeb8d85010bae44f1f4c7020d68e8b840b81da354f /src
parent97a9b42b2c5ef908e0c47ecfd39771a79f8fa8a2 (diff)
downloadfork-ledger-3909d2678ede154f9a7fe19617973d4daa173c47.tar.gz
fork-ledger-3909d2678ede154f9a7fe19617973d4daa173c47.tar.bz2
fork-ledger-3909d2678ede154f9a7fe19617973d4daa173c47.zip
Removed most #if 0 blocks and callout comments
Diffstat (limited to 'src')
-rw-r--r--src/balance.cc5
-rw-r--r--src/commodity.cc6
-rw-r--r--src/derive.cc2
-rw-r--r--src/emacs.cc2
-rw-r--r--src/filters.cc1
-rw-r--r--src/generate.cc2
-rw-r--r--src/global.cc4
-rw-r--r--src/item.h1
-rw-r--r--src/post.cc4
-rw-r--r--src/py_amount.cc58
-rw-r--r--src/py_value.cc2
-rw-r--r--src/quotes.cc3
-rw-r--r--src/report.cc8
-rw-r--r--src/session.cc2
-rw-r--r--src/stats.cc6
-rw-r--r--src/textual.cc19
-rw-r--r--src/xact.cc4
-rw-r--r--src/xact.h2
18 files changed, 9 insertions, 122 deletions
diff --git a/src/balance.cc b/src/balance.cc
index 37628bd2..1c096e01 100644
--- a/src/balance.cc
+++ b/src/balance.cc
@@ -33,6 +33,7 @@
#include "balance.h"
#include "commodity.h"
+#include "annotate.h"
#include "pool.h"
#include "unistring.h" // for justify()
@@ -220,10 +221,9 @@ balance_t::commodity_amount(const optional<const commodity_t&>& commodity) const
if (amounts.size() == 1) {
return amounts.begin()->second;
}
-#if 0
else if (amounts.size() > 1) {
// Try stripping annotations before giving an error.
- balance_t temp(strip_annotations());
+ balance_t temp(strip_annotations(keep_details_t()));
if (temp.amounts.size() == 1)
return temp.commodity_amount(commodity);
@@ -231,7 +231,6 @@ balance_t::commodity_amount(const optional<const commodity_t&>& commodity) const
_("Requested amount of a balance with multiple commodities: %1")
<< temp);
}
-#endif
}
else if (amounts.size() > 0) {
amounts_map::const_iterator i =
diff --git a/src/commodity.cc b/src/commodity.cc
index 54cb02d6..de529ac4 100644
--- a/src/commodity.cc
+++ b/src/commodity.cc
@@ -360,12 +360,6 @@ optional<commodity_t::base_t::history_t&>
if (! commodity) {
if (histories.size() > 1)
return none;
-#if 0
- // jww (2008-09-20): Document which option switch to use here
- throw_(commodity_error,
- _("Cannot determine price history: "
- "prices known for multiple commodities (use -x)"));
-#endif
comm = (*histories.begin()).first;
} else {
comm = &(*commodity);
diff --git a/src/derive.cc b/src/derive.cc
index df27d4b6..d3a7a37d 100644
--- a/src/derive.cc
+++ b/src/derive.cc
@@ -548,7 +548,7 @@ value_t xact_command(call_scope_t& args)
xact_template_t tmpl = args_to_xact_template(begin, end);
std::auto_ptr<xact_t> new_xact(derive_xact_from_template(tmpl, report));
- // jww (2009-02-27): make this more general
+ // Only consider actual postings for the "xact" command
report.HANDLER(limit_).on(string("#xact"), "actual");
report.xact_report(post_handler_ptr
diff --git a/src/emacs.cc b/src/emacs.cc
index 1d3f28a3..dc1a18ae 100644
--- a/src/emacs.cc
+++ b/src/emacs.cc
@@ -44,7 +44,7 @@ void format_emacs_posts::write_xact(xact_t& xact)
<< xact.pos->beg_line << " ";
tm when = gregorian::to_tm(xact.date());
- std::time_t date = std::mktime(&when); // jww (2008-04-20): Is this GMT or local?
+ std::time_t date = std::mktime(&when);
out << "(" << (date / 65536) << " " << (date % 65536) << " 0) ";
diff --git a/src/filters.cc b/src/filters.cc
index fe8761a5..da9e39ae 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -784,7 +784,6 @@ void budget_posts::operator()(post_t& post)
if (acct == (*pair.second).reported_account()) {
post_in_budget = true;
// Report the post as if it had occurred in the parent account.
- // jww (2009-10-27): What about calling add_post here?
if (post.reported_account() != acct)
post.xdata().account = acct;
goto handle;
diff --git a/src/generate.cc b/src/generate.cc
index ebbc3cd7..3549adc8 100644
--- a/src/generate.cc
+++ b/src/generate.cc
@@ -210,13 +210,11 @@ string generate_posts_iterator::generate_amount(std::ostream& out,
generate_amount(buf, value_t(), true);
buf << '}';
}
-#if 0
if (six_gen() == 1) {
buf << " [";
generate_date(buf);
buf << ']';
}
-#endif
if (six_gen() == 1) {
buf << " (";
generate_string(buf, six_gen());
diff --git a/src/global.cc b/src/global.cc
index 9ba2a357..d9028dd7 100644
--- a/src/global.cc
+++ b/src/global.cc
@@ -431,7 +431,6 @@ void global_scope_t::normalize_report_options(const string& verb)
}
#endif
- // jww (2009-02-09): These globals are a hack, but hard to avoid.
item_t::use_effective_date = (rep.HANDLED(effective) &&
! rep.HANDLED(actual_dates));
@@ -458,9 +457,6 @@ void global_scope_t::normalize_report_options(const string& verb)
start_of_week = *weekday;
}
- // jww (2008-08-14): This code really needs to be rationalized away for 3.0.
- // I might be able to do it with command objects, like register_t, which
- // each know how to adjust the report based on its current option settings.
if (verb == "print" || verb == "xact" || verb == "dump") {
rep.HANDLER(related).on_only(string("?normalize"));
rep.HANDLER(related_all).on_only(string("?normalize"));
diff --git a/src/item.h b/src/item.h
index 5518a063..28eb3f80 100644
--- a/src/item.h
+++ b/src/item.h
@@ -106,7 +106,6 @@ class item_t : public supports_flags<>, public scope_t
{
public:
#define ITEM_NORMAL 0x00 // no flags at all, a basic posting
-// jww (2009-10-27): I'm not consistent on the difference between these two.
#define ITEM_GENERATED 0x01 // posting was not found in a journal
#define ITEM_TEMP 0x02 // posting is a managed temporary
diff --git a/src/post.cc b/src/post.cc
index 2a44ebd8..7b5e5325 100644
--- a/src/post.cc
+++ b/src/post.cc
@@ -35,8 +35,8 @@
#include "xact.h"
#include "account.h"
#include "interactive.h"
-#include "unistring.h" // jww (2009-03-04): really??
-#include "format.h" // jww (2009-03-04): really??
+#include "unistring.h"
+#include "format.h"
namespace ledger {
diff --git a/src/py_amount.cc b/src/py_amount.cc
index 68fd8698..7fe12674 100644
--- a/src/py_amount.cc
+++ b/src/py_amount.cc
@@ -119,9 +119,6 @@ void export_amount()
make_getter(&amount_t::stream_fullstrings),
make_setter(&amount_t::stream_fullstrings))
-#if 0
- .def(init<double>())
-#endif
.def(init<long>())
.def(init<std::string>())
@@ -137,108 +134,56 @@ internal precision."))
.def(self == self)
.def(self == long())
.def(long() == self)
-#if 0
- .def(self == double())
- .def(double() == self)
-#endif
.def(self != self)
.def(self != long())
.def(long() != self)
-#if 0
- .def(self != double())
- .def(double() != self)
-#endif
.def(! self)
.def(self < self)
.def(self < long())
.def(long() < self)
-#if 0
- .def(self < double())
- .def(double() < self)
-#endif
.def(self <= self)
.def(self <= long())
.def(long() <= self)
-#if 0
- .def(self <= double())
- .def(double() <= self)
-#endif
.def(self > self)
.def(self > long())
.def(long() > self)
-#if 0
- .def(self > double())
- .def(double() > self)
-#endif
.def(self >= self)
.def(self >= long())
.def(long() >= self)
-#if 0
- .def(self >= double())
- .def(double() >= self)
-#endif
.def(self += self)
.def(self += long())
-#if 0
- .def(self += double())
-#endif
.def(self + self)
.def(self + long())
.def(long() + self)
-#if 0
- .def(self + double())
- .def(double() + self)
-#endif
.def(self -= self)
.def(self -= long())
-#if 0
- .def(self -= double())
-#endif
.def(self - self)
.def(self - long())
.def(long() - self)
-#if 0
- .def(self - double())
- .def(double() - self)
-#endif
.def(self *= self)
.def(self *= long())
-#if 0
- .def(self *= double())
-#endif
.def(self * self)
.def(self * long())
.def(long() * self)
-#if 0
- .def(self * double())
- .def(double() * self)
-#endif
.def(self /= self)
.def(self /= long())
-#if 0
- .def(self /= double())
-#endif
.def(self / self)
.def(self / long())
.def(long() / self)
-#if 0
- .def(self / double())
- .def(double() / self)
-#endif
.def("precision", &amount_t::precision)
@@ -326,9 +271,6 @@ internal precision."))
register_optional_to_python<amount_t>();
-#if 0
- implicitly_convertible<double, amount_t>();
-#endif
implicitly_convertible<long, amount_t>();
implicitly_convertible<string, amount_t>();
diff --git a/src/py_value.cc b/src/py_value.cc
index 9aa4984e..f6c71920 100644
--- a/src/py_value.cc
+++ b/src/py_value.cc
@@ -80,12 +80,10 @@ namespace {
void export_value()
{
class_< value_t > ("Value")
-#if 0
.def("initialize", &value_t::initialize)
.staticmethod("initialize")
.def("shutdown", &value_t::shutdown)
.staticmethod("shutdown")
-#endif
.def(init<double>())
.def(init<long>())
diff --git a/src/quotes.cc b/src/quotes.cc
index 797e6dd5..7f41e4ff 100644
--- a/src/quotes.cc
+++ b/src/quotes.cc
@@ -101,9 +101,6 @@ commodity_quote_from_script(commodity_t& commodity,
exchange_commodity->symbol() : "''") << "\")");
// Don't try to download this commodity again.
-
- // jww (2009-06-24): This flag should be removed in order to try again
- // when using a GUI.
commodity.add_flags(COMMODITY_NOMARKET);
}
return none;
diff --git a/src/report.cc b/src/report.cc
index 096536c9..9f15a2d5 100644
--- a/src/report.cc
+++ b/src/report.cc
@@ -33,8 +33,8 @@
#include "report.h"
#include "session.h"
-#include "unistring.h" // jww (2009-03-04): really??
-#include "format.h" // jww (2009-03-04): really??
+#include "unistring.h"
+#include "format.h"
#include "output.h"
#include "iterators.h"
#include "filters.h"
@@ -55,7 +55,6 @@ void report_t::posts_report(post_handler_ptr handler)
void report_t::generate_report(post_handler_ptr handler)
{
- // jww (2009-02-27): make this more general
HANDLER(limit_).on(string("#generate"), "actual");
generate_posts_iterator walker
@@ -660,10 +659,7 @@ option_t<report_t> * report_t::lookup_option(const char * p)
else OPT(related_all);
else OPT(revalued);
else OPT(revalued_only);
-#if 0
- // This option is not available to users
else OPT(revalued_total_);
-#endif
break;
case 's':
OPT(set_account_);
diff --git a/src/session.cc b/src/session.cc
index 6efc03f2..f3209fe7 100644
--- a/src/session.cc
+++ b/src/session.cc
@@ -47,8 +47,6 @@ void set_session_context(session_t * session)
times_initialize();
amount_t::initialize(session->journal->commodity_pool);
- // jww (2009-02-04): Is amount_t the right place for parse_conversion to
- // happen?
amount_t::parse_conversion("1.0m", "60s");
amount_t::parse_conversion("1.0h", "60m");
diff --git a/src/stats.cc b/src/stats.cc
index 6f0e21f4..e2db9d8b 100644
--- a/src/stats.cc
+++ b/src/stats.cc
@@ -82,12 +82,6 @@ value_t report_statistics(call_scope_t& args)
out << std::endl;
-#if 0
- out << _(" Number of transactions: ") ;
- out.width(6);
- out << statistics.xacts_count << std::endl;
-#endif
-
out << _(" Number of postings: ");
out.width(6);
out << statistics.posts_count;
diff --git a/src/textual.cc b/src/textual.cc
index 9375ea4f..0eb00292 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -323,11 +323,6 @@ void instance_t::read_next_directive()
case ' ':
case '\t': {
-#if 0
- char * p = skip_ws(line);
- if (*p)
- throw parse_error(_("Line begins with whitespace"));
-#endif
break;
}
@@ -614,15 +609,6 @@ void instance_t::include_directive(char * line)
{
path filename(line);
-#if 0
- if (filename[0] != '/' && filename[0] != '\\' && filename[0] != '~') {
- string::size_type pos = pathname.prev.rfind('/');
- if (pos == string::npos)
- pos = pathname.prev.rfind('\\');
- if (pos != string::npos)
- filename = string(pathname.prev, 0, pos + 1) + filename;
- }
-#endif
filename = resolve_path(filename);
DEBUG("textual.include", "Line " << linenum << ": " <<
@@ -652,8 +638,6 @@ void instance_t::account_directive(char * line)
void instance_t::end_directive(char *)
{
- // jww (2009-02-26): Allow end to be "end account" or "end tag". End by
- // itself is assumed to be "end account".
if (account_stack.empty())
throw_(std::runtime_error,
_("'end' directive found, but no account currently active"));
@@ -758,9 +742,8 @@ void instance_t::general_directive(char * line)
break;
}
- // jww (2009-02-10): This needs some serious work.
scoped_array<char> directive(new char[std::strlen(p) + DIR_PREFIX_LEN + 1]);
- std::strcpy(directive.get(),DIR_PREFIX);
+ std::strcpy(directive.get(), DIR_PREFIX);
std::strcpy(directive.get() + DIR_PREFIX_LEN, p);
if (expr_t::ptr_op_t op = lookup(directive.get())) {
diff --git a/src/xact.cc b/src/xact.cc
index be8c0214..1ab54bdf 100644
--- a/src/xact.cc
+++ b/src/xact.cc
@@ -136,8 +136,6 @@ bool xact_base_t::finalize()
// been set.
if (journal && journal->basket && posts.size() == 1 && ! balance.is_null()) {
- // jww (2008-07-24): Need to make the rest of the code aware of what to do
- // when it sees a generated post.
null_post = new post_t(journal->basket, ITEM_GENERATED);
null_post->_state = (*posts.begin())->_state;
add_post(null_post);
@@ -459,12 +457,10 @@ bool xact_t::valid() const
DEBUG("ledger.validate", "xact_t: ! _date");
return false;
}
-#if 0
if (! journal) {
DEBUG("ledger.validate", "xact_t: ! journal");
return false;
}
-#endif
foreach (post_t * post, posts)
if (post->xact != this || ! post->valid()) {
diff --git a/src/xact.h b/src/xact.h
index 98631f65..b3cad6da 100644
--- a/src/xact.h
+++ b/src/xact.h
@@ -263,12 +263,10 @@ class period_xact_t : public xact_base_t
}
virtual bool valid() const {
-#if 0
if (! period.is_valid()) {
DEBUG("ledger.validate", "period_xact_t: ! period.is_valid()");
return false;
}
-#endif
return true;
}