diff options
| author | 2014-10-05 16:51:03 +0200 | |
|---|---|---|
| committer | 2014-10-05 16:51:03 +0200 | |
| commit | 5072dea1373b7c4789a9ea1e65d05ea30acf41ed (patch) | |
| tree | 51bdd0584d727080fab86acd28bd4b360b2333bd /src/service.c | |
| parent | 5552fa0fcc7501d3206fb3d3a64c1d04062ec53b (diff) | |
| download | libimobiledevice-5072dea1373b7c4789a9ea1e65d05ea30acf41ed.tar.gz libimobiledevice-5072dea1373b7c4789a9ea1e65d05ea30acf41ed.tar.bz2 | |
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.
Diffstat (limited to 'src/service.c')
| -rw-r--r-- | src/service.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/service.c b/src/service.c index c4743dc..48959b6 100644 --- a/src/service.c +++ b/src/service.c | |||
| @@ -76,7 +76,7 @@ LIBIMOBILEDEVICE_API service_error_t service_client_new(idevice_t device, lockdo | |||
| 76 | return SERVICE_E_SUCCESS; | 76 | return SERVICE_E_SUCCESS; |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | LIBIMOBILEDEVICE_API service_error_t service_client_factory_start_service(idevice_t device, const char* service_name, void **client, const char* label, int16_t (*constructor_func)(idevice_t, lockdownd_service_descriptor_t, void**), int16_t *error_code) | 79 | LIBIMOBILEDEVICE_API service_error_t service_client_factory_start_service(idevice_t device, const char* service_name, void **client, const char* label, int32_t (*constructor_func)(idevice_t, lockdownd_service_descriptor_t, void**), int32_t *error_code) |
| 80 | { | 80 | { |
| 81 | *client = NULL; | 81 | *client = NULL; |
| 82 | 82 | ||
| @@ -95,9 +95,9 @@ LIBIMOBILEDEVICE_API service_error_t service_client_factory_start_service(idevic | |||
| 95 | return SERVICE_E_START_SERVICE_ERROR; | 95 | return SERVICE_E_START_SERVICE_ERROR; |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | int16_t ec; | 98 | int32_t ec; |
| 99 | if (constructor_func) { | 99 | if (constructor_func) { |
| 100 | ec = (int16_t)constructor_func(device, service, client); | 100 | ec = (int32_t)constructor_func(device, service, client); |
| 101 | } else { | 101 | } else { |
| 102 | ec = service_client_new(device, service, (service_client_t*)client); | 102 | ec = service_client_new(device, service, (service_client_t*)client); |
| 103 | } | 103 | } |
