Fix warnings. Didn't even look at files not compiled in Linux though.
diff --git a/zebra/ChangeLog b/zebra/ChangeLog
index a6ac1fc..d22e47b 100644
--- a/zebra/ChangeLog
+++ b/zebra/ChangeLog
@@ -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.
diff --git a/zebra/connected.c b/zebra/connected.c
index df0b56a..a043ef4 100644
--- a/zebra/connected.c
+++ b/zebra/connected.c
@@ -279,7 +279,7 @@
/* 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 @@
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;
diff --git a/zebra/main.c b/zebra/main.c
index e10755b..72e2c58 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -109,7 +109,7 @@
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
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index cb69187..ee61cb2 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -47,7 +47,7 @@
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 @@
{0, NULL}
};
-char *nexthop_types_desc[] =
+const char *nexthop_types_desc[] =
{
"none",
"Directly connected",
diff --git a/zebra/rtadv.c b/zebra/rtadv.c
index e5a026e..cb29a67 100644
--- a/zebra/rtadv.c
+++ b/zebra/rtadv.c
@@ -349,7 +349,7 @@
}
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 @@
return len;
}
- rtadv_process_packet (buf, len, ifindex, hoplimit);
+ rtadv_process_packet (buf, (unsigned)len, ifindex, hoplimit);
return 0;
}
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 93a13f8..a06fd90 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -63,7 +63,7 @@
/* Allocate new VRF. */
struct vrf *
-vrf_alloc (char *name)
+vrf_alloc (const char *name)
{
struct vrf *vrf;
@@ -102,7 +102,7 @@
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++)
diff --git a/zebra/zserv.c b/zebra/zserv.c
index 537b542..5a0272d 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -51,7 +51,7 @@
extern struct zebra_privs_t zserv_privs;
/* For logging of zebra meesages. */
-static char *zebra_command_str [] =
+static const char *zebra_command_str [] =
{
"NULL",
"ZEBRA_INTERFACE_ADD",
@@ -169,7 +169,8 @@
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 server UNIX domain socket. */
static void
-zebra_serv_un (char *path)
+zebra_serv_un (const char *path)
{
int ret;
int sock, len;