Try to make indent formatting less horrible
[oweals/busybox.git] / libbb / human_readable.c
index 548712c75bcd624f456182d0498964267ee1ef24..656889150d7ac79a2df47c305eac2a557b770510 100644 (file)
  *      representations (say, powers of 1024) and manipulating coefficients.
  *      The base ten "bytes" output could be handled similarly.
  *
- *   2) The output of "ls -sh" can be misaligned because this routine always
- *      outputs a decimal point and a tenths digit when display_unit != 0.
- *      Hence, it isn't uncommon for the returned string to have a length
- *      of 5 or 6 instead of <= 4 (as assumed).
+ *   2) This routine always outputs a decimal point and a tenths digit when 
+ *      display_unit != 0.  Hence, it isn't uncommon for the returned string 
+ *      to have a length of 5 or 6.
  *
  *      It might be nice to add a flag to indicate no decimal digits in
  *      that case.  This could be either an additional parameter, or a
@@ -29,9 +28,8 @@
 #include <stdio.h>
 #include "libbb.h"
 
-const char *make_human_readable_str(unsigned long size, 
-                                                                       unsigned long block_size,
-                                                                       unsigned long display_unit)
+const char *make_human_readable_str(unsigned long long size, 
+       unsigned long block_size, unsigned long display_unit)
 {
        /* The code will adjust for additional (appended) units. */
        static const char zero_and_units[] = { '0', 0, 'k', 'M', 'G', 'T' };
@@ -49,7 +47,7 @@ const char *make_human_readable_str(unsigned long size,
        f = fmt;
        frac = 0;
 
-       val = ((unsigned long long) size) * block_size;
+       val = size * block_size;
        if (val == 0) {
                return u;
        }