mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
util: Removed formatBytes
This commit is contained in:
parent
488673ea9a
commit
4bbb5fadb3
2 changed files with 0 additions and 15 deletions
14
src/util.cpp
14
src/util.cpp
|
@ -149,20 +149,6 @@ int confirm4 (const std::string& question)
|
||||||
return 0;
|
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
|
// Handle the generation of UUIDs on FreeBSD in a separate implementation
|
||||||
// of the uuid () function, since the API is quite different from Linux's.
|
// 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
|
// Also, uuid_unparse_lower is not needed on FreeBSD, because the string
|
||||||
|
|
|
@ -42,7 +42,6 @@
|
||||||
// util.cpp
|
// util.cpp
|
||||||
bool confirm (const std::string&);
|
bool confirm (const std::string&);
|
||||||
int confirm4 (const std::string&);
|
int confirm4 (const std::string&);
|
||||||
std::string formatBytes (size_t);
|
|
||||||
|
|
||||||
#ifndef HAVE_UUID_UNPARSE_LOWER
|
#ifndef HAVE_UUID_UNPARSE_LOWER
|
||||||
void uuid_unparse_lower (uuid_t uu, char *out);
|
void uuid_unparse_lower (uuid_t uu, char *out);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue