Fixed several unused value and param warnings

This commit is contained in:
John Wiegley 2009-02-16 16:55:18 -04:00
parent 32e2d58d43
commit d0a664d102
23 changed files with 31 additions and 55 deletions

View file

@ -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;
}
};

View file

@ -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 {

View file

@ -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);

View file

@ -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

View file

@ -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_;

View file

@ -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) {

View file

@ -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;
}

View file

@ -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();

View file

@ -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 != '#') {

View file

@ -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)

View file

@ -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:

View file

@ -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")

View file

@ -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) {

View file

@ -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,

View file

@ -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)

View file

@ -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");
}

View file

@ -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:");

View file

@ -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;
}

View file

@ -26,5 +26,4 @@ void BalanceTestCase::tearDown()
void BalanceTestCase::testConstructors()
{
int x = 1;
}

View file

@ -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;
}

View file

@ -18,5 +18,4 @@ void ValueExprTestCase::tearDown()
void ValueExprTestCase::testConstructors()
{
int x = 1;
}

View file

@ -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()

View file

@ -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;
}