Changeset 3bacee1 in mainline for uspace/app


Ignore:
Timestamp:
2018-04-12T16:27:17Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3cf22f9
Parents:
76d0981d
git-author:
Jiri Svoboda <jiri@…> (2018-04-11 19:25:33)
git-committer:
Jiri Svoboda <jiri@…> (2018-04-12 16:27:17)
Message:

Make ccheck-fix again and commit more good files.

Location:
uspace/app
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/cmp/cmp.c

    r76d0981d r3bacee1  
    5959                help_cmd_cmp(HELP_SHORT);
    6060                printf(
    61                 "Usage:  %s [options] <file1> <file2>\n"
    62                 "Options:\n"
    63                 "  -h, --help       A short option summary\n"
    64                 "  -v, --version    Print version information and exit\n"
    65                 "No output is printed; the return code is 1 if the files differ.\n",
    66                 cmdname);
     61                    "Usage:  %s [options] <file1> <file2>\n"
     62                    "Options:\n"
     63                    "  -h, --help       A short option summary\n"
     64                    "  -v, --version    Print version information and exit\n"
     65                    "No output is printed; the return code is 1 if the files differ.\n",
     66                    cmdname);
    6767        }
    6868
     
    7373{
    7474        errno_t rc = EOK;
    75         const char *fn[2] = {fn0, fn1};
    76         int fd[2] = {-1, -1};
     75        const char *fn[2] = { fn0, fn1 };
     76        int fd[2] = { -1, -1 };
    7777        char buffer[2][CMP_BUFLEN];
    7878        size_t offset[2];
    79         aoff64_t pos[2] = {};
     79        aoff64_t pos[2] = { };
    8080
    8181        for (int i = 0; i < 2; i++) {
     
    142142        if (argc - optind != 2) {
    143143                printf("%s - incorrect number of arguments. Try `%s --help'\n",
    144                         cmdname, cmdname);
     144                    cmdname, cmdname);
    145145                return CMD_FAILURE;
    146146        }
  • uspace/app/bdsh/test/toktest.c

    r76d0981d r3bacee1  
    4343
    4444/* Tokenize the input, asserts that number of tokens is okay. */
    45 static void prepare(const char *input, size_t expected_token_count) {
     45static void prepare(const char *input, size_t expected_token_count)
     46{
    4647        str_cpy(input_buffer, MAX_INPUT, input);
    4748
     
    6869PCUT_TEST_SUITE(tokenizer);
    6970
    70 PCUT_TEST_AFTER {
     71PCUT_TEST_AFTER
     72{
    7173        /* Destroy the tokenizer. */
    7274        tok_fini(&tokenizer);
     
    7476
    7577
    76 PCUT_TEST(empty_input) {
     78PCUT_TEST(empty_input)
     79{
    7780        prepare("", 0);
    7881}
    7982
    80 PCUT_TEST(only_spaces) {
     83PCUT_TEST(only_spaces)
     84{
    8185        prepare("   ", 1);
    8286
     
    8488}
    8589
    86 PCUT_TEST(two_text_tokens) {
     90PCUT_TEST(two_text_tokens)
     91{
    8792        prepare("alpha  bravo", 3);
    8893
  • uspace/app/mkbd/main.c

    r76d0981d r3bacee1  
    145145
    146146        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
    147             report, NULL, path, USB_HID_PATH_COMPARE_END
    148             | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     147            report, NULL, path, USB_HID_PATH_COMPARE_END |
     148            USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    149149            USB_HID_REPORT_TYPE_INPUT);
    150150
     
    157157
    158158                field = usb_hid_report_get_sibling(
    159                     report, field, path, USB_HID_PATH_COMPARE_END
    160                     | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     159                    report, field, path, USB_HID_PATH_COMPARE_END |
     160                    USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    161161                    USB_HID_REPORT_TYPE_INPUT);
    162162        }
     
    228228        if (!sess) {
    229229                printf(NAME ": failed to connect to the device (handle %"
    230                        PRIun "): %s.\n", dev_handle, str_error(errno));
     230                    PRIun "): %s.\n", dev_handle, str_error(errno));
    231231                return errno;
    232232        }
     
    238238        if (rc != EOK) {
    239239                printf(NAME ": failed to get path (handle %"
    240                        PRIun "): %s.\n", dev_handle, str_error(errno));
     240                    PRIun "): %s.\n", dev_handle, str_error(errno));
    241241                return ENOMEM;
    242242        }
  • uspace/app/sbi/src/run_expr.c

    r76d0981d r3bacee1  
    311311                assert(csi != NULL);
    312312
    313                 if (symbol_search_csi(run->program, csi, nameref->name)
    314                     == NULL) {
     313                if (symbol_search_csi(run->program, csi, nameref->name) ==
     314                    NULL) {
    315315                        /* Function is not in the current object. */
    316316                        printf("Error: Cannot access non-static member "
     
    349349                assert(csi != NULL);
    350350
    351                 if (symbol_search_csi(run->program, csi, nameref->name)
    352                     == NULL && !stree_symbol_is_static(sym)) {
     351                if (symbol_search_csi(run->program, csi, nameref->name) ==
     352                    NULL && !stree_symbol_is_static(sym)) {
    353353                        /* Symbol is not in the current object. */
    354354                        printf("Error: Cannot access non-static member "
     
    12711271        switch (unop->uc) {
    12721272        case uo_plus:
    1273                 bigint_clone(&val->var->u.int_v->value, &int_v->value);
     1273                bigint_clone(&val->var->u.int_v->value, &int_v->value);
    12741274                break;
    12751275        case uo_minus:
     
    13181318                c2 = &v2->var->u.char_v->value;
    13191319
    1320                 bigint_sub(c1, c2, &diff);
     1320                bigint_sub(c1, c2, &diff);
    13211321                *res = bigint_is_zero(&diff);
    13221322                break;
     
    14381438        }
    14391439
    1440         i = 0; length = 1;
     1440        i = 0;
     1441        length = 1;
    14411442        while (node != NULL) {
    14421443                expr = list_node_data(node, stree_expr_t *);
     
    15671568                *res = run_recovery_item(run);
    15681569                goto cleanup;
    1569         }
     1570        }
    15701571
    15711572        if (rarg == NULL) {
     
    27552756
    27562757        switch (rarg_vi->u.value->var->vc) {
    2757         case vc_bool: csi_sym = bi->boxed_bool; break;
    2758         case vc_char: csi_sym = bi->boxed_char; break;
    2759         case vc_int: csi_sym = bi->boxed_int; break;
    2760         case vc_string: csi_sym = bi->boxed_string; break;
     2758        case vc_bool:
     2759                csi_sym = bi->boxed_bool;
     2760                break;
     2761        case vc_char:
     2762                csi_sym = bi->boxed_char;
     2763                break;
     2764        case vc_int:
     2765                csi_sym = bi->boxed_int;
     2766                break;
     2767        case vc_string:
     2768                csi_sym = bi->boxed_string;
     2769                break;
    27612770
    27622771        case vc_ref:
  • uspace/app/sbi/src/stype_expr.c

    r76d0981d r3bacee1  
    151151
    152152        switch (expr->ec) {
    153         case ec_nameref: stype_nameref(stype, expr->u.nameref, &et); break;
    154         case ec_literal: stype_literal(stype, expr->u.literal, &et); break;
    155         case ec_self_ref: stype_self_ref(stype, expr->u.self_ref, &et); break;
    156         case ec_binop: stype_binop(stype, expr->u.binop, &et); break;
    157         case ec_unop: stype_unop(stype, expr->u.unop, &et); break;
    158         case ec_new: stype_new(stype, expr->u.new_op, &et); break;
    159         case ec_access: stype_access(stype, expr->u.access, &et); break;
    160         case ec_call: stype_call(stype, expr->u.call, &et); break;
    161         case ec_index: stype_index(stype, expr->u.index, &et); break;
    162         case ec_assign: stype_assign(stype, expr->u.assign, &et); break;
    163         case ec_as: stype_as(stype, expr->u.as_op, &et); break;
    164         case ec_box: stype_box(stype, expr->u.box, &et); break;
     153        case ec_nameref:
     154                stype_nameref(stype, expr->u.nameref, &et);
     155                break;
     156        case ec_literal:
     157                stype_literal(stype, expr->u.literal, &et);
     158                break;
     159        case ec_self_ref:
     160                stype_self_ref(stype, expr->u.self_ref, &et);
     161                break;
     162        case ec_binop:
     163                stype_binop(stype, expr->u.binop, &et);
     164                break;
     165        case ec_unop:
     166                stype_unop(stype, expr->u.unop, &et);
     167                break;
     168        case ec_new:
     169                stype_new(stype, expr->u.new_op, &et);
     170                break;
     171        case ec_access:
     172                stype_access(stype, expr->u.access, &et);
     173                break;
     174        case ec_call:
     175                stype_call(stype, expr->u.call, &et);
     176                break;
     177        case ec_index:
     178                stype_index(stype, expr->u.index, &et);
     179                break;
     180        case ec_assign:
     181                stype_assign(stype, expr->u.assign, &et);
     182                break;
     183        case ec_as:
     184                stype_as(stype, expr->u.as_op, &et);
     185                break;
     186        case ec_box:
     187                stype_box(stype, expr->u.box, &et);
     188                break;
    165189        }
    166190
     
    362386
    363387        switch (literal->ltc) {
    364         case ltc_bool: tpc = tpc_bool; break;
    365         case ltc_char: tpc = tpc_char; break;
    366         case ltc_int: tpc = tpc_int; break;
    367         case ltc_ref: tpc = tpc_nil; break;
    368         case ltc_string: tpc = tpc_string; break;
     388        case ltc_bool:
     389                tpc = tpc_bool;
     390                break;
     391        case ltc_char:
     392                tpc = tpc_char;
     393                break;
     394        case ltc_int:
     395                tpc = tpc_int;
     396                break;
     397        case ltc_ref:
     398                tpc = tpc_nil;
     399                break;
     400        case ltc_string:
     401                tpc = tpc_string;
     402                break;
    369403        }
    370404
     
    17711805         * conversion destination.
    17721806         */
    1773         if (stype_targs_check_equal(stype, pred_ti, as_op->arg->titem)
    1774             != EOK) {
     1807        if (stype_targs_check_equal(stype, pred_ti, as_op->arg->titem) !=
     1808            EOK) {
    17751809                stype_convert_failure(stype, convc_as, as_op->arg, titem);
    17761810                *rtitem = titem;
  • uspace/app/stats/stats.c

    r76d0981d r3bacee1  
    124124                                printf("(none) ");
    125125
    126                         printf("%8" PRIu64"%c %8" PRIu64"%c\n",
     126                        printf("%8" PRIu64 "%c %8" PRIu64 "%c\n",
    127127                            ucycles, usuffix, kcycles, ksuffix);
    128128                }
     
    230230            "\n"
    231231            "Without any options all tasks are listed\n",
    232             name
    233         );
     232            name);
    234233}
    235234
  • uspace/app/taskdump/elf_core.c

    r76d0981d r3bacee1  
    176176        p_hdr[0].p_vaddr = 0;
    177177        p_hdr[0].p_paddr = 0;
    178         p_hdr[0].p_filesz = sizeof(elf_note_t)
    179             + ALIGN_UP((str_size("CORE") + 1), word_size)
    180             + ALIGN_UP(sizeof(elf_prstatus_t), word_size);
     178        p_hdr[0].p_filesz = sizeof(elf_note_t) +
     179            ALIGN_UP((str_size("CORE") + 1), word_size) +
     180            ALIGN_UP(sizeof(elf_prstatus_t), word_size);
    181181        p_hdr[0].p_memsz = 0;
    182182        p_hdr[0].p_flags = 0;
  • uspace/app/tester/mm/common.c

    r76d0981d r3bacee1  
    269269void fill_block(mem_block_t *block)
    270270{
    271         for (uint8_t *pos = block->addr, *end = pos + block->size;
     271        for (uint8_t * pos = block->addr, *end = pos + block->size;
    272272            pos < end; pos++)
    273273                *pos = block_expected_value(block, pos);
     
    286286void check_block(mem_block_t *block)
    287287{
    288         for (uint8_t *pos = block->addr, *end = pos + block->size;
     288        for (uint8_t * pos = block->addr, *end = pos + block->size;
    289289            pos < end; pos++) {
    290290                if (*pos != block_expected_value(block, pos)) {
     
    402402void fill_area(mem_area_t *area)
    403403{
    404         for (uint8_t *pos = area->addr, *end = pos + area->size;
     404        for (uint8_t * pos = area->addr, *end = pos + area->size;
    405405            pos < end; pos++)
    406406                *pos = area_expected_value(area, pos);
  • uspace/app/tester/print/print6.c

    r76d0981d r3bacee1  
    6363                /* Special */
    6464                { 1e300 * 1e300, "%g",  "inf", 0 },
    65                 { -1.0 /(1e300 * 1e300), "%g",  "-0", 0 },
     65                { -1.0 / (1e300 * 1e300), "%g",  "-0", 0 },
    6666
    6767                { 1234567.8901, "%g",  "1234567.8901", 0 },
     
    130130
    131131                { 1e300 * 1e300, "%10.5e",  "       inf", 0 },
    132                 { -1.0 /(1e300 * 1e300), "%10.2e",  " -0.00e+00", 0 },
     132                { -1.0 / (1e300 * 1e300), "%10.2e",  " -0.00e+00", 0 },
    133133                /* __PRINTF_FLAG_BIGCHARS */
    134134                { 1e300 * 1e300, "%10.5E",  "       INF", 0 },
    135135                /* __PRINTF_FLAG_BIGCHARS */
    136                 { -1.0 /(1e300 * 1e300), "%10.2E",  " -0.00E+00", 0 },
     136                { -1.0 / (1e300 * 1e300), "%10.2E",  " -0.00E+00", 0 },
    137137
    138138                /*
     
    171171                /* Next closest to 0.1 */
    172172                { 0.0999999999999999917, "%+10.20f", "+0.09999999999999999170",
    173                     0 },
     173                        0 },
    174174                { 0.0999999999999999917, "%+10f",    " +0.100000", 0 },
    175175                { 0.0999999999999998945, "%10.20f",  "0.09999999999999989450",
    176                     0 },
     176                        0 },
    177177        };
    178178
  • uspace/app/tetris/tetris.c

    r76d0981d r3bacee1  
    5252
    5353static volatile const char copyright[] =
    54         "@(#) Copyright (c) 1992, 1993\n"
    55         "\tThe Regents of the University of California.  All rights reserved.\n";
     54    "@(#) Copyright (c) 1992, 1993\n"
     55    "\tThe Regents of the University of California.  All rights reserved.\n";
    5656
    5757#include <sys/time.h>
     
    185185        printf("Level = %d (press keys 1 - 9 to change)", level);
    186186        moveto(9, 10);
    187         printf("Preview is %s (press 'p' to change)", (showpreview ? "on ": "off"));
     187        printf("Preview is %s (press 'p' to change)", (showpreview ? "on " : "off"));
    188188        moveto(12, 10);
    189189        printf("Press 'h' to show hiscore table.");
     
    204204                int i = getchar();
    205205
    206                 switch(i) {
    207                         case 'p':
    208                                 showpreview = !showpreview;
    209                                 moveto(9, 21);
    210                                 if (showpreview)
    211                                         printf("on ");
    212                                 else
    213                                         printf("off");
    214                                 break;
    215                         case 'h':
    216                                 loadscores();
    217                                 showscores(firstgame);
    218                                 tetris_menu_draw(*level);
    219                                 break;
    220                         case 's':
    221                                 firstgame = 0;
    222                                 return 1;
    223                         case 'q':
    224                                 return 0;
    225                         case '1':
    226                         case '2':
    227                         case '3':
    228                         case '4':
    229                         case '5':
    230                         case '6':
    231                         case '7':
    232                         case '8':
    233                         case '9':
    234                                 *level = i - '0';
    235                                 moveto(8, 18);
    236                                 printf("%d", *level);
    237                                 break;
     206                switch (i) {
     207                case 'p':
     208                        showpreview = !showpreview;
     209                        moveto(9, 21);
     210                        if (showpreview)
     211                                printf("on ");
     212                        else
     213                                printf("off");
     214                        break;
     215                case 'h':
     216                        loadscores();
     217                        showscores(firstgame);
     218                        tetris_menu_draw(*level);
     219                        break;
     220                case 's':
     221                        firstgame = 0;
     222                        return 1;
     223                case 'q':
     224                        return 0;
     225                case '1':
     226                case '2':
     227                case '3':
     228                case '4':
     229                case '5':
     230                case '6':
     231                case '7':
     232                case '8':
     233                case '9':
     234                        *level = i - '0';
     235                        moveto(8, 18);
     236                        printf("%d", *level);
     237                        break;
    238238                }
    239239        }
     
    259259
    260260        while ((ch = getopt(argc, argv, "ck:ps")) != -1)
    261                 switch(ch) {
     261                switch (ch) {
    262262                case 'c':
    263263                        /*
  • uspace/app/top/top.c

    r76d0981d r3bacee1  
    6262
    6363static const column_t task_columns[] = {
    64         {"taskid",   't',  8},
    65         {"thrds",    'h',  7},
    66         {"resident", 'r', 10},
    67         {"%resi",    'R',  7},
    68         {"virtual",  'v',  9},
    69         {"%virt",    'V',  7},
    70         {"%user",    'U',  7},
    71         {"%kern",    'K',  7},
    72         {"name",     'd',  0},
     64        { "taskid",   't',  8 },
     65        { "thrds",    'h',  7 },
     66        { "resident", 'r', 10 },
     67        { "%resi",    'R',  7 },
     68        { "virtual",  'v',  9 },
     69        { "%virt",    'V',  7 },
     70        { "%user",    'U',  7 },
     71        { "%kern",    'K',  7 },
     72        { "name",     'd',  0 },
    7373};
    7474
     
    8787
    8888static const column_t ipc_columns[] = {
    89         {"taskid",  't', 8},
    90         {"cls snt", 'c', 9},
    91         {"cls rcv", 'C', 9},
    92         {"ans snt", 'a', 9},
    93         {"ans rcv", 'A', 9},
    94         {"forward", 'f', 9},
    95         {"name",    'd', 0},
     89        { "taskid",  't', 8 },
     90        { "cls snt", 'c', 9 },
     91        { "cls rcv", 'C', 9 },
     92        { "ans snt", 'a', 9 },
     93        { "ans rcv", 'A', 9 },
     94        { "forward", 'f', 9 },
     95        { "name",    'd', 0 },
    9696};
    9797
     
    108108
    109109static const column_t exception_columns[] = {
    110         {"exc",         'e',  8},
    111         {"count",       'n', 10},
    112         {"%count",      'N',  8},
    113         {"cycles",      'c', 10},
    114         {"%cycles",     'C',  9},
    115         {"description", 'd',  0},
     110        { "exc",         'e',  8 },
     111        { "count",       'n', 10 },
     112        { "%count",      'N',  8 },
     113        { "cycles",      'c', 10 },
     114        { "%cycles",     'C',  9 },
     115        { "description", 'd',  0 },
    116116};
    117117
     
    383383                return 0;
    384384        case FIELD_PERCENT:
    385                 if (fa->fixed.upper * fb->fixed.lower
    386                     > fb->fixed.upper * fa->fixed.lower)
     385                if (fa->fixed.upper * fb->fixed.lower >
     386                    fb->fixed.upper * fa->fixed.lower)
    387387                        return 1 * sort_reverse;
    388                 if (fa->fixed.upper * fb->fixed.lower
    389                     < fb->fixed.upper * fa->fixed.lower)
     388                if (fa->fixed.upper * fb->fixed.lower <
     389                    fb->fixed.upper * fa->fixed.lower)
    390390                        return -1 * sort_reverse;
    391391                return 0;
  • uspace/app/usbinfo/dump.c

    r76d0981d r3bacee1  
    6464                INDENT INDENT INDENT INDENT INDENT INDENT,
    6565        };
    66         static size_t indents_count = sizeof(indents)/sizeof(indents[0]);
     66        static size_t indents_count = sizeof(indents) / sizeof(indents[0]);
    6767        if (level >= indents_count) {
    6868                return indents[indents_count - 1];
     
    8484        for (i = 0; i < length; i++) {
    8585                printf("0x%02X", buffer[i]);
    86                 if (((i > 0) && (((i+1) % BYTES_PER_LINE) == 0))
    87                     || (i + 1 == length)) {
     86                if (((i > 0) && (((i + 1) % BYTES_PER_LINE) == 0)) ||
     87                    (i + 1 == length)) {
    8888                        printf("\n");
    8989                        if (i + 1 < length) {
  • uspace/app/usbinfo/hid.c

    r76d0981d r3bacee1  
    185185
    186186        if (is_descriptor_kind(raw_descriptor, USB_DESCTYPE_INTERFACE)) {
    187                 context->last_iface
    188                     = (usb_standard_interface_descriptor_t *) raw_descriptor;
     187                context->last_iface =
     188                    (usb_standard_interface_descriptor_t *) raw_descriptor;
    189189                return;
    190190        }
     
    198198        }
    199199
    200         usb_standard_hid_descriptor_t *hid_descr
    201             = (usb_standard_hid_descriptor_t *) raw_descriptor;
     200        usb_standard_hid_descriptor_t *hid_descr =
     201            (usb_standard_hid_descriptor_t *) raw_descriptor;
    202202
    203203        if (hid_descr->report_desc_info.type != USB_DESCTYPE_HID_REPORT) {
  • uspace/app/usbinfo/info.c

    r76d0981d r3bacee1  
    7070        assert(usb_dev);
    7171
    72         usb_standard_interface_descriptor_t *iface
    73             = (usb_standard_interface_descriptor_t *) descriptor;
     72        usb_standard_interface_descriptor_t *iface =
     73            (usb_standard_interface_descriptor_t *) descriptor;
    7474
    7575        printf("%sInterface #%d match ids (%s, 0x%02x, 0x%02x)\n",
     
    143143        usb_endpoint_t endpoint_no = descriptor->endpoint_address & 0xF;
    144144        usb_transfer_type_t transfer = descriptor->attributes & 0x3;
    145         usb_direction_t direction = descriptor->endpoint_address & 0x80
    146             ? USB_DIRECTION_IN : USB_DIRECTION_OUT;
     145        usb_direction_t direction = descriptor->endpoint_address & 0x80 ?
     146            USB_DIRECTION_IN : USB_DIRECTION_OUT;
    147147        printf("%sEndpoint #%d (%s %s, %zu)\n", prefix,
    148148            endpoint_no, usb_str_transfer_type(transfer),
     
    226226                    dump_descriptor_tree_brief_hub);
    227227
    228                 default:
    229                         break;
     228        default:
     229                break;
    230230        }
    231231
  • uspace/app/vuhid/device.c

    r76d0981d r3bacee1  
    129129
    130130        /* Check that we have not run out of available endpoints. */
    131         if ((iface->in_data_size > 0)
    132             && (hid_data->in_endpoint_first_free >= VUHID_ENDPOINT_MAX)) {
     131        if ((iface->in_data_size > 0) &&
     132            (hid_data->in_endpoint_first_free >= VUHID_ENDPOINT_MAX)) {
    133133                return ELIMIT;
    134134        }
    135         if ((iface->out_data_size > 0)
    136             && (hid_data->out_endpoint_first_free >= VUHID_ENDPOINT_MAX)) {
     135        if ((iface->out_data_size > 0) &&
     136            (hid_data->out_endpoint_first_free >= VUHID_ENDPOINT_MAX)) {
    137137                return ELIMIT;
    138138        }
     
    192192        descr_iface->length = sizeof(usb_standard_interface_descriptor_t);
    193193        descr_iface->descriptor_type = USB_DESCTYPE_INTERFACE;
    194         descr_iface->interface_number
    195             = dev->descriptors->configuration->descriptor->interface_count;
     194        descr_iface->interface_number =
     195            dev->descriptors->configuration->descriptor->interface_count;
    196196        descr_iface->alternate_setting = 0;
    197197        descr_iface->endpoint_count = ep_count;
     
    230230                descr_ep_in->length = sizeof(usb_standard_endpoint_descriptor_t);
    231231                descr_ep_in->descriptor_type = USB_DESCTYPE_ENDPOINT;
    232                 descr_ep_in->endpoint_address
    233                     = 0x80 | hid_data->in_endpoint_first_free;
     232                descr_ep_in->endpoint_address =
     233                    0x80 | hid_data->in_endpoint_first_free;
    234234                descr_ep_in->attributes = 3;
    235235                descr_ep_in->max_packet_size = iface->in_data_size;
     
    246246                descr_ep_out->length = sizeof(usb_standard_endpoint_descriptor_t);
    247247                descr_ep_out->descriptor_type = USB_DESCTYPE_ENDPOINT;
    248                 descr_ep_out->endpoint_address
    249                     = 0x00 | hid_data->out_endpoint_first_free;
     248                descr_ep_out->endpoint_address =
     249                    0x00 | hid_data->out_endpoint_first_free;
    250250                descr_ep_out->attributes = 3;
    251251                descr_ep_out->max_packet_size = iface->out_data_size;
     
    256256        usbvirt_device_configuration_extras_t *extra_descriptors;
    257257        extra_descriptors = realloc(dev->descriptors->configuration->extra,
    258             sizeof(usbvirt_device_configuration_extras_t)
    259             * (dev->descriptors->configuration->extra_count + descr_count));
     258            sizeof(usbvirt_device_configuration_extras_t) *
     259            (dev->descriptors->configuration->extra_count + descr_count));
    260260        if (extra_descriptors == NULL) {
    261261                rc = ENOMEM;
     
    300300         */
    301301        if (iface->in_data_size > 0) {
    302                 hid_data->in_endpoints_mapping[hid_data->in_endpoint_first_free]
    303                     = iface;
    304                 dev->ops->data_in[hid_data->in_endpoint_first_free]
    305                     = on_data_from_device;
     302                hid_data->in_endpoints_mapping[hid_data->in_endpoint_first_free] =
     303                    iface;
     304                dev->ops->data_in[hid_data->in_endpoint_first_free] =
     305                    on_data_from_device;
    306306                hid_data->in_endpoint_first_free++;
    307307        }
    308308        if (iface->out_data_size > 0) {
    309                 hid_data->out_endpoints_mapping[hid_data->out_endpoint_first_free]
    310                     = iface;
    311                 dev->ops->data_out[hid_data->out_endpoint_first_free]
    312                     = on_data_to_device;
     309                hid_data->out_endpoints_mapping[hid_data->out_endpoint_first_free] =
     310                    iface;
     311                dev->ops->data_out[hid_data->out_endpoint_first_free] =
     312                    on_data_to_device;
    313313                hid_data->out_endpoint_first_free++;
    314314        }
    315315
    316         hid_data->interface_mapping[
    317             dev->descriptors->configuration->descriptor->interface_count]
    318             = iface;
     316        hid_data->interface_mapping[dev->descriptors->configuration->descriptor->interface_count] =
     317            iface;
    319318
    320319        dev->descriptors->configuration->descriptor->interface_count++;
    321         dev->descriptors->configuration->descriptor->total_length
    322             += total_descr_size;
     320        dev->descriptors->configuration->descriptor->total_length +=
     321            total_descr_size;
    323322
    324323        hid_data->iface_count++;
  • uspace/app/vuhid/stdreq.c

    r76d0981d r3bacee1  
    5050
    5151        if (setup_packet->value_high == USB_DESCTYPE_HID_REPORT) {
    52                 vuhid_interface_t *iface
    53                     = vuhid->interface_mapping[setup_packet->index];
     52                vuhid_interface_t *iface =
     53                    vuhid->interface_mapping[setup_packet->index];
    5454                if (iface == NULL) {
    5555                        return EFORWARD;
  • uspace/app/wavplay/dplay.c

    r76d0981d r3bacee1  
    5858                void *base;
    5959                size_t size;
    60                 void* write_ptr;
     60                void *write_ptr;
    6161        } buffer;
    6262        pcm_format_t f;
    63         FILE* source;
     63        FILE *source;
    6464        volatile bool playing;
    6565        fibril_mutex_t mutex;
     
    104104                ipc_call_t call;
    105105                cap_call_handle_t chandle = async_get_call(&call);
    106                 switch(IPC_GET_IMETHOD(call)) {
     106                switch (IPC_GET_IMETHOD(call)) {
    107107                case PCM_EVENT_PLAYBACK_STARTED:
    108108                case PCM_EVENT_FRAMES_PLAYED:
     
    125125                }
    126126                const size_t bytes = fread(pb->buffer.write_ptr,
    127                    sizeof(uint8_t), fragment_size, pb->source);
     127                    sizeof(uint8_t), fragment_size, pb->source);
    128128                printf("Copied from position %p size %zu/%zu\n",
    129129                    pb->buffer.write_ptr, bytes, fragment_size);
     
    297297                        if (ret != EOK) {
    298298                                printf("Failed to update position indicator "
    299                                    "%s\n", str_error(ret));
     299                                    "%s\n", str_error(ret));
    300300                        }
    301301                }
     
    305305
    306306                /* Compute delay time */
    307                 const useconds_t real_delay = (usecs > work_time)
    308                     ? usecs - work_time : 0;
     307                const useconds_t real_delay = (usecs > work_time) ?
     308                    usecs - work_time : 0;
    309309                DPRINTF("POS %zu: %u usecs (%u) to play %zu bytes.\n",
    310310                    pos, usecs, real_delay, to_play);
     
    356356        }
    357357
    358         char* info = NULL;
     358        char *info = NULL;
    359359        ret = audio_pcm_get_info_str(session, &info);
    360360        if (ret != EOK) {
  • uspace/app/wavplay/drec.c

    r76d0981d r3bacee1  
    6363                size_t size;
    6464                unsigned id;
    65                 void* position;
     65                void *position;
    6666        } buffer;
    67         FILE* file;
     67        FILE *file;
    6868        audio_pcm_sess_t *device;
    6969} record_t;
     
    104104                ipc_call_t call;
    105105                cap_call_handle_t chandle = async_get_call(&call);
    106                 switch(IPC_GET_IMETHOD(call)) {
     106                switch (IPC_GET_IMETHOD(call)) {
    107107                case PCM_EVENT_CAPTURE_TERMINATED:
    108108                        printf("Recording terminated\n");
     
    125125                /* Write directly from device buffer to file */
    126126                const size_t bytes = fwrite(rec->buffer.position,
    127                    sizeof(uint8_t), buffer_part, rec->file);
     127                    sizeof(uint8_t), buffer_part, rec->file);
    128128                printf("%zu ", bytes);
    129129                rec->buffer.position += buffer_part;
     
    154154            pcm_sample_format_str(f.sample_format), f.channels);
    155155        const unsigned frames =
    156                 pcm_format_size_to_frames(rec->buffer.size / BUFFER_PARTS, &f);
     156            pcm_format_size_to_frames(rec->buffer.size / BUFFER_PARTS, &f);
    157157        ret = audio_pcm_start_capture_fragment(rec->device,
    158158            frames, f.channels, f.sampling_rate, f.sample_format);
     
    199199        }
    200200
    201         char* info = NULL;
     201        char *info = NULL;
    202202        ret = audio_pcm_get_info_str(session, &info);
    203203        if (ret != EOK) {
  • uspace/app/websrv/websrv.c

    r76d0981d r3bacee1  
    231231
    232232        if (verbose)
    233             fprintf(stderr, "Sending response\n");
     233                fprintf(stderr, "Sending response\n");
    234234
    235235        errno_t rc = tcp_conn_send(conn, (void *) msg, response_size);
     
    386386
    387387                        port = (uint16_t) value;
    388                 } else if (str_cmp(argv[*index] +2, "verbose") == 0) {
     388                } else if (str_cmp(argv[*index] + 2, "verbose") == 0) {
    389389                        verbose = true;
    390390                } else {
Note: See TracChangeset for help on using the changeset viewer.