From dc1422998a1962c864274f47bd9e3b98278d0157 Mon Sep 17 00:00:00 2001 From: Stefan Knoblich Date: Fri, 27 Jul 2012 14:31:39 +0200 Subject: [PATCH] FreeTDM: Add FTDM_XINT64_FMT 64bit hex format string and use it in ftmod_misdn. Fixes: src/ftmod/ftmod_misdn/ftmod_misdn.c: In function 'misdn_handle_mph_information_ind': src/ftmod/ftmod_misdn/ftmod_misdn.c:871:3: error: format '%lx' expects argument of type 'long unsigned int', but argument 13 has type 'uint64_t' [-Werror=format] Signed-off-by: Stefan Knoblich --- libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c | 2 +- libs/freetdm/src/include/ftdm_declare.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c index 2e56c3f39c..462cb9a6c4 100644 --- a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c +++ b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c @@ -868,7 +868,7 @@ static int misdn_handle_mph_information_ind(ftdm_channel_t *chan, const struct m } bch_info = &info->bch[0]; - ftdm_log_chan(chan, FTDM_LOG_DEBUG, "mISDN port state:\n\tD-Chan proto:\t%hu\n\tD-Chan state:\t%s (%hu)\n\tD-Chan flags:\t%#lx\n\t\t\t%-70s\n", + ftdm_log_chan(chan, FTDM_LOG_DEBUG, "mISDN port state:\n\tD-Chan proto:\t%hu\n\tD-Chan state:\t%s (%hu)\n\tD-Chan flags:\t%#"FTDM_XINT64_FMT"\n\t\t\t%-70s\n", info->dch.ch.protocol, misdn_hw_state_name(info->dch.ch.protocol, info->dch.state), info->dch.state, info->dch.ch.Flags, diff --git a/libs/freetdm/src/include/ftdm_declare.h b/libs/freetdm/src/include/ftdm_declare.h index 3a931fb718..b47d16268a 100644 --- a/libs/freetdm/src/include/ftdm_declare.h +++ b/libs/freetdm/src/include/ftdm_declare.h @@ -192,6 +192,7 @@ typedef __int8 int8_t; #define FTDM_SIZE_FMT "Id" #define FTDM_INT64_FMT "lld" #define FTDM_UINT64_FMT "llu" +#define FTDM_XINT64_FMT "llx" #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 #else @@ -203,9 +204,11 @@ typedef __int8 int8_t; #if (defined(__SIZEOF_LONG__) && (__SIZEOF_LONG__ == 8)) || defined(__LP64__) || defined(__LLP64__) #define FTDM_INT64_FMT "ld" #define FTDM_UINT64_FMT "lu" +#define FTDM_XINT64_FMT "lx" #else #define FTDM_INT64_FMT "lld" #define FTDM_UINT64_FMT "llu" +#define FTDM_XINT64_FMT "llx" #endif #define FTDM_INVALID_SOCKET -1 typedef int ftdm_socket_t;