There is no warnings here any more.
diff --git a/ripd/ChangeLog b/ripd/ChangeLog
index 4ca580b..18b3c65 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 7869f2e..cbb4d3e 100644
--- a/ripd/rip_interface.c
+++ b/ripd/rip_interface.c
@@ -951,7 +951,7 @@
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 @@
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 @@
void
rip_clean_network ()
{
- int i;
+ unsigned int i;
char *str;
struct route_node *rn;
@@ -1270,7 +1270,7 @@
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 @@
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 @@
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 c2128e4..bc25159 100644
--- a/ripd/rip_main.c
+++ b/ripd/rip_main.c
@@ -92,7 +92,7 @@
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 45a45f4..ffe1317 100644
--- a/ripd/rip_routemap.c
+++ b/ripd/rip_routemap.c
@@ -47,7 +47,7 @@
/* 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 @@
/* 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 @@
/* 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 @@
/* 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 437e3c6..229fb33 100644
--- a/ripd/rip_zebra.c
+++ b/ripd/rip_zebra.c
@@ -164,14 +164,14 @@
}
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 @@
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 @@
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 acf0e7d..a799886 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -91,8 +91,8 @@
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 @@
{ 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 @@
/* 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 @@
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 @@
}
}
-char *
+const char *
rip_route_type_print (int sub_type)
{
switch (sub_type)
@@ -3490,8 +3491,8 @@
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;