diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-16 16:55:18 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-16 16:55:18 -0400 |
commit | d0a664d102bb0886dbaf844b6857749f70702ea3 (patch) | |
tree | 4994ad85c9c743ed13346ba94daea47a389a9bfd | |
parent | 32e2d58d4372f34726b4de59e3b0cdc0540ad474 (diff) | |
download | fork-ledger-d0a664d102bb0886dbaf844b6857749f70702ea3.tar.gz fork-ledger-d0a664d102bb0886dbaf844b6857749f70702ea3.tar.bz2 fork-ledger-d0a664d102bb0886dbaf844b6857749f70702ea3.zip |
Fixed several unused value and param warnings
-rw-r--r-- | python/py_scope.cc | 2 | ||||
-rw-r--r-- | python/pyinterp.cc | 2 | ||||
-rw-r--r-- | src/amount.cc | 1 | ||||
-rw-r--r-- | src/commodity.cc | 6 | ||||
-rw-r--r-- | src/commodity.h | 8 | ||||
-rw-r--r-- | src/entry.cc | 3 | ||||
-rw-r--r-- | src/item.cc | 2 | ||||
-rw-r--r-- | src/iterators.cc | 5 | ||||
-rw-r--r-- | src/main.cc | 2 | ||||
-rw-r--r-- | src/option.h | 2 | ||||
-rw-r--r-- | src/pstream.h | 6 | ||||
-rw-r--r-- | src/report.h | 8 | ||||
-rw-r--r-- | src/scope.h | 2 | ||||
-rw-r--r-- | src/session.h | 2 | ||||
-rw-r--r-- | src/stream.cc | 2 | ||||
-rw-r--r-- | src/stream.h | 4 | ||||
-rw-r--r-- | src/textual.cc | 12 | ||||
-rw-r--r-- | src/utils.cc | 4 | ||||
-rw-r--r-- | test/unit/t_balance.cc | 1 | ||||
-rw-r--r-- | test/unit/t_commodity.cc | 6 | ||||
-rw-r--r-- | test/unit/t_expr.cc | 1 | ||||
-rw-r--r-- | test/unit/t_times.cc | 2 | ||||
-rw-r--r-- | test/unit/t_utils.cc | 3 |
23 files changed, 31 insertions, 55 deletions
diff --git a/python/py_scope.cc b/python/py_scope.cc index 51a72c59..55f779d2 100644 --- a/python/py_scope.cc +++ b/python/py_scope.cc @@ -59,7 +59,7 @@ namespace { scope_wrapper(PyObject * self_) : self(self_) {} - virtual expr_t::ptr_op_t lookup(const string& name) { + virtual expr_t::ptr_op_t lookup(const string&) { return NULL; } }; diff --git a/python/pyinterp.cc b/python/pyinterp.cc index 611a4033..cc6a5688 100644 --- a/python/pyinterp.cc +++ b/python/pyinterp.cc @@ -270,7 +270,7 @@ value_t python_interpreter_t::functor_t::operator()(call_scope_t& args) } return result; } - else if (PyObject * err = PyErr_Occurred()) { + else if (PyErr_Occurred()) { PyErr_Print(); throw_(calc_error, "Failed call to Python function '" << name << "'"); } else { diff --git a/src/amount.cc b/src/amount.cc index ffeaeea6..1f273e9f 100644 --- a/src/amount.cc +++ b/src/amount.cc @@ -970,7 +970,6 @@ void amount_t::print(std::ostream& _out) const std::ostringstream out; commodity_t& comm(commodity()); - precision_t precision = 0; if (! comm.has_flags(COMMODITY_STYLE_SUFFIXED)) { comm.print(out); diff --git a/src/commodity.cc b/src/commodity.cc index 2dfba880..2ab7612e 100644 --- a/src/commodity.cc +++ b/src/commodity.cc @@ -99,9 +99,7 @@ bool commodity_t::base_t::varied_history_t::remove_price(const datetime_t& date optional<price_point_t> commodity_t::base_t::history_t:: - find_price(const commodity_t& source, - const optional<commodity_t&>& commodity, - const optional<datetime_t>& moment, + find_price(const optional<datetime_t>& moment, const optional<datetime_t>& oldest #if defined(DEBUG_ON) , const int indent @@ -275,7 +273,7 @@ optional<price_point_t> " searching for price via commodity '" << comm << "'"); #endif - point = hist.second.find_price(source, commodity, moment, limit + point = hist.second.find_price(moment, limit #if defined(DEBUG_ON) , indent + 2 #endif diff --git a/src/commodity.h b/src/commodity.h index 9522bb43..92bacb25 100644 --- a/src/commodity.h +++ b/src/commodity.h @@ -97,9 +97,7 @@ public: bool remove_price(const datetime_t& date); optional<price_point_t> - find_price(const commodity_t& source, - const optional<commodity_t&>& commodity, - const optional<datetime_t>& moment = none, + find_price(const optional<datetime_t>& moment = none, const optional<datetime_t>& oldest = none #if defined(DEBUG_ON) , const int indent = 0 @@ -218,10 +216,10 @@ public: virtual const commodity_t& referent() const { return *this; } - virtual commodity_t& strip_annotations(const keep_details_t& what_to_keep) { + virtual commodity_t& strip_annotations(const keep_details_t&) { return *this; } - virtual void write_annotations(std::ostream& out) const {} + virtual void write_annotations(std::ostream&) const {} commodity_pool_t& parent() const { return *parent_; diff --git a/src/entry.cc b/src/entry.cc index 438cc5b0..1a6fcee3 100644 --- a/src/entry.cc +++ b/src/entry.cc @@ -36,7 +36,7 @@ namespace ledger { -entry_base_t::entry_base_t(const entry_base_t& e) +entry_base_t::entry_base_t(const entry_base_t&) : item_t(), journal(NULL) { TRACE_CTOR(entry_base_t, "copy"); @@ -56,7 +56,6 @@ entry_base_t::~entry_base_t() item_t::state_t entry_base_t::state() const { - bool first = true; state_t result = CLEARED; foreach (xact_t * xact, xacts) { diff --git a/src/item.cc b/src/item.cc index e997d13e..a3375e9b 100644 --- a/src/item.cc +++ b/src/item.cc @@ -225,7 +225,7 @@ namespace { return long(item.end_line); } - value_t get_depth(item_t& item) { + value_t get_depth(item_t&) { return 0L; } diff --git a/src/iterators.cc b/src/iterators.cc index 9b345282..01f678d0 100644 --- a/src/iterators.cc +++ b/src/iterators.cc @@ -96,11 +96,8 @@ void xacts_commodities_iterator::reset(journal_t& journal) foreach (commodity_t::base_t::history_by_commodity_map::value_type pair, history->histories) { - commodity_t& price_comm(*pair.first); - commodity_t::history_t& price_hist(pair.second); - foreach (commodity_t::base_t::history_map::value_type hpair, - price_hist.prices) { + pair.second.prices) { entry_t * entry; string symbol = hpair.second.commodity().symbol(); diff --git a/src/main.cc b/src/main.cc index 74ef9c64..26f3fe31 100644 --- a/src/main.cc +++ b/src/main.cc @@ -155,8 +155,6 @@ int main(int argc, char * argv[], char * envp[]) #endif // HAVE_LIBEDIT - bool do_command = true; - check_for_signal(); if (*p && *p != '#') { diff --git a/src/option.h b/src/option.h index 633d35e0..a791e250 100644 --- a/src/option.h +++ b/src/option.h @@ -133,7 +133,7 @@ public: value = value_t(); } - virtual void handler_thunk(call_scope_t& args) {} + virtual void handler_thunk(call_scope_t&) {} virtual void handler(call_scope_t& args) { if (wants_arg) diff --git a/src/pstream.h b/src/pstream.h index 1eb8335c..43153e5c 100644 --- a/src/pstream.h +++ b/src/pstream.h @@ -53,6 +53,9 @@ class ptristream : public std::istream { class ptrinbuf : public std::streambuf { + ptrinbuf(const ptrinbuf&); + ptrinbuf& operator=(const ptrinbuf&); + protected: char * ptr; std::size_t len; @@ -77,8 +80,7 @@ class ptristream : public std::istream } virtual pos_type seekoff(off_type off, ios_base::seekdir way, - ios_base::openmode mode = - ios_base::in | ios_base::out) + ios_base::openmode) { switch (way) { case std::ios::cur: diff --git a/src/report.h b/src/report.h index e77ba1a4..63c92ebe 100644 --- a/src/report.h +++ b/src/report.h @@ -142,7 +142,7 @@ public: return false; } - value_t fn_options(call_scope_t& scope) { + value_t fn_options(call_scope_t&) { return value_t(static_cast<scope_t *>(this)); } @@ -152,7 +152,7 @@ public: return option.str(); } - value_t reload_command(call_scope_t& scope) { + value_t reload_command(call_scope_t&) { session.close_journal_files(); session.read_journal_files(); return true; @@ -478,9 +478,9 @@ public: OPTION(report_t, totals); - OPTION_(report_t, truncate_, DO_(args) { + OPTION_(report_t, truncate_, DO() { #if 0 - std::string style(optarg); + string style(args[0].to_string()); if (style == "leading") format_t::elision_style = format_t::TRUNCATE_LEADING; else if (style == "middle") diff --git a/src/scope.h b/src/scope.h index 32fbed4a..2ab788fc 100644 --- a/src/scope.h +++ b/src/scope.h @@ -66,7 +66,7 @@ public: TRACE_DTOR(scope_t); } - virtual void define(const string& name, expr_t::ptr_op_t def) {} + virtual void define(const string&, expr_t::ptr_op_t) {} virtual expr_t::ptr_op_t lookup(const string& name) = 0; value_t resolve(const string& name) { diff --git a/src/session.h b/src/session.h index 08f93377..2b657125 100644 --- a/src/session.h +++ b/src/session.h @@ -76,7 +76,7 @@ public: } void set_flush_on_next_data_file(const bool truth) { - flush_on_next_data_file = true; + flush_on_next_data_file = truth; } std::size_t read_journal(std::istream& in, diff --git a/src/stream.cc b/src/stream.cc index cf85f2d4..2c255108 100644 --- a/src/stream.cc +++ b/src/stream.cc @@ -72,8 +72,6 @@ namespace { throw std::logic_error("Failed to fork child process"); } else if (status == 0) { // child - const char *arg0; - // Duplicate pipe's reading end into stdin status = dup2(pfd[0], STDIN_FILENO); if (status == -1) diff --git a/src/stream.h b/src/stream.h index ddc5369a..624c3eee 100644 --- a/src/stream.h +++ b/src/stream.h @@ -63,6 +63,8 @@ namespace ledger { */ class output_stream_t { + output_stream_t& operator=(const output_stream_t&); + private: int pipe_to_pager_fd; @@ -85,7 +87,7 @@ public: * allows large classes to rely on their default copy-constructor without * worrying about pointer copying within output_stream_t. */ - output_stream_t(const output_stream_t& other) + output_stream_t(const output_stream_t&) : pipe_to_pager_fd(-1), os(&std::cout) { TRACE_CTOR(output_stream_t, "copy"); } diff --git a/src/textual.cc b/src/textual.cc index fe518cc2..f59496ba 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -117,8 +117,7 @@ namespace { entry_t * entry); bool parse_xacts(account_t * account, - entry_base_t& entry, - const string& kind); + entry_base_t& entry); entry_t * parse_entry(char * line, std::streamsize len, @@ -526,7 +525,7 @@ void instance_t::automated_entry_directive(char * line) (new auto_entry_t(item_predicate(skip_ws(line + 1), keep_details_t(true, true, true, true)))); - if (parse_xacts(account_stack.front(), *ae.get(), "automated")) { + if (parse_xacts(account_stack.front(), *ae.get())) { journal.auto_entries.push_back(ae.get()); ae->pathname = pathname; @@ -548,7 +547,7 @@ void instance_t::period_entry_directive(char * line) istream_pos_type pos = curr_pos; std::size_t lnum = linenum; - if (parse_xacts(account_stack.front(), *pe.get(), "period")) { + if (parse_xacts(account_stack.front(), *pe.get())) { if (pe->finalize()) { extend_entry_base(&journal, *pe.get(), true); @@ -629,7 +628,7 @@ void instance_t::account_directive(char * line) assert(! "Failed to create account"); } -void instance_t::end_directive(char * line) +void instance_t::end_directive(char *) { account_stack.pop_front(); } @@ -1008,8 +1007,7 @@ xact_t * instance_t::parse_xact(char * line, } bool instance_t::parse_xacts(account_t * account, - entry_base_t& entry, - const string& kind) + entry_base_t& entry) { TRACE_START(entry_xacts, 1, "Time spent parsing transactions:"); diff --git a/src/utils.cc b/src/utils.cc index d4b05fec..d20d585a 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -633,12 +633,12 @@ void finish_timer(const char * name) caught_signal_t caught_signal = NONE_CAUGHT; -void sigint_handler(int sig) +void sigint_handler(int) { caught_signal = INTERRUPTED; } -void sigpipe_handler(int sig) +void sigpipe_handler(int) { caught_signal = PIPE_CLOSED; } diff --git a/test/unit/t_balance.cc b/test/unit/t_balance.cc index 78a3a3fc..93d97d6a 100644 --- a/test/unit/t_balance.cc +++ b/test/unit/t_balance.cc @@ -26,5 +26,4 @@ void BalanceTestCase::tearDown() void BalanceTestCase::testConstructors() { - int x = 1; } diff --git a/test/unit/t_commodity.cc b/test/unit/t_commodity.cc index 8f57f51a..80e51bcd 100644 --- a/test/unit/t_commodity.cc +++ b/test/unit/t_commodity.cc @@ -102,19 +102,13 @@ void CommodityTestCase::testPriceHistory() void CommodityTestCase::testLots() { - // jww (2007-04-17): tbd - int x = 1; } void CommodityTestCase::testScalingBase() { - // jww (2007-04-17): tbd - int x = 1; } void CommodityTestCase::testReduction() { - // jww (2007-04-17): tbd - int x = 1; } diff --git a/test/unit/t_expr.cc b/test/unit/t_expr.cc index f9096cc5..57aec44b 100644 --- a/test/unit/t_expr.cc +++ b/test/unit/t_expr.cc @@ -18,5 +18,4 @@ void ValueExprTestCase::tearDown() void ValueExprTestCase::testConstructors() { - int x = 1; } diff --git a/test/unit/t_times.cc b/test/unit/t_times.cc index f593eeac..af0f1414 100644 --- a/test/unit/t_times.cc +++ b/test/unit/t_times.cc @@ -7,10 +7,8 @@ using namespace ledger; CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(DateTimeTestCase, "util"); void DateTimeTestCase::setUp() { - int x = 1; } void DateTimeTestCase::tearDown() { - int x = 1; } void DateTimeTestCase::testConstructors() diff --git a/test/unit/t_utils.cc b/test/unit/t_utils.cc index 3c32cf78..07be2815 100644 --- a/test/unit/t_utils.cc +++ b/test/unit/t_utils.cc @@ -3,13 +3,10 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(UtilitiesTestCase, "util"); void UtilitiesTestCase::setUp() { - int x = 1; } void UtilitiesTestCase::tearDown() { - int x = 1; } void UtilitiesTestCase::testConstructors() { - int x = 1; } |