diff options
| author | 2012-11-28 22:51:22 +0100 | |
|---|---|---|
| committer | 2012-11-28 22:51:22 +0100 | |
| commit | fe3ec2e29f4bf25aa47506ed60ea7310387ff166 (patch) | |
| tree | 156888a00a76462942249ecaab677c3f0eff96f9 | |
| parent | 364ce205e3428fbc6ccb73c6e94437c083d73406 (diff) | |
| download | libirecovery-fe3ec2e29f4bf25aa47506ed60ea7310387ff166.tar.gz libirecovery-fe3ec2e29f4bf25aa47506ed60ea7310387ff166.tar.bz2 | |
irecv_send_command/irecv_event_t use const char* instead of char*
| -rw-r--r-- | include/libirecovery.h | 4 | ||||
| -rw-r--r-- | src/irecovery.c | 2 | ||||
| -rw-r--r-- | src/libirecovery.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/include/libirecovery.h b/include/libirecovery.h index a44dcc3..e7cd30d 100644 --- a/include/libirecovery.h +++ b/include/libirecovery.h | |||
| @@ -155,7 +155,7 @@ typedef enum { | |||
| 155 | 155 | ||
| 156 | typedef struct { | 156 | typedef struct { |
| 157 | int size; | 157 | int size; |
| 158 | char* data; | 158 | const char* data; |
| 159 | double progress; | 159 | double progress; |
| 160 | irecv_event_type type; | 160 | irecv_event_type type; |
| 161 | } irecv_event_t; | 161 | } irecv_event_t; |
| @@ -246,7 +246,7 @@ int irecv_control_transfer(irecv_client_t client, uint8_t bmRequestType, uint8_t | |||
| 246 | int irecv_bulk_transfer(irecv_client_t client, unsigned char endpoint, unsigned char *data, int length, int *transferred, unsigned int timeout); | 246 | int irecv_bulk_transfer(irecv_client_t client, unsigned char endpoint, unsigned char *data, int length, int *transferred, unsigned int timeout); |
| 247 | 247 | ||
| 248 | irecv_error_t irecv_send_file(irecv_client_t client, const char* filename, int dfuNotifyFinished); | 248 | irecv_error_t irecv_send_file(irecv_client_t client, const char* filename, int dfuNotifyFinished); |
| 249 | irecv_error_t irecv_send_command(irecv_client_t client, char* command); | 249 | irecv_error_t irecv_send_command(irecv_client_t client, const char* command); |
| 250 | irecv_error_t irecv_send_buffer(irecv_client_t client, unsigned char* buffer, unsigned long length, int dfuNotifyFinished); | 250 | irecv_error_t irecv_send_buffer(irecv_client_t client, unsigned char* buffer, unsigned long length, int dfuNotifyFinished); |
| 251 | 251 | ||
| 252 | irecv_error_t irecv_saveenv(irecv_client_t client); | 252 | irecv_error_t irecv_saveenv(irecv_client_t client); |
diff --git a/src/irecovery.c b/src/irecovery.c index c4a698d..7d2302e 100644 --- a/src/irecovery.c +++ b/src/irecovery.c | |||
| @@ -165,7 +165,7 @@ int received_cb(irecv_client_t client, const irecv_event_t* event) { | |||
| 165 | if (event->type == IRECV_RECEIVED) { | 165 | if (event->type == IRECV_RECEIVED) { |
| 166 | int i = 0; | 166 | int i = 0; |
| 167 | int size = event->size; | 167 | int size = event->size; |
| 168 | char* data = event->data; | 168 | const char* data = event->data; |
| 169 | for (i = 0; i < size; i++) { | 169 | for (i = 0; i < size; i++) { |
| 170 | printf("%c", data[i]); | 170 | printf("%c", data[i]); |
| 171 | } | 171 | } |
diff --git a/src/libirecovery.c b/src/libirecovery.c index 63072c6..f2c8798 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c | |||
| @@ -835,7 +835,7 @@ static irecv_error_t irecv_send_command_raw(irecv_client_t client, const char* c | |||
| 835 | return IRECV_E_SUCCESS; | 835 | return IRECV_E_SUCCESS; |
| 836 | } | 836 | } |
| 837 | 837 | ||
| 838 | irecv_error_t irecv_send_command(irecv_client_t client, char* command) { | 838 | irecv_error_t irecv_send_command(irecv_client_t client, const char* command) { |
| 839 | irecv_error_t error = 0; | 839 | irecv_error_t error = 0; |
| 840 | if (check_context(client) != IRECV_E_SUCCESS) return IRECV_E_NO_DEVICE; | 840 | if (check_context(client) != IRECV_E_SUCCESS) return IRECV_E_NO_DEVICE; |
| 841 | 841 | ||
