[compiler] miscellaneous trivial compiler warning fixes

2006-01-19 Paul Jakma <paul.jakma@sun.com>

        * (general) various miscellaneous compiler warning fixes.
          Remove redundant break statements from switch clauses
          which return.
          return from main, not exit, cause it annoys SOS.
          Remove stray semi-colons which cause empty-statement
          warnings.
	* zebra/main.c: (sighup) remove private declaration of external
	  function.
diff --git a/bgpd/ChangeLog b/bgpd/ChangeLog
index 234ecb5..c96bc64 100644
--- a/bgpd/ChangeLog
+++ b/bgpd/ChangeLog
@@ -1,3 +1,12 @@
+2006-01-19 Paul Jakma <paul.jakma@sun.com>
+
+	* (general) various miscellaneous compiler warning fixes.
+	   Remove redundant break statements from switch clauses
+	   which return.
+	   return from main, not exit, cause it annoys SOS.
+	   Remove stray semi-colons which cause empty-statement
+	   warnings.
+
 2006-01-17 Paul Jakma <paul.jakma@sun.com>
 
 	* bgp_nexthop.c: (zlookup_read*) convert to new Zserv format.
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c
index e9a6d6a..2cc5ed3 100644
--- a/bgpd/bgp_aspath.c
+++ b/bgpd/bgp_aspath.c
@@ -1309,37 +1309,30 @@
     {
     case '\0':
       return NULL;
-      break;
     case '{':
       *token = as_token_set_start;
       p++;
       return p;
-      break;
     case '}':
       *token = as_token_set_end;
       p++;
       return p;
-      break;
     case '(':
       *token = as_token_confed_seq_start;
       p++;
       return p;
-      break;
     case ')':
       *token = as_token_confed_seq_end;
       p++;
       return p;
-      break;
     case '[':
       *token = as_token_confed_set_start;
       p++;
       return p;
-      break;
     case ']':
       *token = as_token_confed_set_end;
       p++;
       return p;
-      break;
     }
 
   /* Check actual AS value. */
@@ -1423,7 +1416,6 @@
 	default:
 	  aspath_free (aspath);
 	  return NULL;
-	  break;
 	}
     }
 
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index 4b94b11..3b27517 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -983,7 +983,6 @@
       zlog_info ("Wrong multiprotocol next hop length: %d", 
 		 attr->mp_nexthop_len);
       return -1;
-      break;
     }
 
   snpa_num = stream_getc (s);
diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c
index e5b4344..f75fc55 100644
--- a/bgpd/bgp_clist.c
+++ b/bgpd/bgp_clist.c
@@ -41,7 +41,6 @@
       {
       case COMMUNITY_LIST_MASTER:
 	return &ch->community_list;
-	break;
       case EXTCOMMUNITY_LIST_MASTER:
 	return &ch->extcommunity_list;
       }
diff --git a/bgpd/bgp_community.c b/bgpd/bgp_community.c
index 35e644b..3033db1 100644
--- a/bgpd/bgp_community.c
+++ b/bgpd/bgp_community.c
@@ -594,7 +594,6 @@
 	default:
 	  if (com)
 	    community_free (com);
-	  return NULL;
 	  break;
 	}
     }
diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c
index bcd37ea..64f4438 100644
--- a/bgpd/bgp_ecommunity.c
+++ b/bgpd/bgp_ecommunity.c
@@ -500,7 +500,6 @@
 	  if (ecom)
 	    ecommunity_free (ecom);
 	  return NULL;
-	  break;
 	}
     }
   return ecom;
diff --git a/bgpd/bgp_filter.c b/bgpd/bgp_filter.c
index de572c0..ab7f070 100644
--- a/bgpd/bgp_filter.c
+++ b/bgpd/bgp_filter.c
@@ -303,13 +303,10 @@
     {
     case AS_FILTER_PERMIT:
       return "permit";
-      break;
     case AS_FILTER_DENY:
       return "deny";
-      break;
     default:
       return "";
-      break;
     }
 }
 
diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c
index f9f0373..0baae3b 100644
--- a/bgpd/bgp_main.c
+++ b/bgpd/bgp_main.c
@@ -313,5 +313,5 @@
     thread_call (&thread);
 
   /* Not reached. */
-  exit (0);
+  return (0);
 }
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index fa218e2..07c3cbb 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -678,7 +678,6 @@
 	  peer->status = Idle;
 	  bgp_timer_set (peer);
 	  return 0;
-	  break;
 	case BGP_MSG_KEEPALIVE:
 	  peer->keepalive_out++;
 	  break;
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index f2621c1..e0d2a31 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -8100,7 +8100,7 @@
        "Address family\n"
        "Display routes matching the community-list\n"
        "community-list number\n"
-       "community-list name\n");
+       "community-list name\n")
 
 /* old command */
 DEFUN (show_ipv6_bgp_community_list,
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index bc9b6f7..15ba945 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -2046,11 +2046,9 @@
 	case RMAP_RULE_MISSING:
 	  vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
 	  return CMD_WARNING;
-	  break;
 	case RMAP_COMPILE_ERROR:
 	  vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
 	  return CMD_WARNING;
-	  break;
 	}
     }
   return CMD_SUCCESS;
@@ -2071,11 +2069,9 @@
 	case RMAP_RULE_MISSING:
 	  vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
 	  return CMD_WARNING;
-	  break;
 	case RMAP_COMPILE_ERROR:
 	  vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
 	  return CMD_WARNING;
-	  break;
 	}
     }
   return CMD_SUCCESS;
@@ -2096,11 +2092,9 @@
 	case RMAP_RULE_MISSING:
 	  vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
 	  return CMD_WARNING;
-	  break;
 	case RMAP_COMPILE_ERROR:
 	  vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
 	  return CMD_WARNING;
-	  break;
 	}
     }
   return CMD_SUCCESS;
@@ -2121,11 +2115,9 @@
 	case RMAP_RULE_MISSING:
 	  vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
 	  return CMD_WARNING;
-	  break;
 	case RMAP_COMPILE_ERROR:
 	  vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
 	  return CMD_WARNING;
-	  break;
 	}
     }
   return CMD_SUCCESS;
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index c8d5b2a..6ee4823 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -324,17 +324,14 @@
       vty_out (vty, "Please specify 'bgp multiple-instance' first%s", 
 	       VTY_NEWLINE);
       return CMD_WARNING;
-      break;
     case BGP_ERR_AS_MISMATCH:
       vty_out (vty, "BGP is already running; AS is %d%s", as, VTY_NEWLINE);
       return CMD_WARNING;
-      break;
     case BGP_ERR_INSTANCE_MISMATCH:
       vty_out (vty, "BGP view name and AS number mismatch%s", VTY_NEWLINE);
       vty_out (vty, "BGP instance is already running; AS is %d%s",
 	       as, VTY_NEWLINE);
       return CMD_WARNING;
-      break;
     }
 
   vty->node = BGP_NODE;
@@ -1276,11 +1273,9 @@
     case BGP_ERR_PEER_GROUP_MEMBER:
       vty_out (vty, "%% Peer-group AS %d. Cannot configure remote-as for member%s", as, VTY_NEWLINE);
       return CMD_WARNING;
-      break;
     case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT:
       vty_out (vty, "%% The AS# can not be changed from %d to %s, peer-group members must be all internal or all external%s", as, as_str, VTY_NEWLINE);
       return CMD_WARNING;
-      break;
     }
   return bgp_vty_return (vty, ret);
 }
@@ -2671,7 +2666,7 @@
        NEIGHBOR_CMD2 "enforce-multihop",
        NEIGHBOR_STR
        NEIGHBOR_ADDR_STR2
-       "Enforce EBGP neighbors perform multihop\n");
+       "Enforce EBGP neighbors perform multihop\n")
 
 /* Enforce multihop.  */
 ALIAS (no_neighbor_disable_connected_check,
@@ -2680,7 +2675,7 @@
        NO_STR
        NEIGHBOR_STR
        NEIGHBOR_ADDR_STR2
-       "Enforce EBGP neighbors perform multihop\n");
+       "Enforce EBGP neighbors perform multihop\n")
 
 DEFUN (neighbor_description,
        neighbor_description_cmd,
@@ -3804,7 +3799,7 @@
        NEIGHBOR_ADDR_STR2
        "Maximum number of prefix accept from this peer\n"
        "maximum no. of prefix limit\n"
-       "Only give warning message when limit is exceeded\n");
+       "Only give warning message when limit is exceeded\n")
 
 ALIAS (no_neighbor_maximum_prefix,
        no_neighbor_maximum_prefix_threshold_warning_cmd,
@@ -3815,7 +3810,7 @@
        "Maximum number of prefix accept from this peer\n"
        "maximum no. of prefix limit\n"
        "Threshold value (%) at which to generate a warning msg\n"
-       "Only give warning message when limit is exceeded\n");
+       "Only give warning message when limit is exceeded\n")
 
 ALIAS (no_neighbor_maximum_prefix,
        no_neighbor_maximum_prefix_restart_cmd,
@@ -9646,13 +9641,10 @@
     {
     case COMMUNITY_DENY:
       return "deny";
-      break;
     case COMMUNITY_PERMIT:
       return "permit";
-      break;
     default:
       return "unknown";
-      break;
     }
 }
 
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index ea365de..1f1b4fd 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -85,7 +85,6 @@
       break;
     default:
       return BGP_ERR_INVALID_FLAG;
-      break;
     }
   return 0;
 }
@@ -105,7 +104,6 @@
       break;
     default:
       return BGP_ERR_INVALID_FLAG;
-      break;
     }
   return 0;
 }
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog
index e5f8337..a5a1753 100644
--- a/ospfd/ChangeLog
+++ b/ospfd/ChangeLog
@@ -1,3 +1,12 @@
+2006-01-19 Paul Jakma <paul.jakma@sun.com>
+
+        * (general) various miscellaneous compiler warning fixes.
+           Remove redundant break statements from switch clauses
+           which return.
+           return from main, not exit, cause it annoys SOS.
+           Remove stray semi-colons which cause empty-statement
+           warnings.
+
 2006-01-18 Juergen Kammer <j.kammer@eurodata.de>
 
 	* ospf_lsa.c: (ospf_router_lsa_new) dont take reference to the
diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c
index 859e3bc..95d24b1 100644
--- a/ospfd/ospf_dump.c
+++ b/ospfd/ospf_dump.c
@@ -181,7 +181,6 @@
       break;
     default:
       return ospf_area_name_string (area);
-      break;
     }
 
   return buf;
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index 89e4d53..8ef4da6 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -3219,13 +3219,11 @@
     case OSPF_OPAQUE_AREA_LSA:
 #endif /* HAVE_OPAQUE_LSA */
       return ospf_lsdb_lookup_by_id (area->lsdb, type, id, adv_router);
-      break;
     case OSPF_AS_EXTERNAL_LSA:
 #ifdef HAVE_OPAQUE_LSA
     case OSPF_OPAQUE_AS_LSA:
 #endif /* HAVE_OPAQUE_LSA */
       return ospf_lsdb_lookup_by_id (ospf->lsdb, type, id, adv_router);
-      break;
     default:
       break;
     }
@@ -3244,7 +3242,6 @@
     {
     case OSPF_ROUTER_LSA:
       return ospf_lsdb_lookup_by_id (area->lsdb, type, id, id);
-      break;
     case OSPF_NETWORK_LSA:
       for (rn = route_top (NETWORK_LSDB (area)); rn; rn = route_next (rn))
 	if ((lsa = rn->info))
@@ -3259,7 +3256,6 @@
       /* Currently not used. */
       assert (1);
       return ospf_lsdb_lookup_by_id (area->lsdb, type, id, id);
-      break;
     case OSPF_AS_EXTERNAL_LSA:
     case OSPF_AS_NSSA_LSA:
 #ifdef HAVE_OPAQUE_LSA
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c
index 3225d7d..c105f19 100644
--- a/ospfd/ospf_main.c
+++ b/ospfd/ospf_main.c
@@ -321,6 +321,6 @@
     thread_call (&thread);
 
   /* Not reached. */
-  exit (0);
+  return (0);
 }
 
diff --git a/ospfd/ospf_routemap.c b/ospfd/ospf_routemap.c
index 6c89b22..adf8158 100644
--- a/ospfd/ospf_routemap.c
+++ b/ospfd/ospf_routemap.c
@@ -110,11 +110,9 @@
         case RMAP_RULE_MISSING:
           vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
           return CMD_WARNING;
-          break;
         case RMAP_COMPILE_ERROR:
           vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
           return CMD_WARNING;
-          break;
         }
     }
 
@@ -135,11 +133,9 @@
         case RMAP_RULE_MISSING:
           vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
           return CMD_WARNING;
-          break;
         case RMAP_COMPILE_ERROR:
           vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
           return CMD_WARNING;
-          break;
         }
     }
 
@@ -160,11 +156,9 @@
         case RMAP_RULE_MISSING:
           vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
           return CMD_WARNING;
-          break;
         case RMAP_COMPILE_ERROR:
           vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
           return CMD_WARNING;
-          break;
         }
     }
 
@@ -186,11 +180,9 @@
         case RMAP_RULE_MISSING:
           vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
           return CMD_WARNING;
-          break;
         case RMAP_COMPILE_ERROR:
           vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
           return CMD_WARNING;
-          break;
         }
     }
 
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 32dfdea..0b74bdf 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -3870,7 +3870,7 @@
 #ifdef HAVE_OPAQUE_LSA
           case OSPF_OPAQUE_AS_LSA:
 #endif /* HAVE_OPAQUE_LSA */
-            break;;
+            break;
           default:
             continue;
         }
diff --git a/ripd/ChangeLog b/ripd/ChangeLog
index 2b79a61..c979a11 100644
--- a/ripd/ChangeLog
+++ b/ripd/ChangeLog
@@ -1,3 +1,7 @@
+2006-01-19 Paul Jakma <paul.jakma@sun.com>
+
+        * ripd.c: (main) return from main, not exit, cause it annoys SOS.
+
 2006-01-17 Paul Jakma <paul.jakma@sun.com>
 
 	* ripd.c: (rip_auth_md5) remove pdigest, not needed.
diff --git a/ripd/rip_main.c b/ripd/rip_main.c
index 88e6367..c9d564b 100644
--- a/ripd/rip_main.c
+++ b/ripd/rip_main.c
@@ -298,5 +298,5 @@
     thread_call (&thread);
 
   /* Not reached. */
-  exit (0);
+  return (0);
 }
diff --git a/ripngd/ChangeLog b/ripngd/ChangeLog
index 46d4f9f..556ca8b 100644
--- a/ripngd/ChangeLog
+++ b/ripngd/ChangeLog
@@ -1,3 +1,12 @@
+2006-01-19 Paul Jakma <paul.jakma@sun.com>
+
+        * (general) various miscellaneous compiler warning fixes.
+          Remove redundant break statements from switch clauses 
+          which return. 
+          return from main, not exit, cause it annoys SOS. 
+          Remove stray semi-colons which cause empty-statement 
+          warnings.
+
 2005-10-01 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
 
 	* ripng_zebra.c: (ripng_redistribute_write) Remove local hard-coded
diff --git a/ripngd/ripng_main.c b/ripngd/ripng_main.c
index 5885f47..e6276c1 100644
--- a/ripngd/ripng_main.c
+++ b/ripngd/ripng_main.c
@@ -299,5 +299,5 @@
     thread_call (&thread);
 
   /* Not reached. */
-  exit (0);
+  return 0;
 }
diff --git a/ripngd/ripng_routemap.c b/ripngd/ripng_routemap.c
index 1c17e6c..abaa61e 100644
--- a/ripngd/ripng_routemap.c
+++ b/ripngd/ripng_routemap.c
@@ -57,11 +57,9 @@
 	case RMAP_RULE_MISSING:
 	  vty_out (vty, "Can't find rule.%s", VTY_NEWLINE);
 	  return CMD_WARNING;
-	  break;
 	case RMAP_COMPILE_ERROR:
 	  vty_out (vty, "Argument is malformed.%s", VTY_NEWLINE);
 	  return CMD_WARNING;
-	  break;
 	}
     }
   return CMD_SUCCESS;
@@ -81,11 +79,9 @@
 	case RMAP_RULE_MISSING:
 	  vty_out (vty, "Can't find rule.%s", VTY_NEWLINE);
 	  return CMD_WARNING;
-	  break;
 	case RMAP_COMPILE_ERROR:
 	  vty_out (vty, "Argument is malformed.%s", VTY_NEWLINE);
 	  return CMD_WARNING;
-	  break;
 	}
     }
   return CMD_SUCCESS;
@@ -105,11 +101,9 @@
 	case RMAP_RULE_MISSING:
 	  vty_out (vty, "Can't find rule.%s", VTY_NEWLINE);
 	  return CMD_WARNING;
-	  break;
 	case RMAP_COMPILE_ERROR:
 	  vty_out (vty, "Argument is malformed.%s", VTY_NEWLINE);
 	  return CMD_WARNING;
-	  break;
 	}
     }
   return CMD_SUCCESS;
@@ -129,11 +123,9 @@
 	case RMAP_RULE_MISSING:
 	  vty_out (vty, "Can't find rule.%s", VTY_NEWLINE);
 	  return CMD_WARNING;
-	  break;
 	case RMAP_COMPILE_ERROR:
 	  vty_out (vty, "Argument is malformed.%s", VTY_NEWLINE);
 	  return CMD_WARNING;
-	  break;
 	}
     }
   return CMD_SUCCESS;
diff --git a/zebra/ChangeLog b/zebra/ChangeLog
index b33180f..b40f78f 100644
--- a/zebra/ChangeLog
+++ b/zebra/ChangeLog
@@ -1,3 +1,14 @@
+2006-01-19 Paul Jakma <paul.jakma@sun.com>
+
+        * (general) various miscellaneous compiler warning fixes.
+          Remove redundant break statements from switch clauses
+          which return.
+          Remove stray semi-colons which cause empty-statement
+          warnings.
+	* main.c: (sighup) remove private declaration of external
+          function.
+          (main) return from main, not exit, cause it annoys SOS.
+
 2006-01-18 Gunnar Stigen <gunnar.stigen@axxessit.no>
 
 	* zebra_rib.c: Take interface metric into account.
diff --git a/zebra/main.c b/zebra/main.c
index 67108c4..dbe1b53 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -163,9 +163,6 @@
 static void
 sigint (void)
 {
-  /* Decrared in rib.c */
-  void rib_close ();
-
   zlog_notice ("Terminating on signal");
 
   if (!retain_mode)
@@ -378,5 +375,5 @@
     thread_call (&thread);
 
   /* Not reached... */
-  exit (0);
+  return 0;
 }
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 5d9cb2f..a591776 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1497,7 +1497,7 @@
   if (nexthop->type == NEXTHOP_TYPE_BLACKHOLE
       && si->type == STATIC_IPV4_BLACKHOLE)
     return 1;
-  return 0;;
+  return 0;
 }
 
 /* Uninstall static route from RIB. */
@@ -2045,7 +2045,7 @@
       && IPV6_ADDR_SAME (&nexthop->gate.ipv6, &si->ipv6)
       && strcmp (nexthop->ifname, si->ifname) == 0)
     return 1;
-  return 0;;
+  return 0;
 }
 
 static void
diff --git a/zebra/zserv.c b/zebra/zserv.c
index f8bfcfa..aa88ab5 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -138,7 +138,6 @@
       client->t_suicide = thread_add_event(zebrad.master, zserv_delayed_close,
 					   client, 0);
       return -1;
-      break;
     case BUFFER_EMPTY:
       THREAD_OFF(client->t_write);
       break;