*: Remove some for statement declarations
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.
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 @@
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 @@
/* 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 c2e1333..09bb180 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -886,6 +886,7 @@
{
size_t w;
struct if_link_params *iflp;
+ int i;
if (s == NULL || ifp == NULL || ifp->link_params == NULL)
return 0;
@@ -900,7 +901,7 @@
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 6fa097f..f259eeb 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -2487,6 +2487,8 @@
static int
link_params_config_write (struct vty *vty, struct interface *ifp)
{
+ int i;
+
if ((ifp == NULL) || !HAS_LINK_PARAMS(ifp))
return -1;
@@ -2502,7 +2504,7 @@
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);
}