util: Removed formatBytes

This commit is contained in:
Paul Beckingham 2016-12-06 07:26:06 -05:00
parent 1bf2d0d20d
commit 45e1622358
2 changed files with 0 additions and 15 deletions

View file

@ -149,20 +149,6 @@ int confirm4 (const std::string& question)
return 0;
}
////////////////////////////////////////////////////////////////////////////////
// Convert a quantity in seconds to a more readable format.
std::string formatBytes (size_t bytes)
{
char formatted[24];
if (bytes >= 995000000) snprintf (formatted, 24, "%.1f %s", (bytes / 1000000000.0), STRING_UTIL_GIBIBYTES);
else if (bytes >= 995000) snprintf (formatted, 24, "%.1f %s", (bytes / 1000000.0), STRING_UTIL_MEBIBYTES);
else if (bytes >= 995) snprintf (formatted, 24, "%.1f %s", (bytes / 1000.0), STRING_UTIL_KIBIBYTES);
else snprintf (formatted, 24, "%d %s", (int)bytes, STRING_UTIL_BYTES);
return Lexer::commify (formatted);
}
// Handle the generation of UUIDs on FreeBSD in a separate implementation
// of the uuid () function, since the API is quite different from Linux's.
// Also, uuid_unparse_lower is not needed on FreeBSD, because the string

View file

@ -42,7 +42,6 @@
// util.cpp
bool confirm (const std::string&);
int confirm4 (const std::string&);
std::string formatBytes (size_t);
#ifndef HAVE_UUID_UNPARSE_LOWER
void uuid_unparse_lower (uuid_t uu, char *out);