diff options
author | John Wiegley <johnw@newartisans.com> | 2012-02-17 15:17:52 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-02-17 15:17:52 -0600 |
commit | c3a9a7d2c584a7651426b3516f4e9991c8063e02 (patch) | |
tree | 6a7748588d90d3d9e0032903548b3411d7277dd6 /src/output.cc | |
parent | c6b51a2635bdf7da803dd2fc8251d6c290f134a4 (diff) | |
download | fork-ledger-c3a9a7d2c584a7651426b3516f4e9991c8063e02.tar.gz fork-ledger-c3a9a7d2c584a7651426b3516f4e9991c8063e02.tar.bz2 fork-ledger-c3a9a7d2c584a7651426b3516f4e9991c8063e02.zip |
Fixed many Clang type conversion warnings with static_cast
Diffstat (limited to 'src/output.cc')
-rw-r--r-- | src/output.cc | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/output.cc b/src/output.cc index 9305cd28..b26881a3 100644 --- a/src/output.cc +++ b/src/output.cc @@ -52,13 +52,14 @@ format_posts::format_posts(report_t& _report, const char * f = format.c_str(); if (const char * p = std::strstr(f, "%/")) { - first_line_format.parse_format(string(f, 0, p - f)); + first_line_format.parse_format + (string(f, 0, static_cast<std::string::size_type>(p - f))); const char * n = p + 2; - if (const char * p = std::strstr(n, "%/")) { - next_lines_format.parse_format(string(n, 0, p - n), - first_line_format); - between_format.parse_format(string(p + 2), - first_line_format); + if (const char * pp = std::strstr(n, "%/")) { + next_lines_format.parse_format + (string(n, 0, static_cast<std::string::size_type>(pp - n)), + first_line_format); + between_format.parse_format(string(pp + 2), first_line_format); } else { next_lines_format.parse_format(string(n), first_line_format); } @@ -99,7 +100,7 @@ void format_posts::operator()(post_t& post) } if (prepend_format) { - out.width(prepend_width); + out.width(static_cast<std::streamsize>(prepend_width)); out << prepend_format(bound_scope); } @@ -135,11 +136,14 @@ format_accounts::format_accounts(report_t& _report, const char * f = format.c_str(); if (const char * p = std::strstr(f, "%/")) { - account_line_format.parse_format(string(f, 0, p - f)); + account_line_format.parse_format + (string(f, 0, static_cast<std::string::size_type>(p - f))); const char * n = p + 2; - if (const char * p = std::strstr(n, "%/")) { - total_line_format.parse_format(string(n, 0, p - n), account_line_format); - separator_format.parse_format(string(p + 2), account_line_format); + if (const char * pp = std::strstr(n, "%/")) { + total_line_format.parse_format + (string(n, 0, static_cast<std::string::size_type>(pp - n)), + account_line_format); + separator_format.parse_format(string(pp + 2), account_line_format); } else { total_line_format.parse_format(n, account_line_format); } @@ -181,7 +185,7 @@ std::size_t format_accounts::post_account(account_t& account, const bool flat) } if (prepend_format) { - out.width(prepend_width); + out.width(static_cast<std::streamsize>(prepend_width)); out << prepend_format(bound_scope); } @@ -256,7 +260,8 @@ void format_accounts::flush() out << separator_format(bound_scope); if (prepend_format) { - static_cast<std::ostream&>(report.output_stream).width(prepend_width); + static_cast<std::ostream&>(report.output_stream) + .width(static_cast<std::streamsize>(prepend_width)); static_cast<std::ostream&>(report.output_stream) << prepend_format(bound_scope); } |