summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ripd/ChangeLog5
-rw-r--r--ripd/rip_interface.c12
-rw-r--r--ripd/rip_main.c2
-rw-r--r--ripd/rip_routemap.c8
-rw-r--r--ripd/rip_zebra.c10
-rw-r--r--ripd/ripd.c17
6 files changed, 30 insertions, 24 deletions
diff --git a/ripd/ChangeLog b/ripd/ChangeLog
index 4ca580b9..18b3c65e 100644
--- a/ripd/ChangeLog
+++ b/ripd/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-08 Hasso Tepper <hasso at quagga.net>
+
+ * *.c: Fix compiler warnings: make strings const, signed -> unsigned
+ etc.
+
2004-09-26 Hasso Tepper <hasso at quagga.net>
* ripd.c: Fix compiler warning.
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c
index 7869f2e7..cbb4d3e2 100644
--- a/ripd/rip_interface.c
+++ b/ripd/rip_interface.c
@@ -951,7 +951,7 @@ rip_enable_network_add (struct prefix *p)
return -1;
}
else
- node->info = "enabled";
+ node->info = (char *) "enabled";
/* XXX: One should find a better solution than a generic one */
rip_enable_apply_all();
@@ -988,7 +988,7 @@ rip_enable_network_delete (struct prefix *p)
int
rip_enable_if_lookup (char *ifname)
{
- int i;
+ unsigned int i;
char *str;
for (i = 0; i < vector_max (rip_enable_interface); i++)
@@ -1245,7 +1245,7 @@ rip_neighbor_delete (struct prefix_ipv4 *p)
void
rip_clean_network ()
{
- int i;
+ unsigned int i;
char *str;
struct route_node *rn;
@@ -1270,7 +1270,7 @@ rip_clean_network ()
int
rip_passive_nondefault_lookup (char *ifname)
{
- int i;
+ unsigned int i;
char *str;
for (i = 0; i < vector_max (Vrip_passive_nondefault); i++)
@@ -1344,7 +1344,7 @@ rip_passive_nondefault_unset (struct vty *vty, char *ifname)
void
rip_passive_nondefault_clean ()
{
- int i;
+ unsigned int i;
char *str;
for (i = 0; i < vector_max (Vrip_passive_nondefault); i++)
@@ -2114,7 +2114,7 @@ rip_interface_config_write (struct vty *vty)
int
config_write_rip_network (struct vty *vty, int config_mode)
{
- int i;
+ unsigned int i;
char *ifname;
struct route_node *node;
diff --git a/ripd/rip_main.c b/ripd/rip_main.c
index c2128e46..bc251599 100644
--- a/ripd/rip_main.c
+++ b/ripd/rip_main.c
@@ -92,7 +92,7 @@ int vty_port = RIP_VTY_PORT;
struct thread_master *master;
/* Process ID saved for use by init system */
-char *pid_file = PATH_RIPD_PID;
+const char *pid_file = PATH_RIPD_PID;
/* Help information display. */
static void
diff --git a/ripd/rip_routemap.c b/ripd/rip_routemap.c
index 45a45f4b..ffe13170 100644
--- a/ripd/rip_routemap.c
+++ b/ripd/rip_routemap.c
@@ -47,7 +47,7 @@ struct rip_metric_modifier
/* Add rip route map rule. */
int
rip_route_match_add (struct vty *vty, struct route_map_index *index,
- char *command, char *arg)
+ const char *command, char *arg)
{
int ret;
@@ -70,7 +70,7 @@ rip_route_match_add (struct vty *vty, struct route_map_index *index,
/* Delete rip route map rule. */
int
rip_route_match_delete (struct vty *vty, struct route_map_index *index,
- char *command, char *arg)
+ const char *command, char *arg)
{
int ret;
@@ -93,7 +93,7 @@ rip_route_match_delete (struct vty *vty, struct route_map_index *index,
/* Add rip route map rule. */
int
rip_route_set_add (struct vty *vty, struct route_map_index *index,
- char *command, char *arg)
+ const char *command, char *arg)
{
int ret;
@@ -116,7 +116,7 @@ rip_route_set_add (struct vty *vty, struct route_map_index *index,
/* Delete rip route map rule. */
int
rip_route_set_delete (struct vty *vty, struct route_map_index *index,
- char *command, char *arg)
+ const char *command, char *arg)
{
int ret;
diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c
index 437e3c64..229fb33a 100644
--- a/ripd/rip_zebra.c
+++ b/ripd/rip_zebra.c
@@ -164,14 +164,14 @@ rip_routemap_set (int type, char *name)
}
void
-rip_redistribute_metric_set (int type, int metric)
+rip_redistribute_metric_set (int type, unsigned int metric)
{
rip->route_map[type].metric_config = 1;
rip->route_map[type].metric = metric;
}
int
-rip_metric_unset (int type,int metric)
+rip_metric_unset (int type, unsigned int metric)
{
#define DONT_CARE_METRIC_RIP 17
if (metric != DONT_CARE_METRIC_RIP &&
@@ -201,7 +201,7 @@ rip_routemap_unset (int type,char *name)
static struct {
int type;
int str_min_len;
- char *str;
+ const char *str;
} redist_type[] = {
{ZEBRA_ROUTE_KERNEL, 1, "kernel"},
{ZEBRA_ROUTE_CONNECT, 1, "connected"},
@@ -647,8 +647,8 @@ int
config_write_rip_redistribute (struct vty *vty, int config_mode)
{
int i;
- char *str[] = { "system", "kernel", "connected", "static", "rip",
- "ripng", "ospf", "ospf6", "isis", "bgp"};
+ const char *str[] = { "system", "kernel", "connected", "static", "rip",
+ "ripng", "ospf", "ospf6", "isis", "bgp"};
for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
if (i != zclient->redist_default && zclient->redist[i])
diff --git a/ripd/ripd.c b/ripd/ripd.c
index acf0e7d5..a7998860 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -91,8 +91,8 @@ struct message rip_msg[] =
struct
{
int key;
- char *str;
- char *str_long;
+ const char *str;
+ const char *str_long;
} route_info[] =
{
{ ZEBRA_ROUTE_SYSTEM, "X", "system"},
@@ -103,6 +103,7 @@ struct
{ ZEBRA_ROUTE_RIPNG, "R", "ripng"},
{ ZEBRA_ROUTE_OSPF, "O", "ospf"},
{ ZEBRA_ROUTE_OSPF6, "O", "ospf6"},
+ { ZEBRA_ROUTE_ISIS, "I", "isis"},
{ ZEBRA_ROUTE_BGP, "B", "bgp"}
};
@@ -678,11 +679,11 @@ rip_rte_process (struct rte *rte, struct sockaddr_in *from,
/* Dump RIP packet */
void
-rip_packet_dump (struct rip_packet *packet, int size, char *sndrcv)
+rip_packet_dump (struct rip_packet *packet, int size, const char *sndrcv)
{
caddr_t lim;
struct rte *rte;
- char *command_str;
+ const char *command_str;
char pbuf[BUFSIZ], nbuf[BUFSIZ];
u_char netmask = 0;
u_char *p;
@@ -2910,7 +2911,7 @@ DEFUN (rip_route,
return CMD_WARNING;
}
- node->info = "static";
+ node->info = (char *)"static";
rip_redistribute_add (ZEBRA_ROUTE_RIP, RIP_ROUTE_STATIC, &p, 0, NULL);
@@ -3379,7 +3380,7 @@ rip_vty_out_uptime (struct vty *vty, struct rip_info *rinfo)
}
}
-char *
+const char *
rip_route_type_print (int sub_type)
{
switch (sub_type)
@@ -3490,8 +3491,8 @@ DEFUN (show_ip_rip_status,
struct interface *ifp;
struct rip_interface *ri;
extern struct message ri_version_msg[];
- char *send_version;
- char *receive_version;
+ const char *send_version;
+ const char *receive_version;
if (! rip)
return CMD_SUCCESS;