]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
util,test: rename variable non_iec -> si
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 27 Jun 2019 01:17:20 +0000 (10:17 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 27 Jun 2019 01:17:20 +0000 (10:17 +0900)
src/basic/format-util.c
src/test/test-format-util.c

index 4231fa8d3fc629c00b90e8e2be2eca8af71ac2d6..aec929a06a80f7e3524deab3041f3fdf818fe6f5 100644 (file)
@@ -23,7 +23,7 @@ char *format_bytes_full(char *buf, size_t l, uint64_t t, FormatBytesFlag flag) {
                 { "G", UINT64_C(1024)*UINT64_C(1024)*UINT64_C(1024) },
                 { "M", UINT64_C(1024)*UINT64_C(1024) },
                 { "K", UINT64_C(1024) },
-        }, table_non_iec[] = {
+        }, table_si[] = {
                 { "E", UINT64_C(1000)*UINT64_C(1000)*UINT64_C(1000)*UINT64_C(1000)*UINT64_C(1000)*UINT64_C(1000) },
                 { "P", UINT64_C(1000)*UINT64_C(1000)*UINT64_C(1000)*UINT64_C(1000)*UINT64_C(1000) },
                 { "T", UINT64_C(1000)*UINT64_C(1000)*UINT64_C(1000)*UINT64_C(1000) },
@@ -34,12 +34,12 @@ char *format_bytes_full(char *buf, size_t l, uint64_t t, FormatBytesFlag flag) {
         const suffix_table *table;
         size_t n, i;
 
-        assert_cc(ELEMENTSOF(table_iec) == ELEMENTSOF(table_non_iec));
+        assert_cc(ELEMENTSOF(table_iec) == ELEMENTSOF(table_si));
 
         if (t == (uint64_t) -1)
                 return NULL;
 
-        table = flag & FORMAT_BYTES_USE_IEC ? table_iec : table_non_iec;
+        table = flag & FORMAT_BYTES_USE_IEC ? table_iec : table_si;
         n = ELEMENTSOF(table_iec);
 
         for (i = 0; i < n; i++)
index 2986b1bd8d3ba6435d623a411285a213c5801217..a60f9fe689145699dd7d874c895b0f45e469de9a 100644 (file)
@@ -5,13 +5,13 @@
 #include "string-util.h"
 
 static void test_format_bytes_one(size_t val, bool trailing_B, const char *iec_with_p, const char *iec_without_p,
-                                  const char *non_iec_with_p, const char *non_iec_without_p) {
+                                  const char *si_with_p, const char *si_without_p) {
         char buf[FORMAT_BYTES_MAX];
 
         assert_se(streq_ptr(format_bytes_full(buf, sizeof buf, val, FORMAT_BYTES_USE_IEC | FORMAT_BYTES_BELOW_POINT | (trailing_B ? FORMAT_BYTES_TRAILING_B : 0)), iec_with_p));
         assert_se(streq_ptr(format_bytes_full(buf, sizeof buf, val, FORMAT_BYTES_USE_IEC | (trailing_B ? FORMAT_BYTES_TRAILING_B : 0)), iec_without_p));
-        assert_se(streq_ptr(format_bytes_full(buf, sizeof buf, val, FORMAT_BYTES_BELOW_POINT | (trailing_B ? FORMAT_BYTES_TRAILING_B : 0)), non_iec_with_p));
-        assert_se(streq_ptr(format_bytes_full(buf, sizeof buf, val, trailing_B ? FORMAT_BYTES_TRAILING_B : 0), non_iec_without_p));
+        assert_se(streq_ptr(format_bytes_full(buf, sizeof buf, val, FORMAT_BYTES_BELOW_POINT | (trailing_B ? FORMAT_BYTES_TRAILING_B : 0)), si_with_p));
+        assert_se(streq_ptr(format_bytes_full(buf, sizeof buf, val, trailing_B ? FORMAT_BYTES_TRAILING_B : 0), si_without_p));
 }
 
 static void test_format_bytes(void) {