]> git.notmuchmail.org Git - notmuch/commitdiff
command-line-arguments.[ch]: make arrays of keyword descriptors const
authorDavid Bremner <bremner@debian.org>
Tue, 13 Dec 2011 03:54:24 +0000 (23:54 -0400)
committerDavid Bremner <bremner@debian.org>
Tue, 13 Dec 2011 04:00:44 +0000 (00:00 -0400)
It seems like it should never be necessary to modify these arrays after
initialization.

command-line-arguments.c
command-line-arguments.h

index 3aa87aa598c8232b318e044b927d9a291fd8bb1c..e7114143259c6115c3c79b0d2c59a276704debbf 100644 (file)
@@ -13,7 +13,7 @@
 static notmuch_bool_t
 _process_keyword_arg (const notmuch_opt_desc_t *arg_desc, const char *arg_str) {
 
 static notmuch_bool_t
 _process_keyword_arg (const notmuch_opt_desc_t *arg_desc, const char *arg_str) {
 
-    notmuch_keyword_t *keywords = arg_desc->keywords;
+    const notmuch_keyword_t *keywords = arg_desc->keywords;
 
     while (keywords->name) {
        if (strcmp (arg_str, keywords->name) == 0) {
 
     while (keywords->name) {
        if (strcmp (arg_str, keywords->name) == 0) {
index af8b1cebd626d9fd5d5ce8fb89af063581e81c64..de1734ad2fdb3f0c5444c73abc5f74b7cbd99cf2 100644 (file)
@@ -38,7 +38,7 @@ typedef struct notmuch_opt_desc {
     void *output_var;
     const char *name;
     int  arg_id;
     void *output_var;
     const char *name;
     int  arg_id;
-    struct notmuch_keyword *keywords;
+    const struct notmuch_keyword *keywords;
 } notmuch_opt_desc_t;
 
 
 } notmuch_opt_desc_t;