]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
xfrm: use the right specifier for uint64_t
authorCong Wang <xiyou.wangcong@gmail.com>
Mon, 21 Jul 2014 17:44:45 +0000 (10:44 -0700)
committerThomas Haller <thaller@redhat.com>
Mon, 21 Jul 2014 17:59:39 +0000 (19:59 +0200)
This fixes compile warnings like this:

xfrm/sp.c: In function 'xfrm_sp_dump_line':
xfrm/sp.c:346:3: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'uint64_t' [-Wformat=]
   sprintf (dir, "%llu", sp->lft->soft_byte_limit);

Cc: Thomas Haller <thaller@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
lib/xfrm/sa.c
lib/xfrm/sp.c

index 38c06fca6b6ae38098f0734a15dd1f8efc0864d0..dc887a06e0b7923f9c4d094c4b039a280a2cabf4 100644 (file)
@@ -409,20 +409,20 @@ static void xfrm_sa_dump_line(struct nl_object *a, struct nl_dump_params *p)
        if (sa->lft->soft_byte_limit == XFRM_INF)
                sprintf (flags, "INF");
        else
-               sprintf (flags, "%llu", sa->lft->soft_byte_limit);
+               sprintf (flags, "%" PRIu64, sa->lft->soft_byte_limit);
        if (sa->lft->soft_packet_limit == XFRM_INF)
                sprintf (mode, "INF");
        else
-               sprintf (mode, "%llu", sa->lft->soft_packet_limit);
+               sprintf (mode, "%" PRIu64, sa->lft->soft_packet_limit);
        nl_dump_line(p, "\t\tsoft limit: %s (bytes), %s (packets)\n", flags, mode);
        if (sa->lft->hard_byte_limit == XFRM_INF)
                sprintf (flags, "INF");
        else
-               sprintf (flags, "%llu", sa->lft->hard_byte_limit);
+               sprintf (flags, "%" PRIu64, sa->lft->hard_byte_limit);
        if (sa->lft->hard_packet_limit == XFRM_INF)
                sprintf (mode, "INF");
        else
-               sprintf (mode, "%llu", sa->lft->hard_packet_limit);
+               sprintf (mode, "%" PRIu64, sa->lft->hard_packet_limit);
        nl_dump_line(p, "\t\thard limit: %s (bytes), %s (packets)\n", flags, mode);
        nl_dump_line(p, "\t\tsoft add_time: %llu (seconds), soft use_time: %llu (seconds) \n",
                     sa->lft->soft_add_expires_seconds, sa->lft->soft_use_expires_seconds);
index d857502117c5f385a661ebc14b6a45ea19917315..e66924ba11ead8e73d64235267eac1b60d3e446f 100644 (file)
@@ -343,19 +343,19 @@ static void xfrm_sp_dump_line(struct nl_object *a, struct nl_dump_params *p)
        if (sp->lft->soft_byte_limit == XFRM_INF)
                sprintf (dir, "INF");
        else
-               sprintf (dir, "%llu", sp->lft->soft_byte_limit);
+               sprintf (dir, "%" PRIu64, sp->lft->soft_byte_limit);
        if (sp->lft->soft_packet_limit == XFRM_INF)
                sprintf (action, "INF");
        else
-               sprintf (action, "%llu", sp->lft->soft_packet_limit);
+               sprintf (action, "%" PRIu64, sp->lft->soft_packet_limit);
        if (sp->lft->hard_byte_limit == XFRM_INF)
                sprintf (flags, "INF");
        else
-               sprintf (flags, "%llu", sp->lft->hard_byte_limit);
+               sprintf (flags, "%" PRIu64, sp->lft->hard_byte_limit);
        if (sp->lft->hard_packet_limit == XFRM_INF)
                sprintf (share, "INF");
        else
-               sprintf (share, "%llu", sp->lft->hard_packet_limit);
+               sprintf (share, "%" PRIu64, sp->lft->hard_packet_limit);
        nl_dump_line(p, "\t\tsoft limit: %s (bytes), %s (packets) \n", dir, action);
        nl_dump_line(p, "\t\thard limit: %s (bytes), %s (packets) \n", flags, share);
        nl_dump_line(p, "\t\tsoft add_time: %llu (seconds), soft use_time: %llu (seconds) \n",