We generally require C99. Some compilers, e.g. gcc, barf on
'for' statement declared variables, if std={gnu,c}99 or higher is not
given - even while seemingly accepting other C99 constructs.
As it's trivial, remove these.
---
lib/if.c | 4 +++-
lib/zclient.c | 7 +++++--
zebra/interface.c | 4 +++-
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/lib/if.c b/lib/if.c
index 45c1acc..0fc4b60 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -1131,6 +1131,8 @@ if_link_type_str (enum zebra_link_type llt)
struct if_link_params *
if_link_params_get (struct interface *ifp)
{
+ int i;
+
if (ifp->link_params != NULL)
return ifp->link_params;
@@ -1148,7 +1150,7 @@ if_link_params_get (struct interface *ifp)
/* Set Max, Reservable and Unreserved Bandwidth */
iflp->max_bw = bw;
iflp->max_rsv_bw = bw;
- for (int i = 0; i < MAX_CLASS_TYPE; i++)
+ for (i = 0; i < MAX_CLASS_TYPE; i++)
iflp->unrsv_bw[i] = bw;
/* Update Link parameters status */
diff --git a/lib/zclient.c b/lib/zclient.c
index 3840fe9..b096fba 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -716,6 +716,8 @@ zserv_vrf_id_update_free (struct zserv_vrf_id_update *vu)
struct zserv_vrf_id_update *
zebra_vrf_id_update_read (struct stream *s)
{
+ int i;
+
struct zserv_vrf_id_update *vu
= XMALLOC(MTYPE_ZCLIENT_VRF_ID_UPDATE, sizeof (struct
zserv_vrf_id_update));
@@ -748,7 +750,7 @@ zebra_vrf_id_update_read (struct stream *s)
vu = XREALLOC(MTYPE_ZCLIENT_VRF_ID_UPDATE, vu,
sizeof (struct zserv_vrf_id_update)
+ (sizeof(vrf_id_t) * vu->num));
- for (int i = 0; i < vu->num; i++)
+ for (i = 0; i < vu->num; i++)
vu->vrf_ids[i] = stream_getw (s);
return vu;
}
@@ -938,6 +940,7 @@ zebra_interface_link_params_write (struct stream *s, struct
interface *ifp)
{
size_t w;
struct if_link_params *iflp;
+ int i;
if (s == NULL || ifp == NULL || ifp->link_params == NULL)
return 0;
@@ -952,7 +955,7 @@ zebra_interface_link_params_write (struct stream *s, struct
interface *ifp)
w += stream_putf (s, iflp->max_rsv_bw);
w += stream_putl (s, MAX_CLASS_TYPE);
- for (int i = 0; i < MAX_CLASS_TYPE; i++)
+ for (i = 0; i < MAX_CLASS_TYPE; i++)
w += stream_putf (s, iflp->unrsv_bw[i]);
w += stream_putl (s, iflp->admin_grp);
diff --git a/zebra/interface.c b/zebra/interface.c
index bb5d71e..5e89db9 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -2590,6 +2590,8 @@ DEFUN (no_ipv6_address,
static int
link_params_config_write (struct vty *vty, struct interface *ifp)
{
+ int i;
+
if ((ifp == NULL) || !HAS_LINK_PARAMS(ifp))
return -1;
@@ -2605,7 +2607,7 @@ link_params_config_write (struct vty *vty, struct
interface *ifp)
vty_out(vty, " max-rsv-bw %g%s", iflp->max_rsv_bw, VTY_NEWLINE);
if (IS_PARAM_SET(iflp, LP_UNRSV_BW))
{
- for (int i = 0; i < 8; i++)
+ for (i = 0; i < 8; i++)
vty_out(vty, " unrsv-bw %d %g%s",
i, iflp->unrsv_bw[i], VTY_NEWLINE);
}
--
2.5.5
_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev