• Home
  • Raw
  • Download

Lines Matching refs:r

81 	int r = 0;  in poll_thread_main()  local
86 r = libusb_handle_events_timeout(NULL, &tv); in poll_thread_main()
87 if (r < 0) { in poll_thread_main()
106 int r; in print_f0_data() local
109 r = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0xf0, 0, data, in print_f0_data()
111 if (r < 0) { in print_f0_data()
112 fprintf(stderr, "F0 error %d\n", r); in print_f0_data()
113 return r; in print_f0_data()
115 if ((unsigned int) r < sizeof(data)) { in print_f0_data()
116 fprintf(stderr, "short read (%d)\n", r); in print_f0_data()
129 int r; in get_hwstat() local
131 r = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0x07, 0, status, 1, 0); in get_hwstat()
132 if (r < 0) { in get_hwstat()
133 fprintf(stderr, "read hwstat error %d\n", r); in get_hwstat()
134 return r; in get_hwstat()
136 if ((unsigned int) r < 1) { in get_hwstat()
137 fprintf(stderr, "short read (%d)\n", r); in get_hwstat()
147 int r; in set_hwstat() local
150 r = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x07, 0, &data, 1, 0); in set_hwstat()
151 if (r < 0) { in set_hwstat()
152 fprintf(stderr, "set hwstat error %d\n", r); in set_hwstat()
153 return r; in set_hwstat()
155 if ((unsigned int) r < 1) { in set_hwstat()
156 fprintf(stderr, "short write (%d)", r); in set_hwstat()
165 int r; in set_mode() local
168 r = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x4e, 0, &data, 1, 0); in set_mode()
169 if (r < 0) { in set_mode()
170 fprintf(stderr, "set mode error %d\n", r); in set_mode()
171 return r; in set_mode()
173 if ((unsigned int) r < 1) { in set_mode()
174 fprintf(stderr, "short write (%d)", r); in set_mode()
221 int r; in do_sync_intr() local
224 r = libusb_interrupt_transfer(devh, EP_INTR, data, INTR_LENGTH, in do_sync_intr()
226 if (r < 0) { in do_sync_intr()
227 fprintf(stderr, "intr error %d\n", r); in do_sync_intr()
228 return r; in do_sync_intr()
231 fprintf(stderr, "short read (%d)\n", r); in do_sync_intr()
241 int r; in sync_intr() local
245 r = do_sync_intr(data); in sync_intr()
246 if (r < 0) in sync_intr()
247 return r; in sync_intr()
272 int r = 0; in next_state() local
277 r = set_mode_async(MODE_AWAIT_FINGER_ON); in next_state()
284 r = set_mode_async(MODE_CAPTURE); in next_state()
291 r = set_mode_async(MODE_AWAIT_FINGER_OFF); in next_state()
299 if (r < 0) { in next_state()
301 return r; in next_state()
367 int r; in init_capture() local
369 r = libusb_submit_transfer(irq_transfer); in init_capture()
370 if (r < 0) in init_capture()
371 return r; in init_capture()
373 r = libusb_submit_transfer(img_transfer); in init_capture()
374 if (r < 0) { in init_capture()
379 return r; in init_capture()
390 int r; in do_init() local
392 r = get_hwstat(&status); in do_init()
393 if (r < 0) in do_init()
394 return r; in do_init()
397 r = set_hwstat(status | 0x80); in do_init()
398 if (r < 0) in do_init()
399 return r; in do_init()
400 r = get_hwstat(&status); in do_init()
401 if (r < 0) in do_init()
402 return r; in do_init()
406 r = set_hwstat(status); in do_init()
407 if (r < 0) in do_init()
408 return r; in do_init()
410 r = get_hwstat(&status); in do_init()
411 if (r < 0) in do_init()
412 return r; in do_init()
414 r = sync_intr(0x56); in do_init()
415 if (r < 0) in do_init()
416 return r; in do_init()
447 int r = 1; in main() local
449 r = libusb_init(NULL); in main()
450 if (r < 0) { in main()
455 r = find_dpfp_device(); in main()
456 if (r < 0) { in main()
461 r = libusb_claim_interface(devh, 0); in main()
462 if (r < 0) { in main()
463 fprintf(stderr, "usb_claim_interface error %d %s\n", r, strerror(-r)); in main()
468 r = print_f0_data(); in main()
469 if (r < 0) in main()
472 r = do_init(); in main()
473 if (r < 0) in main()
485 r = pthread_create(&poll_thread, NULL, poll_thread_main, NULL); in main()
486 if (r) in main()
489 r = alloc_transfers(); in main()
490 if (r < 0) { in main()
496 r = init_capture(); in main()
497 if (r < 0) { in main()
512 r = libusb_cancel_transfer(irq_transfer); in main()
513 if (r < 0) { in main()
518 r = libusb_cancel_transfer(img_transfer); in main()
519 if (r < 0) { in main()
529 r = 0; in main()
531 r = 1; in main()
543 return r >= 0 ? r : -r; in main()