diff options
| author | 2013-09-27 02:19:19 +0200 | |
|---|---|---|
| committer | 2013-09-27 02:19:19 +0200 | |
| commit | 0208d9c4045d484509515b808c47a2b16f84d9fc (patch) | |
| tree | 2271710dd7de21aa8c80dd86131a0afba339427b /src | |
| parent | 8892b97b41d5ea1960f47834484ceea2ebac6406 (diff) | |
| download | libirecovery-0208d9c4045d484509515b808c47a2b16f84d9fc.tar.gz libirecovery-0208d9c4045d484509515b808c47a2b16f84d9fc.tar.bz2 | |
libirecovery: Change a few camel case arguments to lowercase
Diffstat (limited to 'src')
| -rw-r--r-- | src/libirecovery.c | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c index 38e7915..3bd57df 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c | |||
| @@ -463,16 +463,9 @@ void irecv_exit() { | |||
| 463 | void dummy_callback() { } | 463 | void dummy_callback() { } |
| 464 | #endif | 464 | #endif |
| 465 | 465 | ||
| 466 | int irecv_usb_control_transfer( irecv_client_t client, | 466 | int irecv_usb_control_transfer(irecv_client_t client, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, unsigned char *data, uint16_t w_length, unsigned int timeout) { |
| 467 | uint8_t bmRequestType, | ||
| 468 | uint8_t bRequest, | ||
| 469 | uint16_t wValue, | ||
| 470 | uint16_t wIndex, | ||
| 471 | unsigned char *data, | ||
| 472 | uint16_t wLength, | ||
| 473 | unsigned int timeout) { | ||
| 474 | #ifndef WIN32 | 467 | #ifndef WIN32 |
| 475 | return libusb_control_transfer(client->handle, bmRequestType, bRequest, wValue, wIndex, data, wLength, timeout); | 468 | return libusb_control_transfer(client->handle, bm_request_type, b_request, w_value, w_index, data, w_length, timeout); |
| 476 | #else | 469 | #else |
| 477 | DWORD count = 0; | 470 | DWORD count = 0; |
| 478 | DWORD ret; | 471 | DWORD ret; |
| @@ -482,20 +475,20 @@ int irecv_usb_control_transfer( irecv_client_t client, | |||
| 482 | if (data == NULL) | 475 | if (data == NULL) |
| 483 | wLength = 0; | 476 | wLength = 0; |
| 484 | 477 | ||
| 485 | usb_control_request* packet = (usb_control_request*) malloc(sizeof(usb_control_request) + wLength); | 478 | usb_control_request* packet = (usb_control_request*) malloc(sizeof(usb_control_request) + w_length); |
| 486 | packet->bmRequestType = bmRequestType; | 479 | packet->bmRequestType = bm_request_type; |
| 487 | packet->bRequest = bRequest; | 480 | packet->bRequest = b_request; |
| 488 | packet->wValue = wValue; | 481 | packet->wValue = w_value; |
| 489 | packet->wIndex = wIndex; | 482 | packet->wIndex = w_index; |
| 490 | packet->wLength = wLength; | 483 | packet->wLength = w_length; |
| 491 | 484 | ||
| 492 | if (bmRequestType < 0x80 && wLength > 0) { | 485 | if (bm_request_type < 0x80 && w_length > 0) { |
| 493 | memcpy(packet->data, data, wLength); | 486 | memcpy(packet->data, data, w_length); |
| 494 | } | 487 | } |
| 495 | 488 | ||
| 496 | memset(&overlapped, 0, sizeof(overlapped)); | 489 | memset(&overlapped, 0, sizeof(overlapped)); |
| 497 | overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); | 490 | overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); |
| 498 | DeviceIoControl(client->handle, 0x2200A0, packet, sizeof(usb_control_request) + wLength, packet, sizeof(usb_control_request) + wLength, NULL, &overlapped); | 491 | DeviceIoControl(client->handle, 0x2200A0, packet, sizeof(usb_control_request) + w_length, packet, sizeof(usb_control_request) + w_length, NULL, &overlapped); |
| 499 | ret = WaitForSingleObject(overlapped.hEvent, timeout); | 492 | ret = WaitForSingleObject(overlapped.hEvent, timeout); |
| 500 | bRet = GetOverlappedResult(client->handle, &overlapped, &count, FALSE); | 493 | bRet = GetOverlappedResult(client->handle, &overlapped, &count, FALSE); |
| 501 | CloseHandle(overlapped.hEvent); | 494 | CloseHandle(overlapped.hEvent); |
| @@ -507,7 +500,7 @@ int irecv_usb_control_transfer( irecv_client_t client, | |||
| 507 | 500 | ||
| 508 | count -= sizeof(usb_control_request); | 501 | count -= sizeof(usb_control_request); |
| 509 | if (count > 0) { | 502 | if (count > 0) { |
| 510 | if (bmRequestType >= 0x80) { | 503 | if (bm_request_type >= 0x80) { |
| 511 | memcpy(data, packet->data, count); | 504 | memcpy(data, packet->data, count); |
| 512 | } | 505 | } |
| 513 | } | 506 | } |
| @@ -944,7 +937,7 @@ irecv_error_t irecv_send_command(irecv_client_t client, const char* command) { | |||
| 944 | return IRECV_E_SUCCESS; | 937 | return IRECV_E_SUCCESS; |
| 945 | } | 938 | } |
| 946 | 939 | ||
| 947 | irecv_error_t irecv_send_file(irecv_client_t client, const char* filename, int dfuNotifyFinished) { | 940 | irecv_error_t irecv_send_file(irecv_client_t client, const char* filename, int dfu_notify_finished) { |
| 948 | if (check_context(client) != IRECV_E_SUCCESS) | 941 | if (check_context(client) != IRECV_E_SUCCESS) |
| 949 | return IRECV_E_NO_DEVICE; | 942 | return IRECV_E_NO_DEVICE; |
| 950 | 943 | ||
| @@ -971,7 +964,7 @@ irecv_error_t irecv_send_file(irecv_client_t client, const char* filename, int d | |||
| 971 | return IRECV_E_UNKNOWN_ERROR; | 964 | return IRECV_E_UNKNOWN_ERROR; |
| 972 | } | 965 | } |
| 973 | 966 | ||
| 974 | irecv_error_t error = irecv_send_buffer(client, (unsigned char*)buffer, length, dfuNotifyFinished); | 967 | irecv_error_t error = irecv_send_buffer(client, (unsigned char*)buffer, length, dfu_notify_finished); |
| 975 | free(buffer); | 968 | free(buffer); |
| 976 | 969 | ||
| 977 | return error; | 970 | return error; |
| @@ -995,7 +988,7 @@ static irecv_error_t irecv_get_status(irecv_client_t client, unsigned int* statu | |||
| 995 | return IRECV_E_SUCCESS; | 988 | return IRECV_E_SUCCESS; |
| 996 | } | 989 | } |
| 997 | 990 | ||
| 998 | irecv_error_t irecv_send_buffer(irecv_client_t client, unsigned char* buffer, unsigned long length, int dfuNotifyFinished) { | 991 | irecv_error_t irecv_send_buffer(irecv_client_t client, unsigned char* buffer, unsigned long length, int dfu_notify_finished) { |
| 999 | irecv_error_t error = 0; | 992 | irecv_error_t error = 0; |
| 1000 | int recovery_mode = ((client->mode != IRECV_K_DFU_MODE) && (client->mode != IRECV_K_WTF_MODE)); | 993 | int recovery_mode = ((client->mode != IRECV_K_DFU_MODE) && (client->mode != IRECV_K_WTF_MODE)); |
| 1001 | 994 | ||
| @@ -1111,7 +1104,7 @@ irecv_error_t irecv_send_buffer(irecv_client_t client, unsigned char* buffer, un | |||
| 1111 | } | 1104 | } |
| 1112 | } | 1105 | } |
| 1113 | 1106 | ||
| 1114 | if (dfuNotifyFinished && !recovery_mode) { | 1107 | if (dfu_notify_finished && !recovery_mode) { |
| 1115 | irecv_usb_control_transfer(client, 0x21, 1, packets, 0, (unsigned char*) buffer, 0, USB_TIMEOUT); | 1108 | irecv_usb_control_transfer(client, 0x21, 1, packets, 0, (unsigned char*) buffer, 0, USB_TIMEOUT); |
| 1116 | 1109 | ||
| 1117 | for (i = 0; i < 2; i++) { | 1110 | for (i = 0; i < 2; i++) { |
| @@ -1121,7 +1114,7 @@ irecv_error_t irecv_send_buffer(irecv_client_t client, unsigned char* buffer, un | |||
| 1121 | } | 1114 | } |
| 1122 | } | 1115 | } |
| 1123 | 1116 | ||
| 1124 | if (dfuNotifyFinished == 2) { | 1117 | if (dfu_notify_finished == 2) { |
| 1125 | /* we send a pseudo ZLP here just in case */ | 1118 | /* we send a pseudo ZLP here just in case */ |
| 1126 | irecv_usb_control_transfer(client, 0x21, 1, 0, 0, 0, 0, USB_TIMEOUT); | 1119 | irecv_usb_control_transfer(client, 0x21, 1, 0, 0, 0, 0, USB_TIMEOUT); |
| 1127 | } | 1120 | } |
