Skip to content

Commit 300fb8a

Browse files
committed
utils/annotate: fix [kMGT]B size units
commit 4d9a984 did not actually fix it, it kept them identical to the new [kMGT]iB. Signed-off-by: Brice Goglin <[email protected]>
1 parent 32cc399 commit 300fb8a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

utils/hwloc/hwloc-annotate.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2012-2022 Inria. All rights reserved.
2+
* Copyright © 2012-2023 Inria. All rights reserved.
33
* See COPYING in top-level directory.
44
*/
55

@@ -601,19 +601,19 @@ int main(int argc, char *argv[])
601601
sizevalue = strtoull(argv[1], &end, 0);
602602
if (end) {
603603
if (!strcasecmp(end, "kB"))
604-
sizevalue *= 1024ULL;
604+
sizevalue *= 1000ULL;
605605
else if (!strcasecmp(end, "kiB"))
606606
sizevalue <<= 10;
607607
else if (!strcasecmp(end, "MB"))
608-
sizevalue *= 1024ULL*1024ULL;
608+
sizevalue *= 1000ULL*1000ULL;
609609
else if (!strcasecmp(end, "MiB"))
610610
sizevalue <<= 20;
611611
else if (!strcasecmp(end, "GB"))
612-
sizevalue *= 1024ULL*1024ULL*1024ULL;
612+
sizevalue *= 1000ULL*1000ULL*1000ULL;
613613
else if (!strcasecmp(end, "GiB"))
614614
sizevalue <<= 30;
615615
else if (!strcasecmp(end, "TB"))
616-
sizevalue *= 1024ULL*1024ULL*1024ULL*1024ULL;
616+
sizevalue *= 1000ULL*1000ULL*1000ULL*1000ULL;
617617
else if (!strcasecmp(end, "TiB"))
618618
sizevalue <<= 40;
619619
}

0 commit comments

Comments
 (0)