Add a few more sizes to humanize_sizes()
Because why the hell not? Exbibyte, zebibyte, and yobibyte are going in, even though nothing bigger than the 2^60 exbibyte can be represented using an off_t variable anyway. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
f7a3c4c8df
commit
30cad47fb9
1 changed files with 4 additions and 2 deletions
|
@ -916,8 +916,10 @@ static char *pkg_get_location(alpm_pkg_t *pkg)
|
||||||
double humanize_size(off_t bytes, const char target_unit, int long_labels,
|
double humanize_size(off_t bytes, const char target_unit, int long_labels,
|
||||||
const char **label)
|
const char **label)
|
||||||
{
|
{
|
||||||
static const char *shortlabels[] = {"B", "K", "M", "G", "T", "P"};
|
static const char *shortlabels[] = {"B", "K", "M", "G",
|
||||||
static const char *longlabels[] = {"B", "KiB", "MiB", "GiB", "TiB", "PiB"};
|
"T", "P", "E", "Z", "Y"};
|
||||||
|
static const char *longlabels[] = {"B", "KiB", "MiB", "GiB",
|
||||||
|
"TiB", "PiB", "EiB", "ZiB", "YiB"};
|
||||||
static const int unitcount = sizeof(shortlabels) / sizeof(shortlabels[0]);
|
static const int unitcount = sizeof(shortlabels) / sizeof(shortlabels[0]);
|
||||||
|
|
||||||
const char **labels = long_labels ? longlabels : shortlabels;
|
const char **labels = long_labels ? longlabels : shortlabels;
|
||||||
|
|
Loading…
Add table
Reference in a new issue