mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-21 09:47:01 +02:00
silence some warnings
This commit is contained in:
1 parent
178123c222
commit
3e6382f65e
5 files changed
+12
-16
No files matched your search
+1
-1
@@ -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();
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
+3
-5
@@ -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);
|
||||
|
||||
+1
-1
@@ -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();
|
||||
|
||||
+6
-8
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user