diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/command.c | 4 | ||||
-rw-r--r-- | lib/if.c | 4 | ||||
-rw-r--r-- | lib/jhash.c | 6 | ||||
-rw-r--r-- | lib/jhash.h | 4 | ||||
-rw-r--r-- | lib/libospf.h | 4 | ||||
-rw-r--r-- | lib/md5.c | 2 | ||||
-rw-r--r-- | lib/md5.h | 2 | ||||
-rw-r--r-- | lib/table.c | 3 | ||||
-rw-r--r-- | lib/vty.c | 4 | ||||
-rw-r--r-- | lib/vty.h | 2 | ||||
-rw-r--r-- | lib/workqueue.c | 12 |
11 files changed, 23 insertions, 24 deletions
diff --git a/lib/command.c b/lib/command.c index 1087ceb8..d1af7fa2 100644 --- a/lib/command.c +++ b/lib/command.c @@ -1411,7 +1411,7 @@ cmd_matcher_read_keywords(struct cmd_matcher *matcher, const char *word; int keyword_argc; const char **keyword_argv; - enum matcher_rv rv; + enum matcher_rv rv = MATCHER_NO_MATCH; keyword_mask = 0; while (1) @@ -1642,7 +1642,7 @@ cmd_element_match(struct cmd_element *cmd_element, { struct cmd_matcher matcher; unsigned int token_index; - enum matcher_rv rv; + enum matcher_rv rv = MATCHER_NO_MATCH; cmd_matcher_init(&matcher, cmd_element, filter, vline, index, match_type, match); @@ -309,8 +309,6 @@ struct interface * if_lookup_prefix (struct prefix *prefix) { struct listnode *node; - struct prefix addr; - int bestlen = 0; struct listnode *cnode; struct interface *ifp; struct connected *c; @@ -453,7 +451,7 @@ static void if_dump (const struct interface *ifp) { struct listnode *node; - struct connected *c; + struct connected *c __attribute__((unused)); for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, c)) zlog_info ("Interface %s index %d metric %d mtu %d " diff --git a/lib/jhash.c b/lib/jhash.c index 071fed6e..6154c346 100644 --- a/lib/jhash.c +++ b/lib/jhash.c @@ -42,10 +42,10 @@ * the input key. */ u_int32_t -jhash (void *key, u_int32_t length, u_int32_t initval) +jhash (const void *key, u_int32_t length, u_int32_t initval) { u_int32_t a, b, c, len; - u_int8_t *k = key; + const u_int8_t *k = key; len = length; a = b = JHASH_GOLDEN_RATIO; @@ -105,7 +105,7 @@ jhash (void *key, u_int32_t length, u_int32_t initval) * The length parameter here is the number of u_int32_ts in the key. */ u_int32_t -jhash2 (u_int32_t * k, u_int32_t length, u_int32_t initval) +jhash2 (const u_int32_t *k, u_int32_t length, u_int32_t initval) { u_int32_t a, b, c, len; diff --git a/lib/jhash.h b/lib/jhash.h index 44dd1b56..985ac94e 100644 --- a/lib/jhash.h +++ b/lib/jhash.h @@ -24,12 +24,12 @@ * of bytes. No alignment or length assumptions are made about * the input key. */ -extern u_int32_t jhash(void *key, u_int32_t length, u_int32_t initval); +extern u_int32_t jhash(const void *key, u_int32_t length, u_int32_t initval); /* A special optimized version that handles 1 or more of u_int32_ts. * The length parameter here is the number of u_int32_ts in the key. */ -extern u_int32_t jhash2(u_int32_t *k, u_int32_t length, u_int32_t initval); +extern u_int32_t jhash2(const u_int32_t *k, u_int32_t length, u_int32_t initval); /* A special ultra-optimized versions that knows they are hashing exactly * 3, 2 or 1 word(s). diff --git a/lib/libospf.h b/lib/libospf.h index 856c76df..2796209d 100644 --- a/lib/libospf.h +++ b/lib/libospf.h @@ -47,8 +47,8 @@ #define OSPF_LSA_MAXAGE_DIFF 900 #define OSPF_LS_INFINITY 0xffffff #define OSPF_DEFAULT_DESTINATION 0x00000000 /* 0.0.0.0 */ -#define OSPF_INITIAL_SEQUENCE_NUMBER 0x80000001 -#define OSPF_MAX_SEQUENCE_NUMBER 0x7fffffff +#define OSPF_INITIAL_SEQUENCE_NUMBER 0x80000001U +#define OSPF_MAX_SEQUENCE_NUMBER 0x7fffffffU /* OSPF Interface Types */ #define OSPF_IFTYPE_NONE 0 @@ -306,7 +306,7 @@ unsigned char* text; /* pointer to data stream */ int text_len; /* length of data stream */ unsigned char* key; /* pointer to authentication key */ int key_len; /* length of authentication key */ -caddr_t digest; /* caller digest to be filled in */ +uint8_t * digest; /* caller digest to be filled in */ { MD5_CTX context; @@ -84,6 +84,6 @@ do { \ /* From RFC 2104 */ void hmac_md5(unsigned char* text, int text_len, unsigned char* key, - int key_len, caddr_t digest); + int key_len, uint8_t *digest); #endif /* ! _LIBZEBRA_MD5_H_*/ diff --git a/lib/table.c b/lib/table.c index 220e9b81..bd7023c1 100644 --- a/lib/table.c +++ b/lib/table.c @@ -626,11 +626,8 @@ route_table_get_next_internal (const struct route_table *table, struct prefix *p) { struct route_node *node, *tmp_node; - u_char prefixlen; int cmp; - prefixlen = p->prefixlen; - node = table->top; while (node) @@ -2458,7 +2458,7 @@ vty_log (const char *level, const char *proto_str, /* Async-signal-safe version of vty_log for fixed strings. */ void -vty_log_fixed (const char *buf, size_t len) +vty_log_fixed (char *buf, size_t len) { unsigned int i; struct iovec iov[2]; @@ -2467,7 +2467,7 @@ vty_log_fixed (const char *buf, size_t len) if (!vtyvec) return; - iov[0].iov_base = (void *)buf; + iov[0].iov_base = buf; iov[0].iov_len = len; iov[1].iov_base = (void *)"\r\n"; iov[1].iov_len = 2; @@ -242,6 +242,6 @@ extern void vty_hello (struct vty *); /* Send a fixed-size message to all vty terminal monitors; this should be an async-signal-safe function. */ -extern void vty_log_fixed (const char *buf, size_t len); +extern void vty_log_fixed (char *buf, size_t len); #endif /* _ZEBRA_VTY_H */ diff --git a/lib/workqueue.c b/lib/workqueue.c index 61643bf8..e09d009f 100644 --- a/lib/workqueue.c +++ b/lib/workqueue.c @@ -30,7 +30,11 @@ #include "log.h" /* master list of work_queues */ -static struct list work_queues; +static struct list _work_queues; +/* pointer primarily to avoid an otherwise harmless warning on + * ALL_LIST_ELEMENTS_RO + */ +static struct list *work_queues = &_work_queues; #define WORK_QUEUE_MIN_GRANULARITY 1 @@ -78,7 +82,7 @@ work_queue_new (struct thread_master *m, const char *queue_name) new->items->del = (void (*)(void *)) work_queue_item_free; - listnode_add (&work_queues, new); + listnode_add (work_queues, new); new->cycles.granularity = WORK_QUEUE_MIN_GRANULARITY; @@ -96,7 +100,7 @@ work_queue_free (struct work_queue *wq) /* list_delete frees items via callback */ list_delete (wq->items); - listnode_delete (&work_queues, wq); + listnode_delete (work_queues, wq); XFREE (MTYPE_WORK_QUEUE_NAME, wq->name); XFREE (MTYPE_WORK_QUEUE, wq); @@ -187,7 +191,7 @@ DEFUN(show_work_queues, "Name", VTY_NEWLINE); - for (ALL_LIST_ELEMENTS_RO ((&work_queues), node, wq)) + for (ALL_LIST_ELEMENTS_RO (work_queues, node, wq)) { vty_out (vty,"%c %8d %5d %8ld %7d %6d %6u %s%s", (CHECK_FLAG (wq->flags, WQ_UNPLUGGED) ? ' ' : 'P'), |