forked from Mirror/frr
Compiler warnings fixes round 1.
This commit is contained in:
parent
2e864cfa12
commit
eb1ce6059a
|
@ -1,3 +1,8 @@
|
|||
2004-10-08 Hasso Tepper <hasso at quagga.net>
|
||||
|
||||
* *.[c|h]: Fix compiler warnings: make some strings const, signed ->
|
||||
unsigned, remove unused variables etc.
|
||||
|
||||
2004-10-07 Greg Troxel <gdt@claude.ir.bbn.com>
|
||||
|
||||
* ospf_apiserver.c (ospf_apiserver_unregister_opaque_type): Don't
|
||||
|
|
|
@ -149,7 +149,7 @@ unsigned long term_debug_ospf_nssa = 0;
|
|||
|
||||
|
||||
#define OSPF_AREA_STRING_MAXLEN 16
|
||||
char *
|
||||
const char *
|
||||
ospf_area_name_string (struct ospf_area *area)
|
||||
{
|
||||
static char buf[OSPF_AREA_STRING_MAXLEN] = "";
|
||||
|
@ -166,7 +166,7 @@ ospf_area_name_string (struct ospf_area *area)
|
|||
}
|
||||
|
||||
#define OSPF_AREA_DESC_STRING_MAXLEN 23
|
||||
char *
|
||||
const char *
|
||||
ospf_area_desc_string (struct ospf_area *area)
|
||||
{
|
||||
static char buf[OSPF_AREA_DESC_STRING_MAXLEN] = "";
|
||||
|
@ -195,7 +195,7 @@ ospf_area_desc_string (struct ospf_area *area)
|
|||
}
|
||||
|
||||
#define OSPF_IF_STRING_MAXLEN 40
|
||||
char *
|
||||
const char *
|
||||
ospf_if_name_string (struct ospf_interface *oi)
|
||||
{
|
||||
static char buf[OSPF_IF_STRING_MAXLEN] = "";
|
||||
|
@ -236,7 +236,7 @@ ospf_nbr_state_message (struct ospf_neighbor *nbr, char *buf, size_t size)
|
|||
LOOKUP (ospf_ism_state_msg, state));
|
||||
}
|
||||
|
||||
char *
|
||||
const char *
|
||||
ospf_timer_dump (struct thread *t, char *buf, size_t size)
|
||||
{
|
||||
struct timeval now;
|
||||
|
@ -326,7 +326,7 @@ ospf_dd_flags_dump (u_char flags, char *buf, size_t size)
|
|||
void
|
||||
ospf_lsa_header_dump (struct lsa_header *lsah)
|
||||
{
|
||||
char *lsah_type = LOOKUP (ospf_lsa_type_msg, lsah->type);
|
||||
const char *lsah_type = LOOKUP (ospf_lsa_type_msg, lsah->type);
|
||||
|
||||
zlog_info (" LSA Header");
|
||||
zlog_info (" LS age %d", ntohs (lsah->ls_age));
|
||||
|
@ -1484,8 +1484,8 @@ config_write_debug (struct vty *vty)
|
|||
int write = 0;
|
||||
int i, r;
|
||||
|
||||
char *type_str[] = {"hello", "dd", "ls-request", "ls-update", "ls-ack"};
|
||||
char *detail_str[] = {"", " send", " recv", "", " detail",
|
||||
const char *type_str[] = {"hello", "dd", "ls-request", "ls-update", "ls-ack"};
|
||||
const char *detail_str[] = {"", " send", " recv", "", " detail",
|
||||
" send detail", " recv detail", " detail"};
|
||||
|
||||
/* debug ospf ism (status|events|timers). */
|
||||
|
|
|
@ -121,16 +121,16 @@ extern unsigned long term_debug_ospf_zebra;
|
|||
extern unsigned long term_debug_ospf_nssa;
|
||||
|
||||
/* Message Strings. */
|
||||
extern char *ospf_packet_type_str[];
|
||||
extern const char *ospf_packet_type_str[];
|
||||
extern char *ospf_lsa_type_str[];
|
||||
|
||||
/* Prototypes. */
|
||||
char *ospf_area_name_string (struct ospf_area *);
|
||||
char *ospf_area_desc_string (struct ospf_area *);
|
||||
char *ospf_if_name_string (struct ospf_interface *);
|
||||
const char *ospf_area_name_string (struct ospf_area *);
|
||||
const char *ospf_area_desc_string (struct ospf_area *);
|
||||
const char *ospf_if_name_string (struct ospf_interface *);
|
||||
void ospf_nbr_state_message (struct ospf_neighbor *, char *, size_t);
|
||||
char *ospf_options_dump (u_char);
|
||||
char *ospf_timer_dump (struct thread *, char *, size_t);
|
||||
const char *ospf_timer_dump (struct thread *, char *, size_t);
|
||||
void ospf_ip_header_dump (struct stream *);
|
||||
void ospf_packet_dump (struct stream *);
|
||||
void ospf_lsa_header_dump (struct lsa_header *);
|
||||
|
|
|
@ -553,7 +553,7 @@ struct {
|
|||
},
|
||||
};
|
||||
|
||||
static char *ospf_ism_event_str[] =
|
||||
const static char *ospf_ism_event_str[] =
|
||||
{
|
||||
"NoEvent",
|
||||
"InterfaceUp",
|
||||
|
|
|
@ -902,7 +902,7 @@ ospf_router_lsa_update_timer (struct thread *thread)
|
|||
struct ospf_area *area = getdata (node);
|
||||
struct ospf_lsa *lsa = area->router_lsa_self;
|
||||
struct router_lsa *rl;
|
||||
char *area_str;
|
||||
const char *area_str;
|
||||
|
||||
/* Keep Area ID string. */
|
||||
area_str = AREA_NAME (area);
|
||||
|
|
|
@ -97,7 +97,7 @@ struct option longopts[] =
|
|||
struct thread_master *master;
|
||||
|
||||
/* Process ID saved for use by init system */
|
||||
char *pid_file = PATH_OSPFD_PID;
|
||||
const char *pid_file = PATH_OSPFD_PID;
|
||||
|
||||
/* Help information display. */
|
||||
static void
|
||||
|
|
|
@ -640,7 +640,7 @@ struct {
|
|||
},
|
||||
};
|
||||
|
||||
static char *ospf_nsm_event_str[] =
|
||||
const static char *ospf_nsm_event_str[] =
|
||||
{
|
||||
"NoEvent",
|
||||
"HelloReceived",
|
||||
|
|
|
@ -52,7 +52,7 @@ static void ospf_ls_ack_send_list (struct ospf_interface *, struct list *,
|
|||
struct in_addr);
|
||||
|
||||
/* Packet Type String. */
|
||||
char *ospf_packet_type_str[] =
|
||||
const char *ospf_packet_type_str[] =
|
||||
{
|
||||
"unknown",
|
||||
"Hello",
|
||||
|
@ -347,7 +347,7 @@ ospf_make_md5_digest (struct ospf_interface *oi, struct ospf_packet *op)
|
|||
|
||||
/* Get MD5 Authentication key from auth_key list. */
|
||||
if (list_isempty (OSPF_IF_PARAM (oi, auth_crypt)))
|
||||
auth_key = "";
|
||||
auth_key = (char *) "";
|
||||
else
|
||||
{
|
||||
ck = getdata (OSPF_IF_PARAM (oi, auth_crypt)->tail);
|
||||
|
@ -1991,12 +1991,11 @@ ospf_recv_packet (int fd, struct interface **ifp)
|
|||
struct stream *ibuf;
|
||||
unsigned int ifindex = 0;
|
||||
struct iovec iov;
|
||||
struct cmsghdr *cmsg;
|
||||
#if defined(CMSG_SPACE)
|
||||
/* Header and data both require alignment. */
|
||||
char buff [CMSG_SPACE(SOPT_SIZE_CMSG_IFINDEX_IPV4())];
|
||||
#else
|
||||
char buff [sizeof (*cmsg) + SOPT_SIZE_CMSG_IFINDEX_IPV4()];
|
||||
char buff [sizeof (struct cmsghdr) + SOPT_SIZE_CMSG_IFINDEX_IPV4()];
|
||||
#endif
|
||||
struct msghdr msgh;
|
||||
|
||||
|
|
|
@ -640,7 +640,7 @@ ospf_intra_add_stub (struct route_table *rt, struct router_lsa_link *link,
|
|||
zlog_info("ospf_intra_add_stub(): Stop");
|
||||
}
|
||||
|
||||
char *ospf_path_type_str[] =
|
||||
const char *ospf_path_type_str[] =
|
||||
{
|
||||
"unknown-type",
|
||||
"intra-area",
|
||||
|
|
|
@ -98,7 +98,7 @@ ospf_route_map_event (route_map_event_t event, char *name)
|
|||
/* Delete rip route map rule. */
|
||||
int
|
||||
ospf_route_match_delete (struct vty *vty, struct route_map_index *index,
|
||||
char *command, char *arg)
|
||||
const char *command, char *arg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
@ -123,7 +123,7 @@ ospf_route_match_delete (struct vty *vty, struct route_map_index *index,
|
|||
|
||||
int
|
||||
ospf_route_match_add (struct vty *vty, struct route_map_index *index,
|
||||
char *command, char *arg)
|
||||
const char *command, char *arg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
@ -148,7 +148,7 @@ ospf_route_match_add (struct vty *vty, struct route_map_index *index,
|
|||
|
||||
int
|
||||
ospf_route_set_add (struct vty *vty, struct route_map_index *index,
|
||||
char *command, char *arg)
|
||||
const char *command, char *arg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
@ -174,7 +174,7 @@ ospf_route_set_add (struct vty *vty, struct route_map_index *index,
|
|||
/* Delete rip route map rule. */
|
||||
int
|
||||
ospf_route_set_delete (struct vty *vty, struct route_map_index *index,
|
||||
char *command, char *arg)
|
||||
const char *command, char *arg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
@ -760,9 +760,11 @@ DEFUN (set_metric_type,
|
|||
"OSPF[6] external type 2 metric\n")
|
||||
{
|
||||
if (strcmp (argv[0], "1") == 0)
|
||||
return ospf_route_set_add (vty, vty->index, "metric-type", "type-1");
|
||||
return ospf_route_set_add (vty, vty->index, "metric-type",
|
||||
(char *) "type-1");
|
||||
if (strcmp (argv[0], "2") == 0)
|
||||
return ospf_route_set_add (vty, vty->index, "metric-type", "type-2");
|
||||
return ospf_route_set_add (vty, vty->index, "metric-type",
|
||||
(char *) "type-2");
|
||||
|
||||
return ospf_route_set_add (vty, vty->index, "metric-type", argv[0]);
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ ospf_vertex_free (struct vertex *v)
|
|||
}
|
||||
|
||||
void
|
||||
ospf_vertex_dump(char *msg, struct vertex *v,
|
||||
ospf_vertex_dump(const char *msg, struct vertex *v,
|
||||
int print_nexthops, int print_children)
|
||||
{
|
||||
if ( ! IS_DEBUG_OSPF_EVENT)
|
||||
|
@ -245,8 +245,7 @@ ospf_vertex_lookup (struct list *vlist, struct in_addr id, int type)
|
|||
int
|
||||
ospf_lsa_has_link (struct lsa_header *w, struct lsa_header *v)
|
||||
{
|
||||
int i;
|
||||
int length;
|
||||
unsigned int i, length;
|
||||
struct router_lsa *rl;
|
||||
struct network_lsa *nl;
|
||||
|
||||
|
@ -494,7 +493,6 @@ ospf_nexthop_calculation (struct ospf_area *area,
|
|||
if (IS_DEBUG_OSPF_EVENT)
|
||||
{
|
||||
char buf1[BUFSIZ];
|
||||
char buf2[BUFSIZ];
|
||||
zlog_info("ospf_nexthop_calculation(): considering link "
|
||||
"type %d link_id %s link_data %s",
|
||||
l->m[0].type,
|
||||
|
|
|
@ -1872,8 +1872,10 @@ DEFUN (show_mpls_te_link,
|
|||
|
||||
/* Show All Interfaces. */
|
||||
if (argc == 0)
|
||||
LIST_LOOP (iflist, ifp, node)
|
||||
show_mpls_te_link_sub (vty, ifp);
|
||||
{
|
||||
LIST_LOOP (iflist, ifp, node)
|
||||
show_mpls_te_link_sub (vty, ifp);
|
||||
}
|
||||
/* Interface name is specified. */
|
||||
else
|
||||
{
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
#include "ospfd/ospf_dump.h"
|
||||
|
||||
|
||||
static char *ospf_network_type_str[] =
|
||||
const static char *ospf_network_type_str[] =
|
||||
{
|
||||
"Null",
|
||||
"POINTOPOINT",
|
||||
|
@ -2098,8 +2098,8 @@ DEFUN (ospf_neighbor,
|
|||
{
|
||||
struct ospf *ospf = vty->index;
|
||||
struct in_addr nbr_addr;
|
||||
int priority = OSPF_NEIGHBOR_PRIORITY_DEFAULT;
|
||||
int interval = OSPF_POLL_INTERVAL_DEFAULT;
|
||||
unsigned int priority = OSPF_NEIGHBOR_PRIORITY_DEFAULT;
|
||||
unsigned int interval = OSPF_POLL_INTERVAL_DEFAULT;
|
||||
|
||||
VTY_GET_IPV4_ADDRESS ("neighbor address", nbr_addr, argv[0]);
|
||||
|
||||
|
@ -2146,8 +2146,8 @@ DEFUN (ospf_neighbor_poll_interval,
|
|||
{
|
||||
struct ospf *ospf = vty->index;
|
||||
struct in_addr nbr_addr;
|
||||
int priority = OSPF_NEIGHBOR_PRIORITY_DEFAULT;
|
||||
int interval = OSPF_POLL_INTERVAL_DEFAULT;
|
||||
unsigned int priority = OSPF_NEIGHBOR_PRIORITY_DEFAULT;
|
||||
unsigned int interval = OSPF_POLL_INTERVAL_DEFAULT;
|
||||
|
||||
VTY_GET_IPV4_ADDRESS ("neighbor address", nbr_addr, argv[0]);
|
||||
|
||||
|
@ -2231,7 +2231,7 @@ DEFUN (ospf_refresh_timer, ospf_refresh_timer_cmd,
|
|||
"Timer value in seconds\n")
|
||||
{
|
||||
struct ospf *ospf = vty->index;
|
||||
int interval;
|
||||
unsigned int interval;
|
||||
|
||||
VTY_GET_INTEGER_RANGE ("refresh timer", interval, argv[0], 10, 1800);
|
||||
interval = (interval / 10) * 10;
|
||||
|
@ -2248,7 +2248,7 @@ DEFUN (no_ospf_refresh_timer, no_ospf_refresh_timer_val_cmd,
|
|||
"Timer value in seconds\n")
|
||||
{
|
||||
struct ospf *ospf = vty->index;
|
||||
int interval;
|
||||
unsigned int interval;
|
||||
|
||||
if (argc == 1)
|
||||
{
|
||||
|
@ -2325,7 +2325,7 @@ DEFUN (no_ospf_auto_cost_reference_bandwidth,
|
|||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
char *ospf_abr_type_descr_str[] =
|
||||
const char *ospf_abr_type_descr_str[] =
|
||||
{
|
||||
"Unknown",
|
||||
"Standard (RFC2328)",
|
||||
|
@ -2334,7 +2334,7 @@ char *ospf_abr_type_descr_str[] =
|
|||
"Alternative Shortcut"
|
||||
};
|
||||
|
||||
char *ospf_shortcut_mode_descr_str[] =
|
||||
const char *ospf_shortcut_mode_descr_str[] =
|
||||
{
|
||||
"Default",
|
||||
"Enabled",
|
||||
|
@ -3132,7 +3132,7 @@ show_lsa_summary (struct vty *vty, struct ospf_lsa *lsa, int self)
|
|||
return 0;
|
||||
}
|
||||
|
||||
char *show_database_desc[] =
|
||||
const char *show_database_desc[] =
|
||||
{
|
||||
"unknown",
|
||||
"Router Link States",
|
||||
|
@ -3153,7 +3153,7 @@ char *show_database_desc[] =
|
|||
#define SHOW_OSPF_COMMON_HEADER \
|
||||
"Link ID ADV Router Age Seq# CkSum"
|
||||
|
||||
char *show_database_header[] =
|
||||
const char *show_database_header[] =
|
||||
{
|
||||
"",
|
||||
"Link ID ADV Router Age Seq# CkSum Link count",
|
||||
|
@ -3171,7 +3171,7 @@ char *show_database_header[] =
|
|||
#endif /* HAVE_OPAQUE_LSA */
|
||||
};
|
||||
|
||||
char *show_lsa_flags[] =
|
||||
const char *show_lsa_flags[] =
|
||||
{
|
||||
"Self-originated",
|
||||
"Checked",
|
||||
|
@ -3222,7 +3222,7 @@ show_ip_ospf_database_header (struct vty *vty, struct ospf_lsa *lsa)
|
|||
vty_out (vty, " Length: %d%s", ntohs (lsa->data->length), VTY_NEWLINE);
|
||||
}
|
||||
|
||||
char *link_type_desc[] =
|
||||
const char *link_type_desc[] =
|
||||
{
|
||||
"(null)",
|
||||
"another Router (point-to-point)",
|
||||
|
@ -3231,7 +3231,7 @@ char *link_type_desc[] =
|
|||
"a Virtual Link",
|
||||
};
|
||||
|
||||
char *link_id_desc[] =
|
||||
const char *link_id_desc[] =
|
||||
{
|
||||
"(null)",
|
||||
"Neighboring Router ID",
|
||||
|
@ -3240,7 +3240,7 @@ char *link_id_desc[] =
|
|||
"Neighboring Router ID",
|
||||
};
|
||||
|
||||
char *link_data_desc[] =
|
||||
const char *link_data_desc[] =
|
||||
{
|
||||
"(null)",
|
||||
"Router Interface address",
|
||||
|
@ -6641,7 +6641,7 @@ DEFUN (show_ip_ospf_route,
|
|||
}
|
||||
|
||||
|
||||
char *ospf_abr_type_str[] =
|
||||
const char *ospf_abr_type_str[] =
|
||||
{
|
||||
"unknown",
|
||||
"standard",
|
||||
|
@ -6650,7 +6650,7 @@ char *ospf_abr_type_str[] =
|
|||
"shortcut"
|
||||
};
|
||||
|
||||
char *ospf_shortcut_mode_str[] =
|
||||
const char *ospf_shortcut_mode_str[] =
|
||||
{
|
||||
"default",
|
||||
"enable",
|
||||
|
@ -6670,7 +6670,7 @@ area_id2str (char *buf, int length, struct ospf_area *area)
|
|||
}
|
||||
|
||||
|
||||
char *ospf_int_type_str[] =
|
||||
const char *ospf_int_type_str[] =
|
||||
{
|
||||
"unknown", /* should never be used. */
|
||||
"point-to-point",
|
||||
|
@ -6730,7 +6730,7 @@ config_write_interface (struct vty *vty)
|
|||
if (OSPF_IF_PARAM_CONFIGURED (params, auth_type) &&
|
||||
params->auth_type != OSPF_AUTH_NOTSET)
|
||||
{
|
||||
char *auth_str;
|
||||
const char *auth_str;
|
||||
|
||||
/* Translation tables are not that much help here due to syntax
|
||||
of the simple option */
|
||||
|
@ -7087,8 +7087,8 @@ config_write_virtual_link (struct vty *vty, struct ospf *ospf)
|
|||
}
|
||||
|
||||
|
||||
char *distribute_str[] = { "system", "kernel", "connected", "static", "rip",
|
||||
"ripng", "ospf", "ospf6", "isis", "bgp"};
|
||||
const char *distribute_str[] = { "system", "kernel", "connected", "static",
|
||||
"rip", "ripng", "ospf", "ospf6", "isis", "bgp"};
|
||||
int
|
||||
config_write_ospf_redistribute (struct vty *vty, struct ospf *ospf)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue