*: use void * for printing pointers
On higher warning levels, compilers expect %p printf arguments to be
void *. Since format string / argument warnings can be useful
otherwise, let's get rid of this noise by sprinkling casts to void *
over printf calls.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index 94c31c9..f032601 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -248,7 +248,7 @@
new->refresh_list = -1;
if (IS_DEBUG_OSPF (lsa, LSA))
- zlog_debug ("LSA: duplicated %p (new: %p)", lsa, new);
+ zlog_debug ("LSA: duplicated %p (new: %p)", (void *)lsa, (void *)new);
return new;
}
@@ -260,7 +260,7 @@
assert (lsa->lock == 0);
if (IS_DEBUG_OSPF (lsa, LSA))
- zlog_debug ("LSA: freed %p", lsa);
+ zlog_debug ("LSA: freed %p", (void *)lsa);
/* Delete LSA data. */
if (lsa->data != NULL)
@@ -336,7 +336,7 @@
{
if (IS_DEBUG_OSPF (lsa, LSA))
zlog_debug ("LSA[Type%d:%s]: data freed %p",
- lsah->type, inet_ntoa (lsah->id), lsah);
+ lsah->type, inet_ntoa (lsah->id), (void *)lsah);
XFREE (MTYPE_OSPF_LSA_DATA, lsah);
}
@@ -888,7 +888,7 @@
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
{
zlog_debug ("LSA[Type%d:%s]: Originate router-LSA %p",
- new->data->type, inet_ntoa (new->data->id), new);
+ new->data->type, inet_ntoa (new->data->id), (void *)new);
ospf_lsa_header_dump (new->data);
}
@@ -1123,7 +1123,7 @@
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
{
zlog_debug ("LSA[Type%d:%s]: Originate network-LSA %p",
- new->data->type, inet_ntoa (new->data->id), new);
+ new->data->type, inet_ntoa (new->data->id), (void *)new);
ospf_lsa_header_dump (new->data);
}
@@ -1300,7 +1300,7 @@
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
{
zlog_debug ("LSA[Type%d:%s]: Originate summary-LSA %p",
- new->data->type, inet_ntoa (new->data->id), new);
+ new->data->type, inet_ntoa (new->data->id), (void *)new);
ospf_lsa_header_dump (new->data);
}
@@ -1443,7 +1443,7 @@
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
{
zlog_debug ("LSA[Type%d:%s]: Originate summary-ASBR-LSA %p",
- new->data->type, inet_ntoa (new->data->id), new);
+ new->data->type, inet_ntoa (new->data->id), (void *)new);
ospf_lsa_header_dump (new->data);
}
@@ -2075,7 +2075,7 @@
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
{
zlog_debug ("LSA[Type%d:%s]: Originate AS-external-LSA %p",
- new->data->type, inet_ntoa (new->data->id), new);
+ new->data->type, inet_ntoa (new->data->id), (void *)new);
ospf_lsa_header_dump (new->data);
}
@@ -2260,7 +2260,8 @@
if (lsa)
{
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug ("LSA[Type5:0.0.0.0]: Refresh AS-external-LSA %p", lsa);
+ zlog_debug ("LSA[Type5:0.0.0.0]: Refresh AS-external-LSA %p",
+ (void *)lsa);
ospf_external_lsa_refresh (ospf, lsa, ei, LSA_REFRESH_FORCE);
}
else
@@ -2687,7 +2688,7 @@
{
zlog_debug ("ospf_lsa_install() Premature Aging "
"lsa 0x%p, seqnum 0x%x",
- lsa, ntohl(lsa->data->ls_seqnum));
+ (void *)lsa, ntohl(lsa->data->ls_seqnum));
ospf_lsa_header_dump (lsa->data);
}
}
@@ -2790,9 +2791,9 @@
{
if (IS_DEBUG_OSPF (lsa, LSA_INSTALL))
zlog_debug ("LSA[Type%d:%s]: Install LSA 0x%p, MaxAge",
- new->data->type,
- inet_ntoa (new->data->id),
- lsa);
+ new->data->type,
+ inet_ntoa (new->data->id),
+ (void *)lsa);
ospf_lsa_maxage (ospf, lsa);
}
@@ -2879,7 +2880,7 @@
if (CHECK_FLAG (lsa->flags, OSPF_LSA_PREMATURE_AGE))
{
if (IS_DEBUG_OSPF (lsa, LSA_FLOODING))
- zlog_debug ("originating new lsa for lsa 0x%p\n", lsa);
+ zlog_debug ("originating new lsa for lsa 0x%p\n", (void *)lsa);
ospf_lsa_refresh (ospf, lsa);
}
@@ -2946,7 +2947,7 @@
{
if (IS_DEBUG_OSPF (lsa, LSA_FLOODING))
zlog_debug ("LSA[Type%d:%s]: %p already exists on MaxAge LSA list",
- lsa->data->type, inet_ntoa (lsa->data->id), lsa);
+ lsa->data->type, inet_ntoa (lsa->data->id), (void *)lsa);
return;
}
@@ -2961,7 +2962,8 @@
{
if (IS_DEBUG_OSPF (lsa, LSA_FLOODING))
zlog_debug ("LSA[%s]: found LSA (%p) in table for LSA %p %d",
- dump_lsa_key (lsa), rn->info, lsa, lsa_prefix.prefixlen);
+ dump_lsa_key (lsa), rn->info, (void *)lsa,
+ lsa_prefix.prefixlen);
route_unlock_node (rn);
}
else
@@ -3691,7 +3693,7 @@
if (IS_DEBUG_OSPF (lsa, LSA_REFRESH))
zlog_debug ("LSA[Refresh:%s]: ospf_refresher_register_lsa(): "
"setting refresh_list on lsa %p (slod %d)",
- inet_ntoa (lsa->data->id), lsa, index);
+ inet_ntoa (lsa->data->id), (void *)lsa, index);
}
}
@@ -3762,9 +3764,9 @@
{
if (IS_DEBUG_OSPF (lsa, LSA_REFRESH))
zlog_debug ("LSA[Refresh:%s]: ospf_lsa_refresh_walker(): "
- "refresh lsa %p (slot %d)",
- inet_ntoa (lsa->data->id), lsa, i);
-
+ "refresh lsa %p (slot %d)",
+ inet_ntoa (lsa->data->id), (void *)lsa, i);
+
assert (lsa->lock > 0);
list_delete_node (refresh_list, node);
lsa->refresh_list = -1;