]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
include/types: space between number and units
authorSage Weil <sage@redhat.com>
Thu, 17 May 2018 15:04:18 +0000 (10:04 -0500)
committerSage Weil <sage@redhat.com>
Mon, 21 May 2018 02:26:28 +0000 (21:26 -0500)
not

    client:   504B/s rd, 10.6MiB/s wr, 0op/s rd, 30op/s wr

but

    client:   504 B/s rd, 10.6 MiB/s wr, 0 op/s rd, 30 op/s wr

This was changed as part of d3cecebacdcebcf475808a6204de22dfa94d729d.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 9cbd283bc60c35f84458a343421f513508ae0f04)

src/include/types.h

index 5169f6b32cde5d0459bc2bc35d7f9ed7e5530949..df4d3e1a245639987be36606f26dba8828701128 100644 (file)
@@ -363,11 +363,11 @@ namespace {
     char buffer[32];
 
     if (index == 0) {
-      (void) snprintf(buffer, sizeof(buffer), "%" PRId64 "%s", n, u);
+      (void) snprintf(buffer, sizeof(buffer), "%" PRId64 " %s", n, u);
     } else if ((v % mult) == 0) {
       // If this is an even multiple of the base, always display
       // without any decimal fraction.
-      (void) snprintf(buffer, sizeof(buffer), "%" PRId64 "%s", n, u);
+      (void) snprintf(buffer, sizeof(buffer), "%" PRId64 " %s", n, u);
     } else {
       // We want to choose a precision that reflects the best choice
       // for fitting in 5 characters.  This can get rather tricky when
@@ -378,7 +378,7 @@ namespace {
       // easier just to try each combination in turn.
       int i;
       for (i = 2; i >= 0; i--) {
-        if (snprintf(buffer, sizeof(buffer), "%.*f%s", i,
+        if (snprintf(buffer, sizeof(buffer), "%.*f %s", i,
           static_cast<double>(v) / mult, u) <= 7)
           break;
       }