From 4512aaa792c35cfb59710b951288f7a7394f3a73 Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Mon, 18 Jun 2012 18:40:31 -0700 Subject: [PATCH] lib: Minor const tweak in smap library. The source argument of smap_clone() isn't modified, and thus can be declared const. Signed-off-by: Ethan Jackson --- lib/smap.c | 4 ++-- lib/smap.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/smap.c b/lib/smap.c index 642804ee5..866532156 100644 --- a/lib/smap.c +++ b/lib/smap.c @@ -196,9 +196,9 @@ smap_count(const struct smap *smap) /* Initializes 'dst' as a clone of 'src. */ void -smap_clone(struct smap *dst, struct smap *src) +smap_clone(struct smap *dst, const struct smap *src) { - struct smap_node *node; + const struct smap_node *node; smap_init(dst); SMAP_FOR_EACH (node, src) { diff --git a/lib/smap.h b/lib/smap.h index 993d0b243..51f6397c4 100644 --- a/lib/smap.h +++ b/lib/smap.h @@ -57,7 +57,7 @@ int smap_get_int(const struct smap *smap, const char *key, int def); bool smap_is_empty(const struct smap *); size_t smap_count(const struct smap *); -void smap_clone(struct smap *dst, struct smap *src); +void smap_clone(struct smap *dst, const struct smap *src); const struct smap_node **smap_sort(const struct smap *); #endif /* smap.h */ -- 2.43.0