diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-07-28 15:57:20 +0200 |
---|---|---|
committer | Ivan Kluchnikov <kluchnikovi@gmail.com> | 2013-08-02 13:36:20 +0400 |
commit | cf0265a112fca7841b3e3ed53f480b207397d414 (patch) | |
tree | a6e5dce7f512ea34b539b6dfb9f1c2df2b3afe6c /src/csn1.cpp | |
parent | 49be8bce50457e2a80b3425b9ac96989dd5fc879 (diff) |
csn1: Fix various printf/format issues pointed out by gcc
This might clash with C++11 and literal values but we will
see that once the compilers enable that by default.
Fixes:
csn1.cpp: In function 'gint16 csnStreamDecoder(csnStream_t*, const CSN_DESCR*, bitvec*, unsigned int&, void*)':
csn1.cpp:864:17: warning: format '%d' expects argument of type 'int', but argument 8 has type 'guint64 {aka long unsigned int}' [-Wformat]
csn1.cpp:1144:15: warning: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'uint64_t {aka long long unsigned int}' [-Wformat]
csn1.cpp:1150:15: warning: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'uint64_t {aka long long unsigned int}' [-Wformat]
csn1.cpp: In function 'gint16 csnStreamEncoder(csnStream_t*, const CSN_DESCR*, bitvec*, unsigned int&, void*)':
csn1.cpp:2119:17: warning: format '%d' expects argument of type 'int', but argument 8 has type 'guint64 {aka long unsigned int}' [-Wformat]
Diffstat (limited to 'src/csn1.cpp')
-rw-r--r-- | src/csn1.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/csn1.cpp b/src/csn1.cpp index de1db739..45cc8487 100644 --- a/src/csn1.cpp +++ b/src/csn1.cpp @@ -32,6 +32,8 @@ #include <cstdlib> #include <assert.h> #include <string.h> +#define __STDC_FORMAT_MACROS +#include <inttypes.h> #include "csn1.h" #include <gprs_debug.h> @@ -861,7 +863,7 @@ csnStreamDecoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector, unsig guint64 ui64 = bitvec_read_field(vector, readIndex, no_of_bits); pui64 = pui64DATA(data, pDescr->offset); *pui64 = ui64; - LOGPC(DCSN1, LOGL_NOTICE, "%s = %d | ", pDescr->sz , *pui64); + LOGPC(DCSN1, LOGL_NOTICE, "%s = %lu | ", pDescr->sz , *pui64); } else { @@ -1141,13 +1143,13 @@ csnStreamDecoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector, unsig guint8 bits_to_handle = remaining_bits_len%8; if (bits_to_handle > 0) { - LOGPC(DCSN1, LOGL_NOTICE, "%u|", bitvec_read_field(vector, readIndex, bits_to_handle)); + LOGPC(DCSN1, LOGL_NOTICE, "%"PRIu64"|", bitvec_read_field(vector, readIndex, bits_to_handle)); remaining_bits_len -= bits_to_handle; bit_offset += bits_to_handle; } else if (bits_to_handle == 0) { - LOGPC(DCSN1, LOGL_NOTICE, "%u|", bitvec_read_field(vector, readIndex, 8)); + LOGPC(DCSN1, LOGL_NOTICE, "%"PRIu64"|", bitvec_read_field(vector, readIndex, 8)); remaining_bits_len -= 8; bit_offset += 8; } @@ -2116,7 +2118,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector { pui64 = pui64DATA(data, pDescr->offset); bitvec_write_field(vector, writeIndex, *pui64, no_of_bits); - LOGPC(DCSN1, LOGL_NOTICE, "%s = %d | ", pDescr->sz , *pui64); + LOGPC(DCSN1, LOGL_NOTICE, "%s = %lu | ", pDescr->sz , *pui64); } else { |