]> mj.ucw.cz Git - libucw.git/commitdiff
UCW: Constified the lookup table for CF_LOOKUP and CF_BITMAP_LOOKUP.
authorMartin Mares <mj@ucw.cz>
Tue, 1 Jul 2008 10:08:29 +0000 (12:08 +0200)
committerMartin Mares <mj@ucw.cz>
Tue, 1 Jul 2008 10:08:29 +0000 (12:08 +0200)
lib/conf-intr.c
lib/conf.h
lib/fb-param.c
lib/ipaccess.c

index 84f555a29962cc5d3a809c9b863f6357ab8cdbdc..d27b909d4f0caa67b10a198ee5a918295006f745 100644 (file)
@@ -52,9 +52,9 @@ cf_type_size(enum cf_type type, struct cf_user_type *utype)
 }
 
 static char *
-cf_parse_lookup(char *str, int *ptr, char **t)
+cf_parse_lookup(char *str, int *ptr, const char * const *t)
 {
-  char **n = t;
+  const char * const *n = t;
   uns total_len = 0;
   while (*n && strcasecmp(*n, str)) {
     total_len += strlen(*n) + 2;
index 80857449ca41367258cb4e636038c21efdb68785..190d4b57fdd8665084e44ceda8010b2f57a71a58 100644 (file)
@@ -71,7 +71,7 @@ struct cf_item {
   union cf_union {
     struct cf_section *sec;            // declaration of a section or a list
     cf_parser *par;                    // parser function
-    char **lookup;                     // NULL-terminated sequence of allowed strings for lookups
+    const char * const *lookup;                // NULL-terminated sequence of allowed strings for lookups
     struct cf_user_type *utype;                // specification of the user-defined type
   } u;
   enum cf_class cls:16;                        // attribute class
index 854ba78a78632e950ea6a5efe518a16a2d96ccaf..8c51927f202b0396a006464bcb115e2832ee390d 100644 (file)
@@ -37,7 +37,7 @@ struct cf_section fbpar_cf = {
   CF_TYPE(struct fb_params),
   CF_COMMIT(fbpar_cf_commit),
   CF_ITEMS {
-    CF_LOOKUP("Type", (int *)F(type), ((char *[]){"std", "direct", "mmap", NULL})),
+    CF_LOOKUP("Type", (int *)F(type), ((const char * const []){"std", "direct", "mmap", NULL})),
     CF_UNS("BufSize", F(buffer_size)),
     CF_UNS("KeepBackBuf", F(keep_back_buf)),
     CF_UNS("ReadAhead", F(read_ahead)),
index 5dd388ccd36ee0a5a68c71c47656650458629d13..26bd1bb0a78de0ddabca06c3f1d65325829c765a 100644 (file)
@@ -68,7 +68,7 @@ struct cf_user_type ip_addrmask_type = {
 struct cf_section ipaccess_cf = {
   CF_TYPE(struct ipaccess_entry),
   CF_ITEMS {
-    CF_LOOKUP("Mode", PTR_TO(struct ipaccess_entry, allow), ((char*[]) { "deny", "allow", NULL })),
+    CF_LOOKUP("Mode", PTR_TO(struct ipaccess_entry, allow), ((const char* const []) { "deny", "allow", NULL })),
     CF_USER("IP", PTR_TO(struct ipaccess_entry, addr), &ip_addrmask_type),
     CF_END
   }