Changeset d76a329 in mainline for uspace/app/top/top.c


Ignore:
Timestamp:
2012-04-16T20:08:30Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b1213b0
Parents:
f76696f
Message:

Fix cstyle.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/top/top.c

    rf76696f rd76a329  
    371371
    372372        switch (fa->type) {
    373                 case FIELD_EMPTY:
    374                         return 0;
    375                 case FIELD_UINT_SUFFIX_BIN: /* fallthrough */
    376                 case FIELD_UINT_SUFFIX_DEC: /* fallthrough */
    377                 case FIELD_UINT:
    378                         if (fa->uint > fb->uint)
    379                                 return 1 * sort_reverse;
    380                         if (fa->uint < fb->uint)
    381                                 return -1 * sort_reverse;
    382                         return 0;
    383                 case FIELD_PERCENT:
    384                         if (fa->fixed.upper * fb->fixed.lower
    385                             > fb->fixed.upper * fa->fixed.lower)
    386                                 return 1 * sort_reverse;
    387                         if (fa->fixed.upper * fb->fixed.lower
    388                             < fb->fixed.upper * fa->fixed.lower)
    389                                 return -1 * sort_reverse;
    390                         return 0;
    391                 case FIELD_STRING:
    392                         return str_cmp(fa->string, fb->string) * sort_reverse;
     373        case FIELD_EMPTY:
     374                return 0;
     375        case FIELD_UINT_SUFFIX_BIN: /* fallthrough */
     376        case FIELD_UINT_SUFFIX_DEC: /* fallthrough */
     377        case FIELD_UINT:
     378                if (fa->uint > fb->uint)
     379                        return 1 * sort_reverse;
     380                if (fa->uint < fb->uint)
     381                        return -1 * sort_reverse;
     382                return 0;
     383        case FIELD_PERCENT:
     384                if (fa->fixed.upper * fb->fixed.lower
     385                    > fb->fixed.upper * fa->fixed.lower)
     386                        return 1 * sort_reverse;
     387                if (fa->fixed.upper * fb->fixed.lower
     388                    < fb->fixed.upper * fa->fixed.lower)
     389                        return -1 * sort_reverse;
     390                return 0;
     391        case FIELD_STRING:
     392                return str_cmp(fa->string, fb->string) * sort_reverse;
    393393        }
    394394
     
    521521
    522522        switch (op_mode) {
    523                 case OP_TASKS:
    524                         return fill_task_table(data);
    525                 case OP_IPC:
    526                         return fill_ipc_table(data);
    527                 case OP_EXCS:
    528                         return fill_exception_table(data);
     523        case OP_TASKS:
     524                return fill_task_table(data);
     525        case OP_IPC:
     526                return fill_ipc_table(data);
     527        case OP_EXCS:
     528                return fill_exception_table(data);
    529529        }
    530530        return NULL;
     
    627627
    628628                switch (c) {
    629                         case -1: /* do nothing */
     629                case -1: /* do nothing */
     630                        break;
     631                case 't':
     632                        op_mode = OP_TASKS;
     633                        break;
     634                case 'i':
     635                        op_mode = OP_IPC;
     636                        break;
     637                case 'e':
     638                        op_mode = OP_EXCS;
     639                        break;
     640                case 's':
     641                        screen_mode = SCREEN_SORT;
     642                        break;
     643                case 'r':
     644                        sort_reverse = -sort_reverse;
     645                        break;
     646                case 'h':
     647                case '?':
     648                        screen_mode = SCREEN_HELP;
     649                        break;
     650                case 'q':
     651                        goto out;
     652                case 'a':
     653                        if (op_mode == OP_EXCS) {
     654                                excs_all = !excs_all;
     655                                if (excs_all)
     656                                        show_warning("Showing all exceptions");
     657                                else
     658                                        show_warning("Showing only hot exceptions");
    630659                                break;
    631                         case 't':
    632                                 op_mode = OP_TASKS;
    633                                 break;
    634                         case 'i':
    635                                 op_mode = OP_IPC;
    636                                 break;
    637                         case 'e':
    638                                 op_mode = OP_EXCS;
    639                                 break;
    640                         case 's':
    641                                 screen_mode = SCREEN_SORT;
    642                                 break;
    643                         case 'r':
    644                                 sort_reverse = -sort_reverse;
    645                                 break;
    646                         case 'h':
    647                         case '?':
    648                                 screen_mode = SCREEN_HELP;
    649                                 break;
    650                         case 'q':
    651                                 goto out;
    652                         case 'a':
    653                                 if (op_mode == OP_EXCS) {
    654                                         excs_all = !excs_all;
    655                                         if (excs_all)
    656                                                 show_warning("Showing all exceptions");
    657                                         else
    658                                                 show_warning("Showing only hot exceptions");
    659                                         break;
    660                                 }
    661                                 /* fallthrough */
    662                         default:
    663                                 show_warning("Unknown command \"%c\", use \"h\" for help", c);
    664                                 continue; /* don't redraw */
     660                        }
     661                        /* fallthrough */
     662                default:
     663                        show_warning("Unknown command \"%c\", use \"h\" for help", c);
     664                        continue; /* don't redraw */
    665665                }
    666666
Note: See TracChangeset for help on using the changeset viewer.