Changeset 59958992 in mainline for uspace/app/tmon/burst_tests.c
- Timestamp:
- 2017-12-22T15:08:49Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8e16454
- Parents:
- acb9aa7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tmon/burst_tests.c
racb9aa7 r59958992 40 40 #include <getopt.h> 41 41 #include <usbdiag_iface.h> 42 #include <macros.h> 42 43 #include "commands.h" 43 44 #include "tf.h" … … 115 116 { .prefix = 'G', .factor = 1ul << 30 }, 116 117 { .prefix = 'M', .factor = 1ul << 20 }, 117 { .prefix = 'k', .factor = 1ul << 10 }, 118 { /* NULL-terminated */ } 118 { .prefix = 'k', .factor = 1ul << 10 } 119 119 }; 120 120 121 121 static char * format_size(double size, const char *fmt) 122 122 { 123 inti;124 for (i = 0; units[i].prefix; ++i) {123 unsigned i; 124 for (i = 0; i < ARRAY_SIZE(units); ++i) { 125 125 if (units[i].factor <= size) 126 126 break; 127 127 } 128 128 129 char prefix[ 2] = { '\0', '\0' };129 char prefix[] = { '\0', '\0' }; 130 130 double factor = 1; 131 131 132 if ( units[i].prefix) {132 if (i < ARRAY_SIZE(units)) { 133 133 prefix[0] = units[i].prefix; 134 134 factor = units[i].factor;
Note:
See TracChangeset
for help on using the changeset viewer.