Fix compilation for GCC 7

master
michal.szwaj@o2.pl 2018-03-10 13:14:40 +01:00
parent 257c63e06d
commit 59400c6a72
2 changed files with 4 additions and 4 deletions

View File

@ -50,7 +50,7 @@ void USBEndpoint::controlTransfer(common::DataBuffer buffer, uint32_t timeout, P
} }
else else
{ {
usbWrapper_.fillControlTransfer(transfer, handle_, buffer.data, &USBEndpoint::transferHandler, this, timeout); usbWrapper_.fillControlTransfer(transfer, handle_, buffer.data, reinterpret_cast<libusb_transfer_cb_fn>(&USBEndpoint::transferHandler), this, timeout);
this->transfer(transfer, std::move(promise)); this->transfer(transfer, std::move(promise));
} }
} }
@ -71,7 +71,7 @@ void USBEndpoint::interruptTransfer(common::DataBuffer buffer, uint32_t timeout,
} }
else else
{ {
usbWrapper_.fillInterruptTransfer(transfer, handle_, endpointAddress_, buffer.data, buffer.size, &USBEndpoint::transferHandler, this, timeout); usbWrapper_.fillInterruptTransfer(transfer, handle_, endpointAddress_, buffer.data, buffer.size, reinterpret_cast<libusb_transfer_cb_fn>(&USBEndpoint::transferHandler), this, timeout);
this->transfer(transfer, std::move(promise)); this->transfer(transfer, std::move(promise));
} }
} }
@ -92,7 +92,7 @@ void USBEndpoint::bulkTransfer(common::DataBuffer buffer, uint32_t timeout, Prom
} }
else else
{ {
usbWrapper_.fillBulkTransfer(transfer, handle_, endpointAddress_, buffer.data, buffer.size, &USBEndpoint::transferHandler, this, timeout); usbWrapper_.fillBulkTransfer(transfer, handle_, endpointAddress_, buffer.data, buffer.size, reinterpret_cast<libusb_transfer_cb_fn>(&USBEndpoint::transferHandler), this, timeout);
this->transfer(transfer, std::move(promise)); this->transfer(transfer, std::move(promise));
} }
} }

View File

@ -51,7 +51,7 @@ void USBHub::start(Promise::Pointer promise)
{ {
self_ = this->shared_from_this(); self_ = this->shared_from_this();
hotplugHandle_ = usbWrapper_.hotplugRegisterCallback(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, LIBUSB_HOTPLUG_NO_FLAGS, LIBUSB_HOTPLUG_MATCH_ANY, LIBUSB_HOTPLUG_MATCH_ANY, hotplugHandle_ = usbWrapper_.hotplugRegisterCallback(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, LIBUSB_HOTPLUG_NO_FLAGS, LIBUSB_HOTPLUG_MATCH_ANY, LIBUSB_HOTPLUG_MATCH_ANY,
LIBUSB_HOTPLUG_MATCH_ANY, &USBHub::hotplugEventsHandler, reinterpret_cast<void*>(this)); LIBUSB_HOTPLUG_MATCH_ANY, reinterpret_cast<libusb_hotplug_callback_fn>(&USBHub::hotplugEventsHandler), reinterpret_cast<void*>(this));
} }
}); });
} }