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 --- tools/irecovery.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'tools') diff --git a/tools/irecovery.c b/tools/irecovery.c index 6ee89b0..91d1d48 100644 --- a/tools/irecovery.c +++ b/tools/irecovery.c @@ -2,7 +2,7 @@ * irecovery.c * Software frontend for iBoot/iBSS communication with iOS devices * - * Copyright (c) 2012-2019 Nikias Bassen + * Copyright (c) 2012-2020 Nikias Bassen * Copyright (c) 2012-2015 Martin Szulecki * Copyright (c) 2010-2011 Chronic-Dev Team * Copyright (c) 2010-2011 Joshua Hill @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -36,9 +37,6 @@ #ifndef sleep #define sleep(n) Sleep(1000 * n) #endif -#define _FMT_lld "%I64d" -#else -#define _FMT_lld "%lld" #endif #define FILE_HISTORY_PATH ".irecovery" @@ -134,13 +132,13 @@ static void print_device_info(irecv_client_t client) int ret, mode; const struct irecv_device_info *devinfo = irecv_get_device_info(client); if (devinfo) { - printf("CPID: %04x\n", devinfo->cpid); - printf("CPRV: %02x\n", devinfo->cprv); - printf("BDID: %02x\n", devinfo->bdid); - printf("ECID: " _FMT_lld "\n", devinfo->ecid); - printf("CPFM: %02x\n", devinfo->cpfm); - printf("SCEP: %02x\n", devinfo->scep); - printf("IBFL: %02x\n", devinfo->ibfl); + printf("CPID: 0x%04x\n", devinfo->cpid); + printf("CPRV: 0x%02x\n", devinfo->cprv); + printf("BDID: 0x%02x\n", devinfo->bdid); + printf("ECID: 0x%016" PRIx64 "\n", devinfo->ecid); + printf("CPFM: 0x%02x\n", devinfo->cpfm); + printf("SCEP: 0x%02x\n", devinfo->scep); + printf("IBFL: 0x%02x\n", devinfo->ibfl); printf("SRTG: %s\n", (devinfo->srtg) ? devinfo->srtg : "N/A"); printf("SRNM: %s\n", (devinfo->srnm) ? devinfo->srnm : "N/A"); printf("IMEI: %s\n", (devinfo->imei) ? devinfo->imei : "N/A"); -- cgit v1.1-32-gdbae