From 1c2f7ad5e409a5ad38bf01a10501344f58a2d87b Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 14 Jan 2020 02:54:01 +0100 Subject: Use PRI* and SCN* (inttypes.h) format string macros instead of self-defined ones ... also print all values in irecovery as hex with 0x prefix to make it clear they are hex --- src/libirecovery.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/libirecovery.c') diff --git a/src/libirecovery.c b/src/libirecovery.c index 56294a6..f932684 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c @@ -2,7 +2,7 @@ * libirecovery.c * Communication to iBoot/iBSS on Apple iOS devices via USB * - * Copyright (c) 2011-2019 Nikias Bassen + * Copyright (c) 2011-2020 Nikias Bassen * Copyright (c) 2012-2015 Martin Szulecki * Copyright (c) 2010 Chronic-Dev Team * Copyright (c) 2010 Joshua Hill @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -45,14 +46,10 @@ #include #include #endif -#define _FMT_qX "%qX" -#define _FMT_016llx "%016llx" #else #define WIN32_LEAN_AND_MEAN #include #include -#define _FMT_qX "%I64X" -#define _FMT_016llx "%016I64x" #ifndef sleep #define sleep(n) Sleep(1000 * n) #endif @@ -509,7 +506,7 @@ static void irecv_load_device_info_from_iboot_string(irecv_client_t client, cons ptr = strstr(iboot_string, "ECID:"); if (ptr != NULL) { - sscanf(ptr, "ECID:" _FMT_qX, &client->device_info.ecid); + sscanf(ptr, "ECID:%" SCNx64, &client->device_info.ecid); } ptr = strstr(iboot_string, "IBFL:"); @@ -739,7 +736,7 @@ irecv_error_t mobiledevice_connect(irecv_client_t* client, unsigned long long ec mobiledevice_closepipes(_client); continue; } - debug("found device with ECID " _FMT_016llx "\n", (unsigned long long)ecid); + debug("found device with ECID %016" PRIx64 "\n", (unsigned long long)ecid); } found = 1; break; @@ -821,7 +818,7 @@ irecv_error_t mobiledevice_connect(irecv_client_t* client, unsigned long long ec mobiledevice_closepipes(_client); continue; } - debug("found device with ECID " _FMT_016llx" \n", (unsigned long long)ecid); + debug("found device with ECID %016" PRIx64 "\n", (unsigned long long)ecid); } found = 1; break; @@ -1368,7 +1365,7 @@ IRECV_API irecv_error_t irecv_open_with_ecid(irecv_client_t* pclient, unsigned l irecv_close(client); continue; } - debug("found device with ECID " _FMT_016llx "\n", (unsigned long long)ecid); + debug("found device with ECID %016" PRIx64 "\n", (unsigned long long)ecid); } error = irecv_usb_set_configuration(client, 1); -- cgit v1.1-32-gdbae