]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Try enabling the BIG strings now the unsigned long long is in effect
authorScott Baker <scott@perturb.org>
Sat, 5 Jun 2021 18:12:09 +0000 (11:12 -0700)
committerW. Felix Handte <w@felixhandte.com>
Thu, 10 Jun 2021 16:53:07 +0000 (12:53 -0400)
programs/util.c

index 1ca8eec190249cc78ceba29e168837a4dde3a356..f99bf82c59899650176f0fa01ac609df676478f8 100644 (file)
@@ -122,27 +122,23 @@ int UTIL_requireUserConfirmation(const char* prompt, const char* abortMsg,
 ***************************************/
 
 char* humanSize(unsigned long long size, char* str) {
-       /* This only works on 64 bit platforms so I commented it out for now */
-       /*
-       if (size > 1125899906842624L) {
-               snprintf(str, 7, "%.1fP", (float)size / 1125899906842624L);
-       } else if (size > 1099511627776L) {
-               snprintf(str, 7, "%.1fT", (float)size / 1099511627776L);
-       */
-
-       if (size > 1073741824L) {
-               snprintf(str, 7, "%.1fG", (float)size / 1073741824L);
-       } else if (size > 1048576L) {
-               snprintf(str, 7, "%.1fM", (float)size / 1048576L);
-       } else if (size > 1024) {
-               snprintf(str, 7, "%.1fK", (float)size / 1024);
-       } else if (size <= 1024) {
-               snprintf(str, 7, "%lluB", size);
-       } else {
-               str[0] = '\0';
-       }
-
-       return str;
+    if (size > 1125899906842624L) {
+        snprintf(str, 7, "%.1fP", (float)size / 1125899906842624L);
+    } else if (size > 1099511627776L) {
+        snprintf(str, 7, "%.1fT", (float)size / 1099511627776L);
+    } else if (size > 1073741824L) {
+        snprintf(str, 7, "%.1fG", (float)size / 1073741824L);
+    } else if (size > 1048576L) {
+        snprintf(str, 7, "%.1fM", (float)size / 1048576L);
+    } else if (size > 1024) {
+        snprintf(str, 7, "%.1fK", (float)size / 1024);
+    } else if (size <= 1024) {
+        snprintf(str, 7, "%lluB", size);
+    } else {
+        str[0] = '\0';
+    }
+
+    return str;
 }