lib: Minor const tweak in smap library.
authorEthan Jackson <ethan@nicira.com>
Tue, 19 Jun 2012 01:40:31 +0000 (18:40 -0700)
committerEthan Jackson <ethan@nicira.com>
Tue, 19 Jun 2012 19:55:25 +0000 (12:55 -0700)
The source argument of smap_clone() isn't modified, and thus can be
declared const.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
lib/smap.c
lib/smap.h

index 642804e..8665321 100644 (file)
@@ -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) {
index 993d0b2..51f6397 100644 (file)
@@ -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 */