From: Ethan Jackson Date: Tue, 19 Jun 2012 01:40:31 +0000 (-0700) Subject: lib: Minor const tweak in smap library. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4512aaa792c35cfb59710b951288f7a7394f3a73;p=openvswitch 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 --- diff --git a/lib/smap.c b/lib/smap.c index 642804ee..86653215 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 993d0b24..51f6397c 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 */