dos2unix: tiny shrink
[oweals/busybox.git] / libbb / human_readable.c
index 7469e7999422bf1b4004d5ce1d58ced934b172b5..d60ef61d7fbd224d3842857f9b95a3ea3d939b77 100644 (file)
  *      and "#if 0"'d below.
  */
 
-#include <stdio.h>
 #include "libbb.h"
 
 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' };
-       static const char fmt[] = "%llu";
-       static const char fmt_tenths[] = "%llu.%d%c";
+       /* The code will adjust for additional (appended) units */
+       static const char zero_and_units[] ALIGN1 = { '0', 0, 'k', 'M', 'G', 'T' };
+       static const char fmt[] ALIGN1 = "%llu";
+       static const char fmt_tenths[] ALIGN1 = "%llu.%d%c";
 
-       static char str[21];            /* Sufficient for 64 bit unsigned integers. */
+       static char str[21] ALIGN1;  /* Sufficient for 64 bit unsigned integers */
 
        unsigned long long val;
        int frac;
@@ -54,7 +53,7 @@ const char *make_human_readable_str(unsigned long long size,
        }
 
        if (display_unit) {
-               val += display_unit/2;  /* Deal with rounding. */
+               val += display_unit/2;  /* Deal with rounding */
                val /= display_unit;    /* Don't combine with the line above!!! */
        } else {
                ++u;
@@ -76,7 +75,7 @@ const char *make_human_readable_str(unsigned long long size,
                        if (frac >= 5) {
                                ++val;
                        }
-                       f = "%llu%*c" /* fmt_no_tenths */ ;
+                       f = "%llu%*c" /* fmt_no_tenths */;
                        frac = 1;
                }
 #endif