mobile/primitives.c: fix format string compiler warning

The recent LUA integration code introduced the following
compiler warnings (on GCC 4.8.5):

primitives.c: In function ‘create_timer’:
primitives.c:90:2: warning: format ‘%llu’ expects argument of
                   type ‘long long unsigned int’,
                   but argument 7 has type ‘uint64_t’ [-Wformat=]

primitives.c: In function ‘cancel_timer’:
primitives.c:166:3: warning: format ‘%llu’ expects argument of
                   type ‘long long unsigned int’,
                   but argument 7 has type ‘uint64_t’ [-Wformat=]

The recommended and portable way of printing an 'uint64_t'
is to use the corresponding macros 'PRIu64'.

Change-Id: Ic7f54063a35a89ad54dfa63868f43009cbe469bb
This commit is contained in:
Vadim Yanitskiy 2018-02-10 19:36:20 +07:00
parent f54ebb06b9
commit af4bad3125
1 changed files with 7 additions and 3 deletions

View File

@ -18,6 +18,8 @@
*
*/
#include <inttypes.h>
#include <osmocom/bb/mobile/primitives.h>
#include <osmocom/bb/common/logging.h>
@ -87,7 +89,8 @@ static int create_timer(struct mobile_prim_intf *intf, struct mobile_timer_param
{
struct timer_closure *closure;
LOGP(DPRIM, LOGL_DEBUG, "Creating timer with reference: %llu\n", param->timer_id);
LOGP(DPRIM, LOGL_DEBUG, "Creating timer with reference: "
"%" PRIu64 "\n", param->timer_id);
closure = talloc_zero(intf, struct timer_closure);
closure->intf = intf;
@ -163,8 +166,9 @@ static int cancel_timer(struct mobile_prim_intf *intf, struct mobile_timer_param
if (closure->id != param->timer_id)
continue;
LOGP(DPRIM, LOGL_DEBUG,
"Canceling timer with reference: %llu\n", param->timer_id);
LOGP(DPRIM, LOGL_DEBUG, "Canceling timer with reference: "
"%" PRIu64 "\n", param->timer_id);
osmo_timer_del(&closure->timer);
llist_del(&closure->entry);
talloc_free(closure);