]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Fix warnings. Didn't even look at files not compiled in Linux though.
authorhasso <hasso>
Thu, 7 Oct 2004 20:29:24 +0000 (20:29 +0000)
committerhasso <hasso>
Thu, 7 Oct 2004 20:29:24 +0000 (20:29 +0000)
zebra/ChangeLog
zebra/connected.c
zebra/main.c
zebra/rt_netlink.c
zebra/rtadv.c
zebra/zebra_rib.c
zebra/zserv.c

index a6ac1fc3b22f29a78056c7abeafe4127a4376ba1..d22e47bd75e527450ec87d1700e11e33892f9b28 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-07 Hasso Tepper <hasso at quagga.net>
+
+       * connected.c, main.c, rt_netlink.c, rtadv.c, zebra_rib.c, zserv.c:
+         Fix warnings: make strings const, signed -> unsigned.
+
 2004-10-05 Paul Jakma <paul@dishone.st>
 
        * irdp_packet.c: (parse_irdp_packet) style issues.
index df0b56a0d50adb4df64d96a90d79862f21850fcd..a043ef48e567f9d27088b677e5c6a248d23b6e36 100644 (file)
@@ -279,7 +279,7 @@ connected_up_ipv6 (struct interface *ifp, struct connected *ifc)
 /* Add connected IPv6 route to the interface. */
 void
 connected_add_ipv6 (struct interface *ifp, struct in6_addr *addr,
-                   int prefixlen, struct in6_addr *broad)
+                   u_char prefixlen, struct in6_addr *broad)
 {
   struct prefix_ipv6 *p;
   struct connected *ifc;
@@ -367,7 +367,7 @@ connected_down_ipv6 (struct interface *ifp, struct connected *ifc)
 
 void
 connected_delete_ipv6 (struct interface *ifp, struct in6_addr *address,
-                    int prefixlen, struct in6_addr *broad)
+                      u_char prefixlen, struct in6_addr *broad)
 {
   struct prefix_ipv6 p;
   struct connected *ifc;
index e10755b93d98c4a66d9a662a12d495988bbbe1c9..72e2c585984d88d7510e6dcff9bc8bdaa6f9915a 100644 (file)
@@ -109,7 +109,7 @@ struct zebra_privs_t zserv_privs =
 char config_default[] = SYSCONFDIR DEFAULT_CONFIG_FILE;
 
 /* Process ID saved for use by init system */
-char *pid_file = PATH_ZEBRA_PID;
+const char *pid_file = PATH_ZEBRA_PID;
 
 /* Help information display. */
 static void
index cb69187c89bfffc290cc27b2eb7e5bb4a1715d09..ee61cb27f2115f3673f716a897acf38d3f571c1b 100644 (file)
@@ -47,7 +47,7 @@ struct nlsock
   int sock;
   int seq;
   struct sockaddr_nl snl;
-  char *name;
+  const char *name;
 } netlink      = { -1, 0, {0}, "netlink-listen"},     /* kernel messages */
   netlink_cmd  = { -1, 0, {0}, "netlink-cmd"},        /* command channel */
   netlink_addr = { -1, 0, {0}, "netlink-addr"};       /* address channel */
@@ -65,7 +65,7 @@ struct message nlmsg_str[] = {
   {0, NULL}
 };
 
-char *nexthop_types_desc[] =  
+const char *nexthop_types_desc[] =  
 {
   "none",
   "Directly connected",
index e5a026e642f330e5dd6bb7d195d541b7dbd7b366..cb29a67efca942612d60d55b29311e420a718528 100644 (file)
@@ -349,7 +349,7 @@ rtadv_process_advert ()
 }
 
 void
-rtadv_process_packet (u_char *buf, int len, unsigned int ifindex, int hoplimit)
+rtadv_process_packet (u_char *buf, unsigned int len, unsigned int ifindex, int hoplimit)
 {
   struct icmp6_hdr *icmph;
   struct interface *ifp;
@@ -429,7 +429,7 @@ rtadv_read (struct thread *thread)
       return len;
     }
 
-  rtadv_process_packet (buf, len, ifindex, hoplimit);
+  rtadv_process_packet (buf, (unsigned)len, ifindex, hoplimit);
 
   return 0;
 }
index 93a13f8172b81262f558cd645c802eea6c5820a2..a06fd9095c637af382d955d7ad07759d6965a8db 100644 (file)
@@ -63,7 +63,7 @@ vector vrf_vector;
 
 /* Allocate new VRF.  */
 struct vrf *
-vrf_alloc (char *name)
+vrf_alloc (const char *name)
 {
   struct vrf *vrf;
 
@@ -102,7 +102,7 @@ vrf_lookup (u_int32_t id)
 struct vrf *
 vrf_lookup_by_name (char *name)
 {
-  int i;
+  unsigned int i;
   struct vrf *vrf;
 
   for (i = 0; i < vector_max (vrf_vector); i++)
index 537b5429a263435e5721f3c13e8d0997d3e0b45d..5a0272d23e99605cbef7960b526a41e691216063 100644 (file)
@@ -51,7 +51,7 @@ static void zebra_event (enum event event, int sock, struct zserv *client);
 extern struct zebra_privs_t zserv_privs;
 \f
 /* For logging of zebra meesages. */
-static char *zebra_command_str [] =
+static const char *zebra_command_str [] =
 {
   "NULL",
   "ZEBRA_INTERFACE_ADD",
@@ -169,7 +169,8 @@ zebra_server_send_message (int sock, u_char *buf, unsigned long length)
       else
        return -1;
     }
-  else if (nbytes != length)
+  /* It's clear that nbytes is positive at this point. */
+  else if ((unsigned) nbytes != length)
     zebra_server_enqueue (sock, buf, length, nbytes);
 
   return 0;
@@ -1449,7 +1450,7 @@ zebra_serv ()
 
 /* zebra server UNIX domain socket. */
 static void
-zebra_serv_un (char *path)
+zebra_serv_un (const char *path)
 {
   int ret;
   int sock, len;