summaryrefslogtreecommitdiffstats
path: root/src/idevice.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2010-05-26 20:18:28 +0200
committerGravatar Martin Szulecki2010-05-27 00:45:02 +0200
commit75f7ce360a7cfd5a2fb25cf852fb9c4a6d0f38f4 (patch)
tree2d00bf191061a332aec1aa111fed2289e5455125 /src/idevice.c
parent588f72fd0816eef4853fae9f7eced5efe767a0fd (diff)
downloadlibimobiledevice-75f7ce360a7cfd5a2fb25cf852fb9c4a6d0f38f4.tar.gz
libimobiledevice-75f7ce360a7cfd5a2fb25cf852fb9c4a6d0f38f4.tar.bz2
Silence 64bit compiler warnings using proper casts
Diffstat (limited to 'src/idevice.c')
-rw-r--r--src/idevice.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/idevice.c b/src/idevice.c
index 4917b42..c86b806 100644
--- a/src/idevice.c
+++ b/src/idevice.c
@@ -162,7 +162,7 @@ idevice_error_t idevice_new(idevice_t * device, const char *uuid)
162 idevice_t phone = (idevice_t) malloc(sizeof(struct idevice_private)); 162 idevice_t phone = (idevice_t) malloc(sizeof(struct idevice_private));
163 phone->uuid = strdup(muxdev.uuid); 163 phone->uuid = strdup(muxdev.uuid);
164 phone->conn_type = CONNECTION_USBMUXD; 164 phone->conn_type = CONNECTION_USBMUXD;
165 phone->conn_data = (void*)muxdev.handle; 165 phone->conn_data = (void*)(long)muxdev.handle;
166 *device = phone; 166 *device = phone;
167 return IDEVICE_E_SUCCESS; 167 return IDEVICE_E_SUCCESS;
168 } 168 }
@@ -215,14 +215,14 @@ idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connect
215 } 215 }
216 216
217 if (device->conn_type == CONNECTION_USBMUXD) { 217 if (device->conn_type == CONNECTION_USBMUXD) {
218 int sfd = usbmuxd_connect((uint32_t)(device->conn_data), port); 218 int sfd = usbmuxd_connect((uint32_t)(long)device->conn_data, port);
219 if (sfd < 0) { 219 if (sfd < 0) {
220 debug_info("ERROR: Connecting to usbmuxd failed: %d (%s)", sfd, strerror(-sfd)); 220 debug_info("ERROR: Connecting to usbmuxd failed: %d (%s)", sfd, strerror(-sfd));
221 return IDEVICE_E_UNKNOWN_ERROR; 221 return IDEVICE_E_UNKNOWN_ERROR;
222 } 222 }
223 idevice_connection_t new_connection = (idevice_connection_t)malloc(sizeof(struct idevice_connection_private)); 223 idevice_connection_t new_connection = (idevice_connection_t)malloc(sizeof(struct idevice_connection_private));
224 new_connection->type = CONNECTION_USBMUXD; 224 new_connection->type = CONNECTION_USBMUXD;
225 new_connection->data = (void*)sfd; 225 new_connection->data = (void*)(long)sfd;
226 new_connection->ssl_data = NULL; 226 new_connection->ssl_data = NULL;
227 *connection = new_connection; 227 *connection = new_connection;
228 return IDEVICE_E_SUCCESS; 228 return IDEVICE_E_SUCCESS;
@@ -251,7 +251,7 @@ idevice_error_t idevice_disconnect(idevice_connection_t connection)
251 } 251 }
252 idevice_error_t result = IDEVICE_E_UNKNOWN_ERROR; 252 idevice_error_t result = IDEVICE_E_UNKNOWN_ERROR;
253 if (connection->type == CONNECTION_USBMUXD) { 253 if (connection->type == CONNECTION_USBMUXD) {
254 usbmuxd_disconnect((int)(connection->data)); 254 usbmuxd_disconnect((int)(long)connection->data);
255 result = IDEVICE_E_SUCCESS; 255 result = IDEVICE_E_SUCCESS;
256 } else { 256 } else {
257 debug_info("Unknown connection type %d", connection->type); 257 debug_info("Unknown connection type %d", connection->type);
@@ -270,7 +270,7 @@ static idevice_error_t internal_connection_send(idevice_connection_t connection,
270 } 270 }
271 271
272 if (connection->type == CONNECTION_USBMUXD) { 272 if (connection->type == CONNECTION_USBMUXD) {
273 int res = usbmuxd_send((int)(connection->data), data, len, sent_bytes); 273 int res = usbmuxd_send((int)(long)connection->data, data, len, sent_bytes);
274 if (res < 0) { 274 if (res < 0) {
275 debug_info("ERROR: usbmuxd_send returned %d (%s)", res, strerror(-res)); 275 debug_info("ERROR: usbmuxd_send returned %d (%s)", res, strerror(-res));
276 return IDEVICE_E_UNKNOWN_ERROR; 276 return IDEVICE_E_UNKNOWN_ERROR;
@@ -323,7 +323,7 @@ static idevice_error_t internal_connection_receive_timeout(idevice_connection_t
323 } 323 }
324 324
325 if (connection->type == CONNECTION_USBMUXD) { 325 if (connection->type == CONNECTION_USBMUXD) {
326 int res = usbmuxd_recv_timeout((int)(connection->data), data, len, recv_bytes, timeout); 326 int res = usbmuxd_recv_timeout((int)(long)connection->data, data, len, recv_bytes, timeout);
327 if (res < 0) { 327 if (res < 0) {
328 debug_info("ERROR: usbmuxd_recv_timeout returned %d (%s)", res, strerror(-res)); 328 debug_info("ERROR: usbmuxd_recv_timeout returned %d (%s)", res, strerror(-res));
329 return IDEVICE_E_UNKNOWN_ERROR; 329 return IDEVICE_E_UNKNOWN_ERROR;
@@ -378,7 +378,7 @@ static idevice_error_t internal_connection_receive(idevice_connection_t connecti
378 } 378 }
379 379
380 if (connection->type == CONNECTION_USBMUXD) { 380 if (connection->type == CONNECTION_USBMUXD) {
381 int res = usbmuxd_recv((int)(connection->data), data, len, recv_bytes); 381 int res = usbmuxd_recv((int)(long)connection->data, data, len, recv_bytes);
382 if (res < 0) { 382 if (res < 0) {
383 debug_info("ERROR: usbmuxd_recv returned %d (%s)", res, strerror(-res)); 383 debug_info("ERROR: usbmuxd_recv returned %d (%s)", res, strerror(-res));
384 return IDEVICE_E_UNKNOWN_ERROR; 384 return IDEVICE_E_UNKNOWN_ERROR;
@@ -431,7 +431,7 @@ idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle)
431 return IDEVICE_E_INVALID_ARG; 431 return IDEVICE_E_INVALID_ARG;
432 432
433 if (device->conn_type == CONNECTION_USBMUXD) { 433 if (device->conn_type == CONNECTION_USBMUXD) {
434 *handle = (uint32_t)device->conn_data; 434 *handle = (uint32_t)(long)device->conn_data;
435 return IDEVICE_E_SUCCESS; 435 return IDEVICE_E_SUCCESS;
436 } else { 436 } else {
437 debug_info("Unknown connection type %d", device->conn_type); 437 debug_info("Unknown connection type %d", device->conn_type);