From b04b4f7e5325e4d4482e2f63f5c90d08bd45a68e Mon Sep 17 00:00:00 2001 From: Guilherme Maciel Ferreira Date: Mon, 31 Jan 2011 16:37:44 +0100 Subject: [PATCH] Improved method signature, constification of parameter and type --- src/stringfunc.cpp | 4 ++-- src/stringfunc.hxx | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/stringfunc.cpp b/src/stringfunc.cpp index d9050aa..e3e99cd 100644 --- a/src/stringfunc.cpp +++ b/src/stringfunc.cpp @@ -892,7 +892,7 @@ string to_upper(const string &src) } #endif -string nice_unit_format(long long input) +string nice_unit_format(const int64_t input) { double size = input; int sizecount = 0; @@ -906,7 +906,7 @@ string nice_unit_format(long long input) double tmp; // round tmp = size*10; tmp += 0.5; - tmp = (long long) (tmp); + tmp = (int64_t) (tmp); tmp = double (tmp) /double (10); size = tmp; diff --git a/src/stringfunc.hxx b/src/stringfunc.hxx index 660c081..85acdce 100644 --- a/src/stringfunc.hxx +++ b/src/stringfunc.hxx @@ -21,6 +21,7 @@ #include #include #include +#include namespace I2n { @@ -190,7 +191,7 @@ using I2n::to_lower; using I2n::to_upper; #endif -std::string nice_unit_format(long long input); +std::string nice_unit_format(const int64_t input); bool replace_all(std::string &base, const std::string *ist, const std::string *soll); bool replace_all(std::string &base, const char *ist, const char *soll); -- 1.7.1