Browse Source

*: 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.
Paul Jakma 5 years ago
parent
commit
3676cb0c02
3 changed files with 8 additions and 3 deletions
  1. 3 1
      lib/if.c
  2. 2 1
      lib/zclient.c
  3. 3 1
      zebra/interface.c

+ 3 - 1
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 */

+ 2 - 1
lib/zclient.c

@@ -886,6 +886,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;
@@ -900,7 +901,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);

+ 3 - 1
zebra/interface.c

@@ -2487,6 +2487,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;
   
@@ -2502,7 +2504,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);
     }