conf: make config types constant
authorDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 11 Aug 2012 18:51:30 +0000 (20:51 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 11 Aug 2012 18:51:30 +0000 (20:51 +0200)
Config types are shared so they should never be modified. Hence, make them
constant.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/conf.c

index 45f1ff9..317ef18 100644 (file)
@@ -62,7 +62,7 @@ struct conf_option {
        unsigned int flags;
        char short_name;
        const char *long_name;
-       struct conf_type *type;
+       const struct conf_type *type;
        void *mem;
        void *def;
 };
@@ -163,13 +163,13 @@ static void default_string(struct conf_option *opt)
        *(void**)opt->mem = opt->def;
 }
 
-static struct conf_type conf_bool = {
+static const struct conf_type conf_bool = {
        .parse = parse_bool,
        .free = NULL,
        .set_default = default_bool,
 };
 
-static struct conf_type conf_string = {
+static const struct conf_type conf_string = {
        .parse = parse_string,
        .free = free_value,
        .set_default = default_string,