Changeset 3bacee1 in mainline for uspace/app
- Timestamp:
- 2018-04-12T16:27:17Z (8 years ago)
- 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)
- Location:
- uspace/app
- Files:
-
- 19 edited
-
bdsh/cmds/modules/cmp/cmp.c (modified) (3 diffs)
-
bdsh/test/toktest.c (modified) (4 diffs)
-
mkbd/main.c (modified) (4 diffs)
-
sbi/src/run_expr.c (modified) (7 diffs)
-
sbi/src/stype_expr.c (modified) (3 diffs)
-
stats/stats.c (modified) (2 diffs)
-
taskdump/elf_core.c (modified) (1 diff)
-
tester/mm/common.c (modified) (3 diffs)
-
tester/print/print6.c (modified) (3 diffs)
-
tetris/tetris.c (modified) (4 diffs)
-
top/top.c (modified) (4 diffs)
-
usbinfo/dump.c (modified) (2 diffs)
-
usbinfo/hid.c (modified) (2 diffs)
-
usbinfo/info.c (modified) (3 diffs)
-
vuhid/device.c (modified) (6 diffs)
-
vuhid/stdreq.c (modified) (1 diff)
-
wavplay/dplay.c (modified) (6 diffs)
-
wavplay/drec.c (modified) (5 diffs)
-
websrv/websrv.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/cmp/cmp.c
r76d0981d r3bacee1 59 59 help_cmd_cmp(HELP_SHORT); 60 60 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); 67 67 } 68 68 … … 73 73 { 74 74 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 }; 77 77 char buffer[2][CMP_BUFLEN]; 78 78 size_t offset[2]; 79 aoff64_t pos[2] = { };79 aoff64_t pos[2] = { }; 80 80 81 81 for (int i = 0; i < 2; i++) { … … 142 142 if (argc - optind != 2) { 143 143 printf("%s - incorrect number of arguments. Try `%s --help'\n", 144 cmdname, cmdname);144 cmdname, cmdname); 145 145 return CMD_FAILURE; 146 146 } -
uspace/app/bdsh/test/toktest.c
r76d0981d r3bacee1 43 43 44 44 /* Tokenize the input, asserts that number of tokens is okay. */ 45 static void prepare(const char *input, size_t expected_token_count) { 45 static void prepare(const char *input, size_t expected_token_count) 46 { 46 47 str_cpy(input_buffer, MAX_INPUT, input); 47 48 … … 68 69 PCUT_TEST_SUITE(tokenizer); 69 70 70 PCUT_TEST_AFTER { 71 PCUT_TEST_AFTER 72 { 71 73 /* Destroy the tokenizer. */ 72 74 tok_fini(&tokenizer); … … 74 76 75 77 76 PCUT_TEST(empty_input) { 78 PCUT_TEST(empty_input) 79 { 77 80 prepare("", 0); 78 81 } 79 82 80 PCUT_TEST(only_spaces) { 83 PCUT_TEST(only_spaces) 84 { 81 85 prepare(" ", 1); 82 86 … … 84 88 } 85 89 86 PCUT_TEST(two_text_tokens) { 90 PCUT_TEST(two_text_tokens) 91 { 87 92 prepare("alpha bravo", 3); 88 93 -
uspace/app/mkbd/main.c
r76d0981d r3bacee1 145 145 146 146 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, 149 149 USB_HID_REPORT_TYPE_INPUT); 150 150 … … 157 157 158 158 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, 161 161 USB_HID_REPORT_TYPE_INPUT); 162 162 } … … 228 228 if (!sess) { 229 229 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)); 231 231 return errno; 232 232 } … … 238 238 if (rc != EOK) { 239 239 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)); 241 241 return ENOMEM; 242 242 } -
uspace/app/sbi/src/run_expr.c
r76d0981d r3bacee1 311 311 assert(csi != NULL); 312 312 313 if (symbol_search_csi(run->program, csi, nameref->name) 314 ==NULL) {313 if (symbol_search_csi(run->program, csi, nameref->name) == 314 NULL) { 315 315 /* Function is not in the current object. */ 316 316 printf("Error: Cannot access non-static member " … … 349 349 assert(csi != NULL); 350 350 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)) { 353 353 /* Symbol is not in the current object. */ 354 354 printf("Error: Cannot access non-static member " … … 1271 1271 switch (unop->uc) { 1272 1272 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); 1274 1274 break; 1275 1275 case uo_minus: … … 1318 1318 c2 = &v2->var->u.char_v->value; 1319 1319 1320 bigint_sub(c1, c2, &diff);1320 bigint_sub(c1, c2, &diff); 1321 1321 *res = bigint_is_zero(&diff); 1322 1322 break; … … 1438 1438 } 1439 1439 1440 i = 0; length = 1; 1440 i = 0; 1441 length = 1; 1441 1442 while (node != NULL) { 1442 1443 expr = list_node_data(node, stree_expr_t *); … … 1567 1568 *res = run_recovery_item(run); 1568 1569 goto cleanup; 1569 }1570 } 1570 1571 1571 1572 if (rarg == NULL) { … … 2755 2756 2756 2757 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; 2761 2770 2762 2771 case vc_ref: -
uspace/app/sbi/src/stype_expr.c
r76d0981d r3bacee1 151 151 152 152 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; 165 189 } 166 190 … … 362 386 363 387 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; 369 403 } 370 404 … … 1771 1805 * conversion destination. 1772 1806 */ 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) { 1775 1809 stype_convert_failure(stype, convc_as, as_op->arg, titem); 1776 1810 *rtitem = titem; -
uspace/app/stats/stats.c
r76d0981d r3bacee1 124 124 printf("(none) "); 125 125 126 printf("%8" PRIu64 "%c %8" PRIu64"%c\n",126 printf("%8" PRIu64 "%c %8" PRIu64 "%c\n", 127 127 ucycles, usuffix, kcycles, ksuffix); 128 128 } … … 230 230 "\n" 231 231 "Without any options all tasks are listed\n", 232 name 233 ); 232 name); 234 233 } 235 234 -
uspace/app/taskdump/elf_core.c
r76d0981d r3bacee1 176 176 p_hdr[0].p_vaddr = 0; 177 177 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); 181 181 p_hdr[0].p_memsz = 0; 182 182 p_hdr[0].p_flags = 0; -
uspace/app/tester/mm/common.c
r76d0981d r3bacee1 269 269 void fill_block(mem_block_t *block) 270 270 { 271 for (uint8_t * pos = block->addr, *end = pos + block->size;271 for (uint8_t * pos = block->addr, *end = pos + block->size; 272 272 pos < end; pos++) 273 273 *pos = block_expected_value(block, pos); … … 286 286 void check_block(mem_block_t *block) 287 287 { 288 for (uint8_t * pos = block->addr, *end = pos + block->size;288 for (uint8_t * pos = block->addr, *end = pos + block->size; 289 289 pos < end; pos++) { 290 290 if (*pos != block_expected_value(block, pos)) { … … 402 402 void fill_area(mem_area_t *area) 403 403 { 404 for (uint8_t * pos = area->addr, *end = pos + area->size;404 for (uint8_t * pos = area->addr, *end = pos + area->size; 405 405 pos < end; pos++) 406 406 *pos = area_expected_value(area, pos); -
uspace/app/tester/print/print6.c
r76d0981d r3bacee1 63 63 /* Special */ 64 64 { 1e300 * 1e300, "%g", "inf", 0 }, 65 { -1.0 / (1e300 * 1e300), "%g", "-0", 0 },65 { -1.0 / (1e300 * 1e300), "%g", "-0", 0 }, 66 66 67 67 { 1234567.8901, "%g", "1234567.8901", 0 }, … … 130 130 131 131 { 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 }, 133 133 /* __PRINTF_FLAG_BIGCHARS */ 134 134 { 1e300 * 1e300, "%10.5E", " INF", 0 }, 135 135 /* __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 }, 137 137 138 138 /* … … 171 171 /* Next closest to 0.1 */ 172 172 { 0.0999999999999999917, "%+10.20f", "+0.09999999999999999170", 173 0 },173 0 }, 174 174 { 0.0999999999999999917, "%+10f", " +0.100000", 0 }, 175 175 { 0.0999999999999998945, "%10.20f", "0.09999999999999989450", 176 0 },176 0 }, 177 177 }; 178 178 -
uspace/app/tetris/tetris.c
r76d0981d r3bacee1 52 52 53 53 static 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"; 56 56 57 57 #include <sys/time.h> … … 185 185 printf("Level = %d (press keys 1 - 9 to change)", level); 186 186 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")); 188 188 moveto(12, 10); 189 189 printf("Press 'h' to show hiscore table."); … … 204 204 int i = getchar(); 205 205 206 switch (i) {207 case 'p':208 showpreview = !showpreview;209 moveto(9, 21);210 if (showpreview)211 printf("on ");212 else213 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; 238 238 } 239 239 } … … 259 259 260 260 while ((ch = getopt(argc, argv, "ck:ps")) != -1) 261 switch (ch) {261 switch (ch) { 262 262 case 'c': 263 263 /* -
uspace/app/top/top.c
r76d0981d r3bacee1 62 62 63 63 static 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 }, 73 73 }; 74 74 … … 87 87 88 88 static 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 }, 96 96 }; 97 97 … … 108 108 109 109 static 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 }, 116 116 }; 117 117 … … 383 383 return 0; 384 384 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) 387 387 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) 390 390 return -1 * sort_reverse; 391 391 return 0; -
uspace/app/usbinfo/dump.c
r76d0981d r3bacee1 64 64 INDENT INDENT INDENT INDENT INDENT INDENT, 65 65 }; 66 static size_t indents_count = sizeof(indents) /sizeof(indents[0]);66 static size_t indents_count = sizeof(indents) / sizeof(indents[0]); 67 67 if (level >= indents_count) { 68 68 return indents[indents_count - 1]; … … 84 84 for (i = 0; i < length; i++) { 85 85 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)) { 88 88 printf("\n"); 89 89 if (i + 1 < length) { -
uspace/app/usbinfo/hid.c
r76d0981d r3bacee1 185 185 186 186 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; 189 189 return; 190 190 } … … 198 198 } 199 199 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; 202 202 203 203 if (hid_descr->report_desc_info.type != USB_DESCTYPE_HID_REPORT) { -
uspace/app/usbinfo/info.c
r76d0981d r3bacee1 70 70 assert(usb_dev); 71 71 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; 74 74 75 75 printf("%sInterface #%d match ids (%s, 0x%02x, 0x%02x)\n", … … 143 143 usb_endpoint_t endpoint_no = descriptor->endpoint_address & 0xF; 144 144 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; 147 147 printf("%sEndpoint #%d (%s %s, %zu)\n", prefix, 148 148 endpoint_no, usb_str_transfer_type(transfer), … … 226 226 dump_descriptor_tree_brief_hub); 227 227 228 default:229 break;228 default: 229 break; 230 230 } 231 231 -
uspace/app/vuhid/device.c
r76d0981d r3bacee1 129 129 130 130 /* 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)) { 133 133 return ELIMIT; 134 134 } 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)) { 137 137 return ELIMIT; 138 138 } … … 192 192 descr_iface->length = sizeof(usb_standard_interface_descriptor_t); 193 193 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; 196 196 descr_iface->alternate_setting = 0; 197 197 descr_iface->endpoint_count = ep_count; … … 230 230 descr_ep_in->length = sizeof(usb_standard_endpoint_descriptor_t); 231 231 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; 234 234 descr_ep_in->attributes = 3; 235 235 descr_ep_in->max_packet_size = iface->in_data_size; … … 246 246 descr_ep_out->length = sizeof(usb_standard_endpoint_descriptor_t); 247 247 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; 250 250 descr_ep_out->attributes = 3; 251 251 descr_ep_out->max_packet_size = iface->out_data_size; … … 256 256 usbvirt_device_configuration_extras_t *extra_descriptors; 257 257 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)); 260 260 if (extra_descriptors == NULL) { 261 261 rc = ENOMEM; … … 300 300 */ 301 301 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; 306 306 hid_data->in_endpoint_first_free++; 307 307 } 308 308 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; 313 313 hid_data->out_endpoint_first_free++; 314 314 } 315 315 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; 319 318 320 319 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; 323 322 324 323 hid_data->iface_count++; -
uspace/app/vuhid/stdreq.c
r76d0981d r3bacee1 50 50 51 51 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]; 54 54 if (iface == NULL) { 55 55 return EFORWARD; -
uspace/app/wavplay/dplay.c
r76d0981d r3bacee1 58 58 void *base; 59 59 size_t size; 60 void *write_ptr;60 void *write_ptr; 61 61 } buffer; 62 62 pcm_format_t f; 63 FILE *source;63 FILE *source; 64 64 volatile bool playing; 65 65 fibril_mutex_t mutex; … … 104 104 ipc_call_t call; 105 105 cap_call_handle_t chandle = async_get_call(&call); 106 switch (IPC_GET_IMETHOD(call)) {106 switch (IPC_GET_IMETHOD(call)) { 107 107 case PCM_EVENT_PLAYBACK_STARTED: 108 108 case PCM_EVENT_FRAMES_PLAYED: … … 125 125 } 126 126 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); 128 128 printf("Copied from position %p size %zu/%zu\n", 129 129 pb->buffer.write_ptr, bytes, fragment_size); … … 297 297 if (ret != EOK) { 298 298 printf("Failed to update position indicator " 299 "%s\n", str_error(ret));299 "%s\n", str_error(ret)); 300 300 } 301 301 } … … 305 305 306 306 /* 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; 309 309 DPRINTF("POS %zu: %u usecs (%u) to play %zu bytes.\n", 310 310 pos, usecs, real_delay, to_play); … … 356 356 } 357 357 358 char *info = NULL;358 char *info = NULL; 359 359 ret = audio_pcm_get_info_str(session, &info); 360 360 if (ret != EOK) { -
uspace/app/wavplay/drec.c
r76d0981d r3bacee1 63 63 size_t size; 64 64 unsigned id; 65 void *position;65 void *position; 66 66 } buffer; 67 FILE *file;67 FILE *file; 68 68 audio_pcm_sess_t *device; 69 69 } record_t; … … 104 104 ipc_call_t call; 105 105 cap_call_handle_t chandle = async_get_call(&call); 106 switch (IPC_GET_IMETHOD(call)) {106 switch (IPC_GET_IMETHOD(call)) { 107 107 case PCM_EVENT_CAPTURE_TERMINATED: 108 108 printf("Recording terminated\n"); … … 125 125 /* Write directly from device buffer to file */ 126 126 const size_t bytes = fwrite(rec->buffer.position, 127 sizeof(uint8_t), buffer_part, rec->file);127 sizeof(uint8_t), buffer_part, rec->file); 128 128 printf("%zu ", bytes); 129 129 rec->buffer.position += buffer_part; … … 154 154 pcm_sample_format_str(f.sample_format), f.channels); 155 155 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); 157 157 ret = audio_pcm_start_capture_fragment(rec->device, 158 158 frames, f.channels, f.sampling_rate, f.sample_format); … … 199 199 } 200 200 201 char *info = NULL;201 char *info = NULL; 202 202 ret = audio_pcm_get_info_str(session, &info); 203 203 if (ret != EOK) { -
uspace/app/websrv/websrv.c
r76d0981d r3bacee1 231 231 232 232 if (verbose) 233 fprintf(stderr, "Sending response\n");233 fprintf(stderr, "Sending response\n"); 234 234 235 235 errno_t rc = tcp_conn_send(conn, (void *) msg, response_size); … … 386 386 387 387 port = (uint16_t) value; 388 } else if (str_cmp(argv[*index] + 2, "verbose") == 0) {388 } else if (str_cmp(argv[*index] + 2, "verbose") == 0) { 389 389 verbose = true; 390 390 } else {
Note:
See TracChangeset
for help on using the changeset viewer.
