Improved method signature, constification of parameter and type
authorGuilherme Maciel Ferreira <guilherme.maciel.ferreira@intra2net.com>
Mon, 31 Jan 2011 15:37:44 +0000 (16:37 +0100)
committerGuilherme Maciel Ferreira <guilherme.maciel.ferreira@intra2net.com>
Mon, 31 Jan 2011 15:37:44 +0000 (16:37 +0100)
src/stringfunc.cpp
src/stringfunc.hxx

index d9050aa..e3e99cd 100644 (file)
@@ -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;
 
index 660c081..85acdce 100644 (file)
@@ -21,6 +21,7 @@
 #include <string>
 #include <sstream>
 #include <stdexcept>
+#include <sys/types.h>
 
 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);