diff --git a/src/common.h b/src/common.h index 7e100cd..2920bba 100644 --- a/src/common.h +++ b/src/common.h @@ -87,7 +87,7 @@ typedef libusb_device_handle *usb_device_handle_t; extern void* pongo_usb_callback(void* arg); usb_ret_t USBControlTransfer(usb_device_handle_t handle, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint32_t wLength, void *data, uint32_t *wLenDone); -usb_ret_t USBBulkUpload(usb_device_handle_t handle, void *data, uint32_t len); +usb_ret_t USBBulkUpload(usb_device_handle_t handle, void *data, int len); const char *usb_strerror(usb_ret_t err); int wait_for_pongo(); int issue_pongo_command(); diff --git a/src/devhelper.c b/src/devhelper.c index 962f902..8c123a4 100644 --- a/src/devhelper.c +++ b/src/devhelper.c @@ -230,7 +230,7 @@ int enter_recovery_cmd(const char* udid) { int reboot_cmd(const char* udid) { idevice_t device = NULL; - lockdownd_client_t lockdown = NULL; + lockdownd_client_t __unused lockdown = NULL; if (idevice_new(&device, udid) != IDEVICE_E_SUCCESS) { LOG(LOG_ERROR, "Could not connect to device"); return -1; diff --git a/src/dfuhelper.c b/src/dfuhelper.c index f5959db..4bf6ad2 100644 --- a/src/dfuhelper.c +++ b/src/dfuhelper.c @@ -143,7 +143,7 @@ void* connected_dfu_mode(struct irecv_device_info* info) { return NULL; } -void device_event_cb(const usbmuxd_event_t *event, void *userdata) { +void device_event_cb(const usbmuxd_event_t *event, void* __unused userdata) { if (event->device.conn_type != CONNECTION_TYPE_USB) return; switch (event->event) { case UE_DEVICE_ADD: @@ -156,7 +156,7 @@ void device_event_cb(const usbmuxd_event_t *event, void *userdata) { } } -void irecv_device_event_cb(const irecv_device_event_t *event, void *userdata) { +void irecv_device_event_cb(const irecv_device_event_t *event, void* __unused userdata) { pthread_t recovery_thread, dfu_thread; switch(event->type) { @@ -177,9 +177,7 @@ void irecv_device_event_cb(const irecv_device_event_t *event, void *userdata) { } } -void *dfuhelper(void *ptr) { - // idevice_set_debug_level(1); - // irecv_set_debug_level(1); +void *dfuhelper(void* __unused ptr) { subscribe_cmd(device_event_cb, irecv_device_event_cb); while (spin) { sleep(1); diff --git a/src/main.c b/src/main.c index 5b609d2..05c0a82 100644 --- a/src/main.c +++ b/src/main.c @@ -400,7 +400,7 @@ int main(int argc, char *argv[]) pongo: spin = true; if (do_pongo_sleep) - sleep(2); + sleep(1); else LOG(LOG_INFO, "Waiting for PongoOS devices..."); wait_for_pongo(); diff --git a/src/pongo_usb.c b/src/pongo_usb.c index fe819ae..d52949c 100644 --- a/src/pongo_usb.c +++ b/src/pongo_usb.c @@ -46,8 +46,6 @@ #define CMD_LEN_MAX 512 #define UPLOADSZ_MAX (1024 * 1024 * 128) -static uint8_t gBlockIO = 1; - typedef struct stuff stuff_t; static void io_start(stuff_t *stuff); @@ -67,7 +65,7 @@ usb_ret_t USBControlTransfer(usb_device_handle_t handle, uint8_t bmRequestType, return USB_RET_SUCCESS; } -usb_ret_t USBBulkUpload(usb_device_handle_t handle, void *data, uint32_t len) +usb_ret_t USBBulkUpload(usb_device_handle_t handle, void *data, int len) { static uint32_t maxLen = 0; int transferred = 0; @@ -109,7 +107,7 @@ usb_ret_t USBBulkUpload(usb_device_handle_t handle, void *data, uint32_t len) } } // If we get here, we have to chunk our data - for(uint32_t done = transferred; done < len; ) + for(int done = transferred; done < len; ) { uint32_t chunk = len - done; if(chunk > maxLen) chunk = maxLen; @@ -130,7 +128,7 @@ struct stuff usb_device_handle_t handle; }; -static int FoundDevice(libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *arg) +static int FoundDevice(libusb_context __unused *ctx, libusb_device *dev, libusb_hotplug_event __unused event, void *arg) { LOG(LOG_VERBOSE, "PongoOS USB Device connected\n"); stuff_t *stuff = arg; @@ -178,7 +176,7 @@ static int FoundDevice(libusb_context *ctx, libusb_device *dev, libusb_hotplug_e return LIBUSB_SUCCESS; } -static int LostDevice(libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *arg) +static int LostDevice(libusb_context __unused *ctx, libusb_device *dev, libusb_hotplug_event __unused event, void *arg) { LOG(LOG_VERBOSE, "PongoOS USB Device disconnected"); stuff_t *stuff = arg; @@ -239,7 +237,7 @@ int wait_for_pongo(void) return -1; } - for(size_t i = 0; i < sz; ++i) + for(ssize_t i = 0; i < sz; ++i) { struct libusb_device_descriptor desc = {}; r = libusb_get_device_descriptor(list[i], &desc); @@ -254,7 +252,7 @@ int wait_for_pongo(void) continue; } r = FoundDevice(NULL, list[i], LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, &stuff); - for(size_t j = i + 1; j < sz; ++j) + for(ssize_t j = i + 1; j < sz; ++j) { libusb_unref_device(list[j]); }