From 959df0141c0774be90a92ab2440ad7d09f1f7e6b Mon Sep 17 00:00:00 2001 From: Hidden Date: Sat, 10 Aug 2024 14:40:44 -0400 Subject: [PATCH 1/2] Add Deref_Prefix() declaration to patricia.h --- libpatricia/patricia.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libpatricia/patricia.h b/libpatricia/patricia.h index e853cf1..905eec6 100644 --- a/libpatricia/patricia.h +++ b/libpatricia/patricia.h @@ -92,6 +92,8 @@ void patricia_process (patricia_tree_t *patricia, void_fn_t func); char *prefix_toa (prefix_t * prefix); +void Deref_Prefix (prefix_t * prefix); + /* { from demo.c */ prefix_t * From e518e259fcc29c4187c36a5efcb0144d4bb04768 Mon Sep 17 00:00:00 2001 From: Hidden Date: Sat, 10 Aug 2024 14:41:39 -0400 Subject: [PATCH 2/2] var `string` in function ascii2prefix() is now a const This fixes warnings when the string passed to ascii2prefix() is of type `const char *` instead of `char *`. --- libpatricia/patricia.c | 2 +- libpatricia/patricia.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libpatricia/patricia.c b/libpatricia/patricia.c index f0fc987..a493f23 100644 --- a/libpatricia/patricia.c +++ b/libpatricia/patricia.c @@ -235,7 +235,7 @@ New_Prefix (int family, void *dest, int bitlen) /* ascii2prefix */ prefix_t * -ascii2prefix (int family, char *string) +ascii2prefix (int family, const char *string) { u_long bitlen, maxbitlen = 0; char *cp; diff --git a/libpatricia/patricia.h b/libpatricia/patricia.h index 905eec6..b2ac050 100644 --- a/libpatricia/patricia.h +++ b/libpatricia/patricia.h @@ -97,7 +97,7 @@ void Deref_Prefix (prefix_t * prefix); /* { from demo.c */ prefix_t * -ascii2prefix (int family, char *string); +ascii2prefix (int family, const char *string); patricia_node_t * make_and_lookup (patricia_tree_t *tree, char *string);