From fce954f8de1456dd62d26b52902a4a352ef17a93 Mon Sep 17 00:00:00 2001 From: hasso Date: Thu, 7 Oct 2004 20:29:24 +0000 Subject: Fix warnings. Didn't even look at files not compiled in Linux though. --- zebra/ChangeLog | 5 +++++ zebra/connected.c | 4 ++-- zebra/main.c | 2 +- zebra/rt_netlink.c | 4 ++-- zebra/rtadv.c | 4 ++-- zebra/zebra_rib.c | 4 ++-- zebra/zserv.c | 7 ++++--- 7 files changed, 18 insertions(+), 12 deletions(-) (limited to 'zebra') diff --git a/zebra/ChangeLog b/zebra/ChangeLog index a6ac1fc3..d22e47bd 100644 --- a/zebra/ChangeLog +++ b/zebra/ChangeLog @@ -1,3 +1,8 @@ +2004-10-07 Hasso Tepper + + * 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 * irdp_packet.c: (parse_irdp_packet) style issues. diff --git a/zebra/connected.c b/zebra/connected.c index df0b56a0..a043ef48 100644 --- a/zebra/connected.c +++ b/zebra/connected.c @@ -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; diff --git a/zebra/main.c b/zebra/main.c index e10755b9..72e2c585 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -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 diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index cb69187c..ee61cb27 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -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", diff --git a/zebra/rtadv.c b/zebra/rtadv.c index e5a026e6..cb29a67e 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -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; } diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 93a13f81..a06fd909 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -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++) diff --git a/zebra/zserv.c b/zebra/zserv.c index 537b5429..5a0272d2 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -51,7 +51,7 @@ static void zebra_event (enum event event, int sock, struct zserv *client); 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 @@ 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; -- cgit v1.2.1