Changeset d76a329 in mainline for uspace/app/top/screen.c
- Timestamp:
- 2012-04-16T20:08:30Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b1213b0
- Parents:
- f76696f
- File:
-
- 1 edited
-
uspace/app/top/screen.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/top/screen.c
rf76696f rd76a329 400 400 401 401 switch (field->type) { 402 case FIELD_EMPTY:403 printf("%*s", width, "");404 break;405 case FIELD_UINT:406 printf("%*" PRIu64, width, field->uint);407 break;408 case FIELD_UINT_SUFFIX_BIN: {409 uint64_t val = field->uint;410 const char *suffix;411 width -= 3;412 bin_order_suffix(val, &val, &suffix, true);413 printf("%*" PRIu64 "%s", width, val, suffix);414 break;415 }416 case FIELD_UINT_SUFFIX_DEC: {417 uint64_t val = field->uint;418 char suffix;419 width -= 1;420 order_suffix(val, &val, &suffix);421 printf("%*" PRIu64 "%c", width, val, suffix);422 break;423 }424 case FIELD_PERCENT:425 width -= 5; /* nnn.% */426 if (width > 2) {427 printf("%*s", width - 2, "");428 width = 2;429 }430 print_percent(field->fixed, width);431 break;432 case FIELD_STRING:433 printf("%-*.*s", width, width, field->string);434 break;402 case FIELD_EMPTY: 403 printf("%*s", width, ""); 404 break; 405 case FIELD_UINT: 406 printf("%*" PRIu64, width, field->uint); 407 break; 408 case FIELD_UINT_SUFFIX_BIN: { 409 uint64_t val = field->uint; 410 const char *suffix; 411 width -= 3; 412 bin_order_suffix(val, &val, &suffix, true); 413 printf("%*" PRIu64 "%s", width, val, suffix); 414 break; 415 } 416 case FIELD_UINT_SUFFIX_DEC: { 417 uint64_t val = field->uint; 418 char suffix; 419 width -= 1; 420 order_suffix(val, &val, &suffix); 421 printf("%*" PRIu64 "%c", width, val, suffix); 422 break; 423 } 424 case FIELD_PERCENT: 425 width -= 5; /* nnn.% */ 426 if (width > 2) { 427 printf("%*s", width - 2, ""); 428 width = 2; 429 } 430 print_percent(field->fixed, width); 431 break; 432 case FIELD_STRING: 433 printf("%-*.*s", width, width, field->string); 434 break; 435 435 } 436 436
Note:
See TracChangeset
for help on using the changeset viewer.
