Cleanup whitespace

This commit is contained in:
John Wiegley 2011-08-18 14:48:38 -04:00
parent add6f6ca2a
commit f0791bbd72
43 changed files with 70 additions and 70 deletions

View file

@ -45,7 +45,7 @@ account_t::~account_t()
if (! pair.second->has_flags(ACCOUNT_TEMP) ||
has_flags(ACCOUNT_TEMP)) {
checked_delete(pair.second);
}
}
}
}

View file

@ -152,7 +152,7 @@ namespace {
if (mpfr_asprintf(&buf, "%.*RNf", precision, tempfb) < 0)
throw_(amount_error,
_("Cannot output amount to a floating-point representation"));
DEBUG("amount.convert", "mpfr_print = " << buf
<< " (precision " << precision
<< ", zeros_prec " << zeros_prec << ")");

View file

@ -349,7 +349,7 @@ public:
return temp;
}
void in_place_truncate();
/** Yields an amount which has lost all of its extra precision, beyond what
the display precision of the commodity would have printed. */
amount_t floored() const {
@ -358,7 +358,7 @@ public:
return temp;
}
void in_place_floor();
/** Yields an amount whose display precision is never truncated, even
though its commodity normally displays only rounded values. */
amount_t unrounded() const {

View file

@ -444,7 +444,7 @@ commodity_t::find_price(const optional<commodity_t&>& commodity,
return point;
}
return none;
}
}
optional<price_point_t>
commodity_t::check_for_updated_price(const optional<price_point_t>& point,
@ -758,7 +758,7 @@ void to_xml(std::ostream& out, const commodity_t& comm,
out << '"';
x.close_attrs();
{
push_xml y(out, "symbol");
out << y.guard(comm.symbol());

View file

@ -376,7 +376,7 @@ public:
#if defined(DEBUG_ON)
, const int indent = 0
#endif
) const;
) const;
optional<price_point_t>
check_for_updated_price(const optional<price_point_t>& point,

View file

@ -58,7 +58,7 @@ class compare_items
expr_t sort_order;
compare_items();
public:
compare_items(const compare_items& other) : sort_order(other.sort_order) {
TRACE_CTOR(compare_items, "copy");

View file

@ -95,7 +95,7 @@ value_t convert_command(call_scope_t& args)
foreach (post_t * post, xact->posts)
post->amount.in_place_negate();
}
bool matched = false;
if (! xact->posts.front()->amount.is_null()) {
post_map_t::iterator i = post_map.find(- xact->posts.front()->amount);

View file

@ -289,7 +289,7 @@ xact_t * csv_reader::read_xact(journal_t& journal, account_t * bucket)
amt.set_commodity(*commodity_pool_t::current_pool->default_commodity);
post->assigned_amount = amt;
}
xact->add_post(post.release());
return xact.release();

View file

@ -93,10 +93,10 @@ string source_context(const path& file,
assert(len < 8192);
std::ostringstream out;
ifstream in(file);
in.seekg(pos, std::ios::beg);
scoped_array<char> buf(new char[static_cast<std::size_t>(len) + 1]);
in.read(buf.get(), static_cast<std::streamsize>(len));
assert(in.gcount() == static_cast<std::streamsize>(len));

View file

@ -130,7 +130,7 @@ public:
const optional<string>& original_string = none) {
set_text(original_string ? *original_string : "<stream>");
}
virtual void mark_uncompiled() {
compiled = false;
}

View file

@ -53,7 +53,7 @@ void post_splitter::flush()
{
foreach (value_to_posts_map::value_type& pair, posts_map) {
preflush_func(pair.first);
foreach (post_t * post, pair.second)
(*post_chain)(*post);
@ -415,7 +415,7 @@ void collapse_posts::report_subtotal()
bind_scope_t bound_scope(report, *post);
if (only_predicate(bound_scope) && display_predicate(bound_scope))
displayed_count++;
}
}
if (displayed_count == 1) {
item_handler<post_t>::operator()(*last_post);
@ -734,7 +734,7 @@ void changed_value_posts::output_intermediate_prices(post_t& post,
case value_t::DATE:
default:
assert(false);
break;
break;
}
bind_scope_t inner_scope(report, temp);

View file

@ -73,10 +73,10 @@ public:
post_splitter(post_handler_ptr _post_chain,
report_t& _report,
expr_t _group_by_expr)
: post_chain(_post_chain), report(_report),
: post_chain(_post_chain), report(_report),
group_by_expr(_group_by_expr) {
TRACE_CTOR(post_splitter, "scope_t&, post_handler_ptr, expr_t");
preflush_func = bind(&post_splitter::print_title, this, _1);
preflush_func = bind(&post_splitter::print_title, this, _1);
}
virtual ~post_splitter() {
TRACE_DTOR(post_splitter);
@ -310,7 +310,7 @@ public:
virtual void clear() {
sorter.clear();
last_xact = NULL;
item_handler<post_t>::clear();
}
};
@ -382,7 +382,7 @@ public:
temps.clear();
comms.clear();
last_xact = NULL;
item_handler<post_t>::clear();
}
};
@ -458,7 +458,7 @@ public:
}
virtual void flush() {
report_subtotal();
report_subtotal();
item_handler<post_t>::flush();
}
@ -479,7 +479,7 @@ public:
temps.clear();
create_accounts();
component_posts.clear();
item_handler<post_t>::clear();
}
};

View file

@ -271,14 +271,14 @@ void generate_posts_iterator::generate_date(std::ostream& out)
out.width(4);
out.fill('0');
out << year_gen();
out.width(1);
out << '/';
out.width(2);
out.fill('0');
out << mon_gen();
out.width(1);
out << '/';

View file

@ -106,7 +106,7 @@ public:
virtual ~generate_posts_iterator() throw() {
TRACE_DTOR(generate_posts_iterator);
}
virtual void increment();
protected:

View file

@ -535,7 +535,7 @@ string item_context(const item_t& item, const string& desc)
assert(len < 8192);
std::ostringstream out;
if (item.pos->pathname == path("/dev/stdin")) {
out << desc << _(" from standard input:");
return out.str();

View file

@ -74,7 +74,7 @@ journal_t::~journal_t()
foreach (period_xact_t * xact, period_xacts)
checked_delete(xact);
checked_delete(master);
}

View file

@ -92,7 +92,7 @@ lookup_probable_account(const string& ident,
if ((CURRENT_DATE() - xact->date()).days() > 700)
continue;
#endif
// An exact match is worth a score of 100 and terminates the search
if (ident == xact->payee) {
DEBUG("lookup", " we have an exact match, score = 100");

View file

@ -438,7 +438,7 @@ value_t expr_t::op_t::calc(scope_t& scope, ptr_op_t * locus, const int depth)
return result;
}
catch (const std::exception&) {
catch (const std::exception&) {
if (locus && ! *locus)
*locus = this;
throw;

View file

@ -89,7 +89,7 @@ namespace {
catch (const std::exception&) {
if (name[0] == '-')
add_error_context(_("While parsing option '%1'") << name);
else
add_error_context(_("While parsing environent variable '%1'") << name);
throw;
@ -156,7 +156,7 @@ namespace {
op_bool_char_tuple(expr_t::ptr_op_t _op, bool _truth, char _ch)
: op(_op), truth(_truth), ch(_ch) {}
};
}
}
strings_list process_arguments(strings_list args, scope_t& scope)
{

View file

@ -214,7 +214,7 @@ public:
#define DECL1(type, name, vartype, var, value) \
vartype var ; \
name ## option_t() : option_t<type>(#name), var(value)
#define DO() virtual void handler_thunk(call_scope_t&)
#define DO_(var) virtual void handler_thunk(call_scope_t& var)

View file

@ -298,7 +298,7 @@ commodity_pool_t::exchange(const amount_t& amount,
annotation.add_flags(ANNOTATION_DATE_CALCULATED);
if (tag)
annotation.add_flags(ANNOTATION_TAG_CALCULATED);
breakdown.amount = amount_t(amount, annotation);
DEBUG("commodity.prices.add",

View file

@ -115,7 +115,7 @@ date_t post_t::actual_date() const
return xact->date();
}
return *_date;
}
}
optional<date_t> post_t::effective_date() const
{
@ -341,7 +341,7 @@ namespace {
value_t get_value_date(post_t& post) {
if (post.has_xdata()) {
post_t::xdata_t& xdata(post.xdata());
if (! xdata.value_date.is_not_a_date())
if (! xdata.value_date.is_not_a_date())
return xdata.value_date;
}
return post.date();

View file

@ -99,7 +99,7 @@ class ptristream : public std::istream
protected:
ptrinbuf buf;
public:
public:
ptristream(char * ptr, std::size_t len = 0)
: std::istream(0), buf(ptr, len) {
rdbuf(&buf);

View file

@ -56,7 +56,7 @@ namespace {
datetime_t& moment) {
return balance.value(moment, in_terms_of);
}
boost::optional<amount_t>
py_commodity_amount_0(const balance_t& balance) {
return balance.commodity_amount();

View file

@ -181,7 +181,7 @@ namespace {
const datetime_t& date, const amount_t& price) {
commodity.add_price(date, price);
}
void py_add_price_3(commodity_t& commodity, const datetime_t& date,
const amount_t& price, const bool reflexive) {
commodity.add_price(date, price, reflexive);

View file

@ -140,7 +140,7 @@ void export_xact()
class_< period_xact_t, bases<xact_base_t> > ("PeriodicTransaction")
.def(init<string>())
.add_property("period",
make_getter(&period_xact_t::period),
make_setter(&period_xact_t::period))

View file

@ -126,7 +126,7 @@ void python_interpreter_t::initialize()
void python_interpreter_t::hack_system_paths()
{
// Hack ledger.__path__ so it points to a real location
python::object sys_module = python::import("sys");
python::object sys_module = python::import("sys");
python::object sys_dict = sys_module.attr("__dict__");
python::list paths(sys_dict["path"]);
@ -177,7 +177,7 @@ object python_interpreter_t::import_into_main(const string& str)
if (! mod)
throw_(std::runtime_error,
_("Failed to import Python module %1") << str);
// Import all top-level entries directly into the main namespace
main_nspace.update(mod.attr("__dict__"));
@ -193,7 +193,7 @@ object python_interpreter_t::import_option(const string& str)
{
path file(str);
python::object sys_module = python::import("sys");
python::object sys_module = python::import("sys");
python::object sys_dict = sys_module.attr("__dict__");
python::list paths(sys_dict["path"]);
@ -312,7 +312,7 @@ value_t python_interpreter_t::python_command(call_scope_t& args)
delete[] argv;
throw;
}
for (std::size_t i = 0; i < args.size() + 1; i++)
delete[] argv[i];
delete[] argv;
@ -445,7 +445,7 @@ namespace {
}
}
}
value_t python_interpreter_t::functor_t::operator()(call_scope_t& args)
{
try {

View file

@ -48,7 +48,7 @@ public:
: session_t(), main_nspace(), is_initialized(false) {
TRACE_CTOR(python_interpreter_t, "");
}
virtual ~python_interpreter_t() {
TRACE_DTOR(python_interpreter_t);

View file

@ -173,7 +173,7 @@ namespace boost { namespace python {
arg_to_python(T const& x) \
: python::handle<>(expr) {} \
}; \
}
}
// Specialize argument and return value converters for T using expr
# define BOOST_PYTHON_TO_PYTHON_BY_VALUE(T, expr, pytype) \

View file

@ -295,7 +295,7 @@ query_t::parser_t::parse_query_term(query_t::lexer_t::token_t::kind_t tok_contex
if (tok.kind != lexer_t::token_t::TERM)
throw_(parse_error,
_("Metadata equality operator not followed by term"));
expr_t::ptr_op_t arg2 = new expr_t::op_t(expr_t::op_t::VALUE);
assert(tok.value);
arg2->set_value(mask_t(*tok.value));
@ -309,7 +309,7 @@ query_t::parser_t::parse_query_term(query_t::lexer_t::token_t::kind_t tok_contex
}
break;
}
default: {
node = new expr_t::op_t(expr_t::op_t::O_MATCH);

View file

@ -289,7 +289,7 @@ void report_t::parse_query_args(const value_t& args, const string& whence)
normalize_period(); // it needs normalization
}
}
}
namespace {
struct posts_flusher

View file

@ -68,7 +68,7 @@ class xact_t;
// --- The details of #1 and #2 together represent the ItemHandler.
//
// 3. Mode of the report. Currently there are four modes:
//
//
// a. Posting or commodity iteration. In this mode, all the journal's
// xacts, the postings of a specific xact, or all the journal's
// commodities are walked. In the first two cases, it's the underlying
@ -86,7 +86,7 @@ class xact_t;
// c. Write journal. In this mode, a single function is called that output
// the journal object as a textual file. #2 is used to print out each
// posting in the journal.
//
//
// d. Dump binary file. This is just like 'c', except that it dumps out a
// binary file and #2 is completely ignored.
//

View file

@ -646,7 +646,7 @@ class value_scope_t : public child_scope_t
public:
value_scope_t(scope_t& _parent, const value_t& _value)
: child_scope_t(_parent), value(_value) {}
virtual string description() {
return parent->description();
}

View file

@ -178,7 +178,7 @@ void session_t::close_journal_files()
{
journal.reset();
amount_t::shutdown();
journal.reset(new journal_t);
amount_t::initialize();
}

View file

@ -205,7 +205,7 @@ namespace serialization {
template <class Archive>
void serialize(Archive& ar, boost::filesystem::path& p, const unsigned int)
{
std::string s;
std::string s;
if (Archive::is_saving::value)
s = p.string();

View file

@ -129,7 +129,7 @@ namespace {
(in.peek() == ' ' || in.peek() == '\t'));
}
void read_next_directive();
void read_next_directive();
#if defined(TIMELOG_SUPPORT)
void clock_in_directive(char * line, bool capitalized);
@ -270,7 +270,7 @@ void instance_t::parse()
string err_context = error_context();
if (! err_context.empty())
std::cerr << err_context << std::endl;
if (! current_context.empty())
std::cerr << current_context << std::endl;
@ -442,7 +442,7 @@ void instance_t::clock_in_directive(char * line, bool /*capitalized*/)
}
void instance_t::clock_out_directive(char * line, bool /*capitalized*/)
{
{
string datetime(line, 2, 19);
char * p = skip_ws(line + 22);
@ -546,7 +546,7 @@ void instance_t::automated_xact_directive(char * line)
try {
query_t query;
keep_details_t keeper(true, true, true);
expr_t::ptr_op_t expr =
expr_t::ptr_op_t expr =
query.parse_args(string_value(skip_ws(line + 1)).to_sequence(),
keeper, false, true);
@ -831,7 +831,7 @@ void instance_t::alias_directive(char * line)
void instance_t::fixed_directive(char * line)
{
if (optional<std::pair<commodity_t *, price_point_t> > price_point =
if (optional<std::pair<commodity_t *, price_point_t> > price_point =
commodity_pool_t::current_pool->parse_price_directive(trim_ws(line),
true)) {
context.state_stack.push_front(fixed_rate_t(price_point->first,

View file

@ -280,7 +280,7 @@ optional<date_time::weekdays> string_to_day_of_week(const std::string& str)
else
return none;
}
optional<date_time::months_of_year>
string_to_month_of_year(const std::string& str)
{

View file

@ -203,7 +203,7 @@ struct date_duration_t
}
~date_duration_t() throw() {
TRACE_DTOR(date_duration_t);
}
}
date_t add(const date_t& date) const {
switch (quantum) {
@ -431,7 +431,7 @@ public:
out << "from" << range_begin->to_string();
if (range_end)
out << " to" << range_end->to_string();
return out.str();
}

View file

@ -760,7 +760,7 @@ bool value_t::is_equal_to(const value_t& val) const
switch (type()) {
case VOID:
return val.type() == VOID;
case BOOLEAN:
if (val.is_boolean())
return as_boolean() == val.as_boolean();

View file

@ -139,7 +139,7 @@ private:
scope_t *, // SCOPE
boost::any // ANY
> data;
type_t type;
/**

View file

@ -192,7 +192,7 @@ bool xact_base_t::finalize()
DEBUG("xact.finalize", "there were no costs, and a valid top_post");
balance_t::amounts_map::const_iterator a = bal.amounts.begin();
const amount_t * x = &(*a++).second;
const amount_t * y = &(*a++).second;
@ -418,7 +418,7 @@ bool xact_base_t::verify()
amount_t& p(post->cost ? *post->cost : post->amount);
assert(! p.is_null());
// If the amount was a cost, it very likely has the "keep_precision" flag
// set, meaning commodity display precision is ignored when displaying the
// amount. We never want this set for the balance, so we must clear the
@ -609,7 +609,7 @@ namespace {
.match(post.reported_account()->fullname());
else
break;
case expr_t::op_t::O_NOT:
return ! post_pred(op->left(), post);

View file

@ -61,7 +61,7 @@ public:
xact_base_t() : item_t(), journal(NULL) {
TRACE_CTOR(xact_base_t, "");
}
xact_base_t(const xact_base_t& e);
xact_base_t(const xact_base_t& e);
virtual ~xact_base_t();

View file

@ -66,7 +66,7 @@ AC_ARG_ENABLE(doxygen,
AM_CONDITIONAL(USE_DOXYGEN, test x$doxygen = xtrue)
AC_ARG_ENABLE(cache,
[ --enable-cache Enable use of the --cache option],
[ --enable-cache Enable use of the --cache option],
[case "${enableval}" in
yes) cache=true ;;
no) cache=false ;;
@ -76,7 +76,7 @@ AC_ARG_ENABLE(cache,
AM_CONDITIONAL(USE_CACHE_OPTION, test x$cache = xtrue)
AC_ARG_ENABLE(python,
[ --enable-python Turn on Python support (experimental)],
[ --enable-python Turn on Python support (experimental)],
[case "${enableval}" in
yes) python=true ;;
no) python=false ;;