From 5072dea1373b7c4789a9ea1e65d05ea30acf41ed Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sun, 5 Oct 2014 16:51:03 +0200 Subject: Convert int16_t macro error types into enum to improve debugging/type-checking This simple change provides various benefits for developers like compile time errors, better auto-completition in editors and the ability of a debugger to show the constant instead of just the raw value. Thanks to Aaron Burghardt for the proposal. --- src/restore.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/restore.c') diff --git a/src/restore.c b/src/restore.c index 3f6be8f..4d4823f 100644 --- a/src/restore.c +++ b/src/restore.c @@ -154,7 +154,7 @@ LIBIMOBILEDEVICE_API restored_error_t restored_send(restored_client_t client, pl return RESTORE_E_INVALID_ARG; restored_error_t ret = RESTORE_E_SUCCESS; - idevice_error_t err; + property_list_service_error_t err; err = property_list_service_send_xml_plist(client->parent, plist); if (err != PROPERTY_LIST_SERVICE_E_SUCCESS) { @@ -297,6 +297,7 @@ LIBIMOBILEDEVICE_API restored_error_t restored_client_new(idevice_t device, rest return RESTORE_E_INVALID_ARG; restored_error_t ret = RESTORE_E_SUCCESS; + idevice_error_t idev_ret; static struct lockdownd_service_descriptor service = { .port = 0xf27e, @@ -317,9 +318,10 @@ LIBIMOBILEDEVICE_API restored_error_t restored_client_new(idevice_t device, rest if (label != NULL) client_loc->label = strdup(label); - ret = idevice_get_udid(device, &client_loc->udid); - if (RESTORE_E_SUCCESS != ret) { + idev_ret = idevice_get_udid(device, &client_loc->udid); + if (IDEVICE_E_SUCCESS != idev_ret) { debug_info("failed to get device udid."); + ret = RESTORE_E_DEVICE_ERROR; } debug_info("device udid: %s", client_loc->udid); -- cgit v1.1-32-gdbae