summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/command.c4
-rw-r--r--lib/if.c8
-rw-r--r--lib/if.h2
-rw-r--r--lib/srcdest_table.c2
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/command.c b/lib/command.c
index 26afc762f..a594adb31 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -618,8 +618,8 @@ static int cmd_try_do_shortcut(enum node_type node, char *first_word)
*/
static int compare_completions(const void *fst, const void *snd)
{
- struct cmd_token *first = *(struct cmd_token **)fst,
- *secnd = *(struct cmd_token **)snd;
+ const struct cmd_token *first = *(const struct cmd_token * const *)fst,
+ *secnd = *(const struct cmd_token * const *)snd;
return strcmp(first->text, secnd->text);
}
diff --git a/lib/if.c b/lib/if.c
index 2f2073c0a..824af9f9f 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -63,7 +63,7 @@ int ptm_enable = 0;
* before all numbers. Examples: de0 < de1, de100 < fxp0 < xl0, devpty <
* devpty0, de0 < del0
*/
-int if_cmp_name_func(char *p1, char *p2)
+int if_cmp_name_func(const char *p1, const char *p2)
{
unsigned int l1, l2;
long int x1, x2;
@@ -99,8 +99,8 @@ int if_cmp_name_func(char *p1, char *p2)
if (!*p2)
return 1;
- x1 = strtol(p1, &p1, 10);
- x2 = strtol(p2, &p2, 10);
+ x1 = strtol(p1, (char **)&p1, 10);
+ x2 = strtol(p2, (char **)&p2, 10);
/* let's compare numbers now */
if (x1 < x2)
@@ -121,7 +121,7 @@ int if_cmp_name_func(char *p1, char *p2)
static int if_cmp_func(const struct interface *ifp1,
const struct interface *ifp2)
{
- return if_cmp_name_func((char *)ifp1->name, (char *)ifp2->name);
+ return if_cmp_name_func(ifp1->name, ifp2->name);
}
static int if_cmp_index_func(const struct interface *ifp1,
diff --git a/lib/if.h b/lib/if.h
index a861cf2d8..7c7394fe6 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -455,7 +455,7 @@ struct nbr_connected {
#endif /* IFF_VIRTUAL */
/* Prototypes. */
-extern int if_cmp_name_func(char *, char *);
+extern int if_cmp_name_func(const char *p1, const char *p2);
/*
* Passing in VRF_UNKNOWN is a valid thing to do, unless we
diff --git a/lib/srcdest_table.c b/lib/srcdest_table.c
index 4497faf6f..e49735192 100644
--- a/lib/srcdest_table.c
+++ b/lib/srcdest_table.c
@@ -301,5 +301,5 @@ const char *srcdest_rnode2str(struct route_node *rn, char *str, int size)
const struct prefix *dst_p, *src_p;
srcdest_rnode_prefixes(rn, &dst_p, &src_p);
- return srcdest2str(dst_p, (struct prefix_ipv6*)src_p, str, size);
+ return srcdest2str(dst_p, (const struct prefix_ipv6 *)src_p, str, size);
}