Changeset 1433ecda in mainline for uspace/srv/hid/isdv4_tablet/main.c


Ignore:
Timestamp:
2018-04-04T15:42:37Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2c4e1cc
Parents:
47b2d7e3
Message:

Fix cstyle: make ccheck-fix and commit only files where all the changes are good.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/isdv4_tablet/main.c

    r47b2d7e3 r1433ecda  
    9494        fibril_mutex_unlock(&client_mutex);
    9595
    96         if (!sess) return;
     96        if (!sess)
     97                return;
    9798
    9899        async_exch_t *exch = async_exchange_begin(sess);
     
    105106                }
    106107                async_msg_4(exch, MOUSEEV_ABS_MOVE_EVENT, event->x, event->y,
    107                                     max_x, max_y);
     108                    max_x, max_y);
    108109                if (event->type == PRESS || event->type == RELEASE) {
    109110                        async_msg_2(exch, MOUSEEV_BUTTON_EVENT, event->button,
    110                                     event->type == PRESS);
     111                            event->type == PRESS);
    111112                }
    112113        }
     
    118119        const char *type = NULL;
    119120        switch (event->type) {
    120                 case PRESS:
    121                         type = "PRESS";
    122                         break;
    123                 case RELEASE:
    124                         type = "RELEASE";
    125                         break;
    126                 case PROXIMITY_IN:
    127                         type = "PROXIMITY IN";
    128                         break;
    129                 case PROXIMITY_OUT:
    130                         type = "PROXIMITY OUT";
    131                         break;
    132                 case MOVE:
    133                         type = "MOVE";
    134                         break;
    135                 default:
    136                         type = "UNKNOWN";
    137                         break;
     121        case PRESS:
     122                type = "PRESS";
     123                break;
     124        case RELEASE:
     125                type = "RELEASE";
     126                break;
     127        case PROXIMITY_IN:
     128                type = "PROXIMITY IN";
     129                break;
     130        case PROXIMITY_OUT:
     131                type = "PROXIMITY OUT";
     132                break;
     133        case MOVE:
     134                type = "MOVE";
     135                break;
     136        default:
     137                type = "UNKNOWN";
     138                break;
    138139        }
    139140
    140141        const char *source = NULL;
    141142        switch (event->source) {
    142                 case STYLUS_TIP:
    143                         source = "stylus tip";
    144                         break;
    145                 case STYLUS_ERASER:
    146                         source = "stylus eraser";
    147                         break;
    148                 case TOUCH:
    149                         source = "touch";
    150                         break;
     143        case STYLUS_TIP:
     144                source = "stylus tip";
     145                break;
     146        case STYLUS_ERASER:
     147                source = "stylus eraser";
     148                break;
     149        case TOUCH:
     150                source = "touch";
     151                break;
    151152        }
    152153
     
    160161{
    161162        switch (data_id) {
    162                 case 0:
    163                         return "resistive+stylus";
    164                 case 1:
    165                         return "capacitive+stylus";
    166                 case 2:
    167                         return "resistive";
    168                 case 3:
    169                 case 4:
    170                         return "capacitive";
    171                 case 5:
    172                         return "penabled";
     163        case 0:
     164                return "resistive+stylus";
     165        case 1:
     166                return "capacitive+stylus";
     167        case 2:
     168                return "resistive";
     169        case 3:
     170        case 4:
     171                return "capacitive";
     172        case 5:
     173                return "penabled";
    173174        }
    174175        return "unknown";
     
    189190        if (argc > arg && str_test_prefix(argv[arg], "--baud=")) {
    190191                size_t arg_offset = str_lsize(argv[arg], 7);
    191                 char* arg_str = argv[arg] + arg_offset;
     192                char *arg_str = argv[arg] + arg_offset;
    192193                if (str_length(arg_str) == 0) {
    193194                        fprintf(stderr, "--baud requires an argument\n");
     
    219220                }
    220221                arg++;
    221         }
    222         else {
     222        } else {
    223223                category_id_t serial_cat_id;
    224224
     
    233233                size_t svc_count;
    234234
    235                 rc = loc_category_get_svcs(serial_cat_id, &svc_ids, &svc_count);                if (rc != EOK) {
     235                rc = loc_category_get_svcs(serial_cat_id, &svc_ids, &svc_count);
     236                if (rc != EOK) {
    236237                        fprintf(stderr, "Failed getting list of services\n");
    237238                        return 1;
     
    301302        if (state.stylus_tilt_supported) {
    302303                printf("%ux%u\n", state.stylus_max_xtilt, state.stylus_max_ytilt);
    303         }
    304         else {
     304        } else {
    305305                printf("not supported\n");
    306306        }
    307307        printf(" Touch: %ux%u type: %s\n", state.touch_max_x, state.touch_max_y,
    308                 touch_type(state.touch_type));
     308            touch_type(state.touch_type));
    309309
    310310        fid_t fibril = fibril_create(read_fibril, NULL);
     
    337337        if (rc != EOK) {
    338338                printf(NAME ": Unable to get mouse category id.\n");
    339         }
    340         else {
     339        } else {
    341340                rc = loc_service_add_to_cat(service_id, mouse_category);
    342341                if (rc != EOK) {
Note: See TracChangeset for help on using the changeset viewer.