fpi-usb: Use unsigned length for USB async transfers
Properly follow function signature using a temporary gsize variable address to make the function use the same pointer type and avoid troubles at deferencing it, while use automatic-casting to switch to signed one if transfer succeeded.
This commit is contained in:
parent
98cd1c2680
commit
a29586f398
1 changed files with 6 additions and 3 deletions
|
@ -454,6 +454,7 @@ fpi_usb_transfer_submit_sync (FpiUsbTransfer *transfer,
|
|||
GError **error)
|
||||
{
|
||||
gboolean res;
|
||||
gsize actual_length;
|
||||
|
||||
g_return_val_if_fail (transfer, FALSE);
|
||||
|
||||
|
@ -469,7 +470,7 @@ fpi_usb_transfer_submit_sync (FpiUsbTransfer *transfer,
|
|||
transfer->endpoint,
|
||||
transfer->buffer,
|
||||
transfer->length,
|
||||
&transfer->actual_length,
|
||||
&actual_length,
|
||||
timeout_ms,
|
||||
NULL,
|
||||
error);
|
||||
|
@ -485,7 +486,7 @@ fpi_usb_transfer_submit_sync (FpiUsbTransfer *transfer,
|
|||
transfer->idx,
|
||||
transfer->buffer,
|
||||
transfer->length,
|
||||
&transfer->actual_length,
|
||||
&actual_length,
|
||||
timeout_ms,
|
||||
NULL,
|
||||
error);
|
||||
|
@ -496,7 +497,7 @@ fpi_usb_transfer_submit_sync (FpiUsbTransfer *transfer,
|
|||
transfer->endpoint,
|
||||
transfer->buffer,
|
||||
transfer->length,
|
||||
&transfer->actual_length,
|
||||
&actual_length,
|
||||
timeout_ms,
|
||||
NULL,
|
||||
error);
|
||||
|
@ -511,6 +512,8 @@ fpi_usb_transfer_submit_sync (FpiUsbTransfer *transfer,
|
|||
|
||||
if (!res)
|
||||
transfer->actual_length = -1;
|
||||
else
|
||||
transfer->actual_length = actual_length;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue