]> granicus.if.org Git - neomutt/commitdiff
add lots of consts
authorRichard Russon <rich@flatcap.org>
Fri, 31 Aug 2018 14:10:44 +0000 (15:10 +0100)
committerRichard Russon <rich@flatcap.org>
Fri, 31 Aug 2018 14:10:44 +0000 (15:10 +0100)
49 files changed:
alias.c
alias.h
commands.c
compose.c
curs_lib.c
curs_lib.h
edit.c
email/envelope.c
email/envelope.h
email/parse.c
email/rfc2047.c
hdrline.c
init.c
keymap.c
keymap.h
main.c
mutt.h
mutt/buffer.c
mutt/buffer.h
mutt/charset.c
mutt_commands.h
muttlib.c
ncrypt/crypt.c
ncrypt/crypt.h
ncrypt/crypt_gpgme.c
ncrypt/pgp.c
ncrypt/pgpkey.c
ncrypt/smime.c
nntp/newsrc.c
nntp/nntp.c
notmuch/mutt_notmuch.c
pop/pop_lib.c
pop/pop_private.h
send.c
terminal.c
test/address.c
test/config/address.c
test/config/bool.c
test/config/command.c
test/config/long.c
test/config/magic.c
test/config/mbtable.c
test/config/number.c
test/config/path.c
test/config/quad.c
test/config/regex.c
test/config/sort.c
test/config/string.c
test/config/synonym.c

diff --git a/alias.c b/alias.c
index 4068af96e44c6e1e5ba86b7c443a53fc6903b279..4f8b0f1e04cc73602981a8aa65785264d578faee 100644 (file)
--- a/alias.c
+++ b/alias.c
@@ -318,10 +318,10 @@ void mutt_expand_aliases_env(struct Envelope *env)
  * @param pfxp Prefix for the Address, e.g. "To:"
  * @retval ptr Address in the Envelope
  */
-struct Address *mutt_get_address(struct Envelope *env, char **pfxp)
+struct Address *mutt_get_address(struct Envelope *env, const char **pfxp)
 {
   struct Address *addr = NULL;
-  char *pfx = NULL;
+  const char *pfx = NULL;
 
   if (mutt_addr_is_user(env->from))
   {
diff --git a/alias.h b/alias.h
index a03e4a5a695b874436ad635954ec14af244e14ea..3d544a29d8013136ffeadb2a2980f2c2167cd959 100644 (file)
--- a/alias.h
+++ b/alias.h
@@ -51,7 +51,7 @@ void            mutt_aliaslist_free(struct AliasList *a_list);
 struct Address *mutt_alias_lookup(const char *s);
 void            mutt_expand_aliases_env(struct Envelope *env);
 struct Address *mutt_expand_aliases(struct Address *a);
-struct Address *mutt_get_address(struct Envelope *env, char **pfxp);
+struct Address *mutt_get_address(struct Envelope *env, const char **pfxp);
 
 bool mutt_addr_is_user(struct Address *addr);
 int mutt_alias_complete(char *buf, size_t buflen);
index 6331bb3a2b682a70a780e263890e89507572e45d..5e2b5a0d3327769f2aad6caed5eb5da597db070c 100644 (file)
@@ -443,7 +443,7 @@ static void pipe_msg(struct Header *h, FILE *fp, bool decode, bool print)
  * The following code is shared between printing and piping.
  */
 static int pipe_message(struct Header *h, char *cmd, bool decode, bool print,
-                        bool split, char *sep)
+                        bool split, const char *sep)
 {
   int rc = 0;
   pid_t thepid;
@@ -755,7 +755,7 @@ void mutt_enter_command(void)
  */
 void mutt_display_address(struct Envelope *env)
 {
-  char *pfx = NULL;
+  const char *pfx = NULL;
   char buf[SHORT_STRING];
 
   struct Address *addr = mutt_get_address(env, &pfx);
index 5322b7ed8ea232a947a7bed1bdd38f01d340c9fe..fc04179a999aff7df6da71531e6f06fe0706aba1 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -1085,7 +1085,8 @@ int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen,
         if ((mutt_str_strcmp("builtin", Editor) != 0) &&
             (op == OP_COMPOSE_EDIT_HEADERS || (op == OP_COMPOSE_EDIT_MESSAGE && EditHeaders)))
         {
-          char *tag = NULL, *err = NULL;
+          const char *tag = NULL;
+          char *err = NULL;
           mutt_env_to_local(msg->env);
           mutt_edit_headers(NONULL(Editor), msg->content->filename, msg, fcc, fcclen);
           if (mutt_env_to_intl(msg->env, &tag, &err))
index 131afe25a567809c0f0ba7e5137ae991487338c4..6fe908e645ca3d5c3db899a8a2d04df1fb6301cd 100644 (file)
@@ -633,9 +633,9 @@ void mutt_unget_event(int ch, int op)
  *
  * This puts events into the `UngetKeyEvents` buffer
  */
-void mutt_unget_string(char *s)
+void mutt_unget_string(const char *s)
 {
-  char *p = s + mutt_str_strlen(s) - 1;
+  const char *p = s + mutt_str_strlen(s) - 1;
 
   while (p >= s)
   {
@@ -738,7 +738,7 @@ void mutt_curs_set(int cursor)
  * @retval >=0 0-based user selection
  * @retval  -1 Selection aborted
  */
-int mutt_multi_choice(char *prompt, char *letters)
+int mutt_multi_choice(const char *prompt, const char *letters)
 {
   struct Event ch;
   int choice;
index bff73ff56f1087c6d80e739b12fdb8846fb32bb7..1e3e4ab856b7d3db4f528dda72255c6d5ce80e46 100644 (file)
@@ -56,7 +56,7 @@ void         mutt_format_s_tree(char *buf, size_t buflen, const char *prec, cons
 struct Event mutt_getch(void);
 int          mutt_get_field_full(const char *field, char *buf, size_t buflen, int complete, bool multiple, char ***files, int *numfiles);
 int          mutt_get_field_unbuffered(char *msg, char *buf, size_t buflen, int flags);
-int          mutt_multi_choice(char *prompt, char *letters);
+int          mutt_multi_choice(const char *prompt, const char *letters);
 void         mutt_need_hard_redraw(void);
 void         mutt_paddstr(int n, const char *s);
 void         mutt_perror_debug(const char *s);
@@ -67,7 +67,7 @@ void         mutt_show_error(void);
 void         mutt_simple_format(char *buf, size_t buflen, int min_width, int max_width, int justify, char pad_char, const char *s, size_t n, int arboreal);
 int          mutt_strwidth(const char *s);
 void         mutt_unget_event(int ch, int op);
-void         mutt_unget_string(char *s);
+void         mutt_unget_string(const char *s);
 size_t       mutt_wstr_trunc(const char *src, size_t maxlen, size_t maxwid, size_t *width);
 int          mutt_yesorno(const char *msg, int def);
 
diff --git a/edit.c b/edit.c
index bb06bd21b38bbf68721e1b3e24866f2feb66847c..f755456effc9fa808abd3fe594f940df04b1ecb0 100644 (file)
--- a/edit.c
+++ b/edit.c
@@ -508,7 +508,8 @@ int mutt_builtin_editor(const char *path, struct Header *msg, struct Header *cur
         case 'v':
           if (be_barf_file(path, buf, buflen) == 0)
           {
-            char *tag = NULL, *err = NULL;
+            const char *tag = NULL;
+            char *err = NULL;
             be_free_memory(buf, buflen);
             buf = NULL;
             bufmax = 0;
index 4720bad27853e31da9e45b22f08d2a038b870f80..3667abbec41ed597160d2b4163e3ee1c30af08f3 100644 (file)
@@ -231,7 +231,7 @@ void mutt_env_to_local(struct Envelope *e)
  *
  * Run mutt_addrlist_to_intl() on each of the Address fields in the Envelope.
  */
-int mutt_env_to_intl(struct Envelope *env, char **tag, char **err)
+int mutt_env_to_intl(struct Envelope *env, const char **tag, char **err)
 {
   int e = 0;
   H_TO_INTL(return_path);
index d2c61457082cc7189d8c1e974774681bbe167c36..2940f5d49e941423c21bcd980a08a8318d4b8eb8 100644 (file)
@@ -68,7 +68,7 @@ bool             mutt_env_cmp_strict(const struct Envelope *e1, const struct Env
 void             mutt_env_free(struct Envelope **p);
 void             mutt_env_merge(struct Envelope *base, struct Envelope **extra);
 struct Envelope *mutt_env_new(void);
-int              mutt_env_to_intl(struct Envelope *env, char **tag, char **err);
+int              mutt_env_to_intl(struct Envelope *env, const char **tag, char **err);
 void             mutt_env_to_local(struct Envelope *e);
 
 #endif /* _EMAIL_ENVELOPE_H */
index e47228f578164e652b1393eb3f0992d91742c456..1f01dd9a75b3389128b8bafa45c2f38c1bac3c80 100644 (file)
@@ -1219,7 +1219,7 @@ bool mutt_is_message_type(int type, const char *subtype)
  */
 void mutt_parse_part(FILE *fp, struct Body *b)
 {
-  char *bound = NULL;
+  const char *bound = NULL;
 
   switch (b->type)
   {
index f3e7966a9e5c8f8bfc6a840eac82c02da9405091..2fc714e62f018f257c6031cd69bb92f3766766a0 100644 (file)
@@ -435,7 +435,7 @@ static int encode(const char *d, size_t dlen, int col, const char *fromcode,
   encoder_t encoder = NULL;
   char *tocode1 = NULL;
   const char *tocode = NULL;
-  char *icode = "utf-8";
+  const char *icode = "utf-8";
 
   /* Try to convert to UTF-8. */
   char *u = mutt_str_substr_dup(d, d + dlen);
index ad39624644162e69e5039974519bca701888e46a..11fc137182b47dca81ac09300d2d1586b5a03a3e 100644 (file)
--- a/hdrline.c
+++ b/hdrline.c
@@ -225,7 +225,7 @@ enum FieldType
  * If the index is invalid, then a space character will be returned.
  * If the character selected is '\n' (Ctrl-M), then "" will be returned.
  */
-static char *get_nth_wchar(struct MbTable *table, int index)
+static const char *get_nth_wchar(struct MbTable *table, int index)
 {
   if (!table || !table->chars || (index < 0) || (index >= table->len))
     return " ";
@@ -258,7 +258,7 @@ static const char *make_from_prefix(enum FieldType disp)
   if (!FromChars || !FromChars->chars || (FromChars->len == 0))
     return long_prefixes[disp];
 
-  char *pchar = get_nth_wchar(FromChars, disp);
+  const char *pchar = get_nth_wchar(FromChars, disp);
   if (mutt_str_strlen(pchar) == 0)
     return "";
 
@@ -524,7 +524,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
 {
   struct HdrFormatInfo *hfi = (struct HdrFormatInfo *) data;
   char fmt[SHORT_STRING], tmp[LONG_STRING], *p, *tags = NULL;
-  char *wch = NULL;
+  const char *wch = NULL;
   int i;
   int optional = (flags & MUTT_FORMAT_OPTIONAL);
   int threads = ((Sort & SORT_MASK) == SORT_THREADS);
@@ -1270,7 +1270,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
     case 'z':
       if (src[0] == 's') /* status: deleted/new/old/replied */
       {
-        char *ch = NULL;
+        const char *ch = NULL;
         if (hdr->deleted)
           ch = get_nth_wchar(FlagChars, FlagCharDeleted);
         else if (hdr->attach_del)
@@ -1299,7 +1299,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
       }
       else if (src[0] == 'c') /* crypto */
       {
-        char *ch = NULL;
+        const char *ch = NULL;
         if ((WithCrypto != 0) && (hdr->security & GOODSIGN))
           ch = "S";
         else if ((WithCrypto != 0) && (hdr->security & ENCRYPT))
@@ -1319,7 +1319,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
       }
       else if (src[0] == 't') /* tagged, flagged, recipient */
       {
-        char *ch = NULL;
+        const char *ch = NULL;
         if (hdr->tagged)
           ch = get_nth_wchar(FlagChars, FlagCharTagged);
         else if (hdr->flagged)
@@ -1341,7 +1341,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
     case 'Z':
     {
       /* New/Old for threads; replied; New/Old for messages */
-      char *first = NULL;
+      const char *first = NULL;
       if (threads && thread_is_new(ctx, hdr))
         first = get_nth_wchar(FlagChars, FlagCharNewThread);
       else if (threads && thread_is_old(ctx, hdr))
@@ -1362,7 +1362,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
       }
 
       /* Marked for deletion; deleted attachments; crypto */
-      char *second = NULL;
+      const char *second = NULL;
       if (hdr->deleted)
         second = get_nth_wchar(FlagChars, FlagCharDeleted);
       else if (hdr->attach_del)
@@ -1379,7 +1379,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
         second = " ";
 
       /* Tagged, flagged and recipient flag */
-      char *third = NULL;
+      const char *third = NULL;
       if (hdr->tagged)
         third = get_nth_wchar(FlagChars, FlagCharTagged);
       else if (hdr->flagged)
diff --git a/init.c b/init.c
index 0489f05fc53ab9477d5d3fe019f166ebe16db9a7..097aae2a1eda81629aacd140a16ac589eb205c77 100644 (file)
--- a/init.c
+++ b/init.c
@@ -698,7 +698,7 @@ static int parse_unreplace_list(struct Buffer *buf, struct Buffer *s,
  * @param name Attached/Inline, 'A', 'I'
  * @retval 0 Always
  */
-static int print_attach_list(struct ListHead *h, char op, char *name)
+static int print_attach_list(struct ListHead *h, const char op, const char *name)
 {
   struct ListNode *np = NULL;
   STAILQ_FOREACH(np, h, entries)
index 6f686503952dcc4c305c0f2346fda1528139a20a..8fbde0496fbe1f0e88578a3815fb2566e25a303f 100644 (file)
--- a/keymap.c
+++ b/keymap.c
@@ -275,7 +275,7 @@ static size_t parsekeys(const char *str, keycode_t *d, size_t max)
  * Insert a key sequence into the specified map.
  * The map is sorted by ASCII value (lowest to highest)
  */
-static int km_bind_err(char *s, int menu, int op, char *macro, char *desc, struct Buffer *err)
+static int km_bind_err(const char *s, int menu, int op, char *macro, char *desc, struct Buffer *err)
 {
   int retval = 0;
   struct Keymap *last = NULL, *next = NULL;
@@ -394,7 +394,7 @@ int km_bind(char *s, int menu, int op, char *macro, char *desc)
  * @retval  0 Success
  * @retval -2 Error
  */
-static int km_bindkey_err(char *s, int menu, int op, struct Buffer *err)
+static int km_bindkey_err(const char *s, int menu, int op, struct Buffer *err)
 {
   return km_bind_err(s, menu, op, NULL, NULL, err);
 }
@@ -407,7 +407,7 @@ static int km_bindkey_err(char *s, int menu, int op, struct Buffer *err)
  * @retval  0 Success
  * @retval -2 Error
  */
-static int km_bindkey(char *s, int menu, int op)
+static int km_bindkey(const char *s, int menu, int op)
 {
   return km_bindkey_err(s, menu, op, NULL);
 }
@@ -442,7 +442,7 @@ static int get_op(const struct Binding *bindings, const char *start, size_t len)
  *
  * @note This returns a static string.
  */
-static char *get_func(const struct Binding *bindings, int op)
+static const char *get_func(const struct Binding *bindings, int op)
 {
   for (int i = 0; bindings[i].name; i++)
   {
@@ -616,7 +616,7 @@ int km_dokey(int menu)
     /* do we have an op already? */
     if (tmp.op)
     {
-      char *func = NULL;
+      const char *func = NULL;
       const struct Binding *bindings = NULL;
 
       /* is this a valid op for this menu? */
index 06285517e757114ed84bcede7de395f420a31905..6036b2af48cd0e43b9803b80ee4f1878331b7ab0 100644 (file)
--- a/keymap.h
+++ b/keymap.h
@@ -103,9 +103,9 @@ extern const struct Mapping Menus[];
  */
 struct Binding
 {
-  char *name; /**< name of the function */
-  int op;     /**< function id number */
-  char *seq;  /**< default key binding */
+  const char *name; /**< name of the function */
+  int op;           /**< function id number */
+  const char *seq;  /**< default key binding */
 };
 
 const struct Binding *km_get_table(int menu);
diff --git a/main.c b/main.c
index 78fbe51bea352fa347d9cbe7a5cff1952caff3d6..cdd2e150f38d097cbf1beacf853969a6d24b8b3d 100644 (file)
--- a/main.c
+++ b/main.c
@@ -99,7 +99,7 @@ bool ResumeEditedDraftFiles; ///< Config: Resume editing previously saved draft
  */
 static void test_parse_set(void)
 {
-  char *vars[] = {
+  const char *vars[] = {
     "from",        // ADDRESS
     "beep",        // BOOL
     "ispell",      // COMMAND
@@ -115,14 +115,14 @@ static void test_parse_set(void)
     "my_var",      // MY_VAR
   };
 
-  char *commands[] = {
+  const char *commands[] = {
     "set",
     "toggle",
     "reset",
     "unset",
   };
 
-  char *tests[] = {
+  const char *tests[] = {
     "%s %s",       "%s %s=42",  "%s %s?",     "%s ?%s",    "%s ?%s=42",
     "%s ?%s?",     "%s no%s",   "%s no%s=42", "%s no%s?",  "%s inv%s",
     "%s inv%s=42", "%s inv%s?", "%s &%s",     "%s &%s=42", "%s &%s?",
diff --git a/mutt.h b/mutt.h
index a740cd857fc07a1b84ad59c59cb7dae4ad60cad0..5acc5beba45170efb5977cafb78fbb15079b007b 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -205,9 +205,9 @@ struct ConfigSet *init_config(size_t size);
  */
 struct AttachMatch
 {
-  char *major;
+  const char *major;
   int major_int;
-  char *minor;
+  const char *minor;
   regex_t minor_regex;
 };
 
index ce5525424127296dbc0cacbee5ccf66307b233b0..b47bb8abf369bfc4a8c7af9f2e1edeef741fafc4 100644 (file)
@@ -86,7 +86,7 @@ void mutt_buffer_reset(struct Buffer *b)
  * @param seed String to put in the Buffer
  * @retval ptr New Buffer
  */
-struct Buffer *mutt_buffer_from(char *seed)
+struct Buffer *mutt_buffer_from(const char *seed)
 {
   struct Buffer *b = NULL;
 
index f271a56072eb19676cfb9b59926abc685a904896..e4b8ac9c6dc9b99ea6ebe1231d920aca13ea02c6 100644 (file)
@@ -45,7 +45,7 @@ size_t         mutt_buffer_addch(struct Buffer *buf, char c);
 size_t         mutt_buffer_addstr(struct Buffer *buf, const char *s);
 struct Buffer *mutt_buffer_alloc(size_t size);
 void           mutt_buffer_free(struct Buffer **p);
-struct Buffer *mutt_buffer_from(char *seed);
+struct Buffer *mutt_buffer_from(const char *seed);
 struct Buffer *mutt_buffer_init(struct Buffer *b);
 bool           mutt_buffer_is_empty(const struct Buffer *buf);
 struct Buffer *mutt_buffer_new(void);
index 3a240300ae2c1b798d603f49769696d48ec46a9a..06a527167dfdfbc7f659618609ed2fb78381b45f 100644 (file)
@@ -733,7 +733,7 @@ int mutt_ch_convert_string(char **ps, const char *from, const char *to, int flag
   char *buf = NULL, *ob = NULL;
   size_t ibl, obl;
   const char **inrepls = NULL;
-  char *outrepl = NULL;
+  const char *outrepl = NULL;
 
   if (mutt_ch_is_utf8(to))
     outrepl = "\357\277\275";
index a29bd9faccd109611b70cef4b9e249a894b22ab5..5b63b3c99a706615b10d5008eb202d624086997c 100644 (file)
@@ -42,7 +42,7 @@ typedef int (*command_t)(struct Buffer *buf, struct Buffer *s, unsigned long dat
  */
 struct Command
 {
-  char *name;         /**< Name of the command */
+  const char *name;   /**< Name of the command */
   command_t func;     /**< Function to parse the command */
   unsigned long data; /**< Data or flags to pass to the command */
 };
index c9ccfdc76a9cbb07cfae8310951df5dc0bc26bdc..045308daae39a2352fa44693c093cac2c751546c 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -138,7 +138,7 @@ char *mutt_expand_path_regex(char *buf, size_t buflen, bool regex)
   char tmp[PATH_MAX];
   char *t = NULL;
 
-  char *tail = "";
+  const char *tail = "";
 
   bool recurse = false;
 
index 73014ec141e348e54efea70891fdeb9861ea3b54..dcc74ff65fe27b80001e75d7b98e4cc0dfe7bbb2 100644 (file)
@@ -75,7 +75,7 @@ bool SmimeSelfEncrypt; ///< Config: Encrypted messages will also be encrypt to S
  *
  * print the current time to avoid spoofing of the signature output
  */
-void crypt_current_time(struct State *s, char *app_name)
+void crypt_current_time(struct State *s, const char *app_name)
 {
   time_t t;
   char p[STRING], tmp[STRING];
index a372c3f3ae11fabbf1383a820af5482bab5b744e..dda2f15e05bc822cc309fc63af6b07b70b8dd481 100644 (file)
@@ -29,7 +29,7 @@ struct Body;
 struct State;
 
 void        crypt_convert_to_7bit(struct Body *a);
-void        crypt_current_time(struct State *s, char *app_name);
+void        crypt_current_time(struct State *s, const char *app_name);
 const char *crypt_get_fingerprint_or_id(char *p, const char **pphint, const char **ppl, const char **pps);
 bool        crypt_is_numerical_keyid(const char *s);
 int         crypt_write_signed(struct Body *a, struct State *s, const char *tempfile);
index a4246b29fde893acc75edff33be921a243dca10a..d4d97f0eb5eada6aabf672da03814a60876a8cdb 100644 (file)
@@ -5036,7 +5036,9 @@ void smime_gpgme_init(void)
 static int gpgme_send_menu(struct Header *msg, int is_smime)
 {
   struct CryptKeyInfo *p = NULL;
-  char *prompt = NULL, *letters = NULL, *choices = NULL;
+  const char *prompt = NULL;
+  const char *letters = NULL;
+  const char *choices = NULL;
   int choice;
 
   if (is_smime)
index 9bf8dc9031a03e577ccd3cfb6965cea3bb71baf2..734054bb8de0960eddea1ac1183a2c9570f53923 100644 (file)
@@ -1811,7 +1811,9 @@ struct Body *pgp_class_traditional_encryptsign(struct Body *a, int flags, char *
 int pgp_class_send_menu(struct Header *msg)
 {
   struct PgpKeyInfo *p = NULL;
-  char *prompt = NULL, *letters = NULL, *choices = NULL;
+  const char *prompt = NULL;
+  const char *letters = NULL;
+  const char *choices = NULL;
   char promptbuf[LONG_STRING];
   int choice;
 
index 2c9c63c0e7191862bd66f2890eb08080e1b690e2..9b7ef19748dbb48f82cb59f5529ac1883ef99f59 100644 (file)
@@ -759,7 +759,7 @@ static struct PgpKeyInfo *pgp_select_key(struct PgpKeyInfo *keys,
         if (OptPgpCheckTrust && (!pgp_id_is_valid(KeyTable[menu->current]) ||
                                  !pgp_id_is_strong(KeyTable[menu->current])))
         {
-          char *str = "";
+          const char *str = "";
           char buf2[LONG_STRING];
 
           if (KeyTable[menu->current]->flags & KEYFLAG_CANTUSE)
index 028365005e18d834b5a438a328847ba2b2ea61a8..cb4b571265cf970e3c070f4b79b952d27fb0d7c2 100644 (file)
@@ -539,7 +539,7 @@ static struct SmimeKey *smime_select_key(struct SmimeKey *keys, char *query)
   char buf[LONG_STRING];
   char title[256];
   struct Menu *menu = NULL;
-  char *s = "";
+  const char *s = "";
   bool done = false;
 
   for (table_index = 0, key = keys; key; key = key->next)
@@ -2281,7 +2281,9 @@ int smime_class_application_handler(struct Body *m, struct State *s)
 int smime_class_send_menu(struct Header *msg)
 {
   struct SmimeKey *key = NULL;
-  char *prompt = NULL, *letters = NULL, *choices = NULL;
+  const char *prompt = NULL;
+  const char *letters = NULL;
+  const char *choices = NULL;
   int choice;
 
   if (!(WithCrypto & APPLICATION_SMIME))
index 4c3266fa2a42cc0ae619b58de28c75e3adb79593..e3ea7b72aacbbd2b25c2def543373c7a40ccb3b3 100644 (file)
@@ -540,7 +540,7 @@ int nntp_newsrc_update(struct NntpServer *nserv)
  * @param acct   Account
  * @param src    Path to add to the URL
  */
-static void cache_expand(char *dst, size_t dstlen, struct Account *acct, char *src)
+static void cache_expand(char *dst, size_t dstlen, struct Account *acct, const char *src)
 {
   char *c = NULL;
   char file[PATH_MAX];
@@ -551,7 +551,7 @@ static void cache_expand(char *dst, size_t dstlen, struct Account *acct, char *s
     struct Url url;
 
     mutt_account_tourl(acct, &url);
-    url.path = src;
+    url.path = mutt_str_strdup(src);
     url_tostring(&url, file, sizeof(file), U_PATH);
   }
   else
index a30e4168ee25d04a0b9d4699b6fd60650d2774a7..57773f40471f9edad2057b0e8bff46aa3ff5f333 100644 (file)
@@ -189,14 +189,14 @@ static int nntp_capabilities(struct NntpServer *nserv)
   return -1;
 }
 
-char *OverviewFmt = "Subject:\0"
-                    "From:\0"
-                    "Date:\0"
-                    "Message-ID:\0"
-                    "References:\0"
-                    "Content-Length:\0"
-                    "Lines:\0"
-                    "\0";
+const char *OverviewFmt = "Subject:\0"
+                          "From:\0"
+                          "Date:\0"
+                          "Message-ID:\0"
+                          "References:\0"
+                          "Content-Length:\0"
+                          "Lines:\0"
+                          "\0";
 
 /**
  * nntp_attempt_features - Detect supported commands
@@ -278,7 +278,7 @@ static int nntp_attempt_features(struct NntpServer *nserv)
       return nntp_connect_error(nserv);
     }
     if (mutt_str_strncmp("215", buf, 3) != 0)
-      nserv->overview_fmt = OverviewFmt;
+      nserv->overview_fmt = mutt_str_strdup(OverviewFmt);
     else
     {
       int cont = 0;
@@ -990,10 +990,10 @@ static int fetch_description(char *line, void *data)
  * @retval -1 Connection lost
  * @retval -2 Error
  */
-static int get_description(struct NntpData *nntp_data, char *wildmat, char *msg)
+static int get_description(struct NntpData *nntp_data, const char *wildmat, const char *msg)
 {
   char buf[STRING];
-  char *cmd = NULL;
+  const char *cmd = NULL;
 
   /* get newsgroup description, if possible */
   struct NntpServer *nserv = nntp_data->nserv;
index 7b4e96d87a86e23746ed2ea1a5029c720ab66d27..26510488f38718f3f8c644487082645e1ece92d7 100644 (file)
@@ -311,7 +311,7 @@ static enum NmQueryType string_to_query_type(const char *str)
  *
  * @note This is a static string and must not be freed.
  */
-static char *query_type_to_string(enum NmQueryType query_type)
+static const char *query_type_to_string(enum NmQueryType query_type)
 {
   if (query_type == NM_QUERY_TYPE_THREADS)
     return "threads";
index 445d35b99b00666aa06838d89b205158b60b6842..c4cc8f80394a240f93849b060e31946619cf57c3 100644 (file)
@@ -508,7 +508,7 @@ int pop_query_d(struct PopData *pop_data, char *buf, size_t buflen, char *msg)
  * This function calls  func(*line, *data)  for each received line,
  * func(NULL, *data)  if  rewind(*data)  needs, exits when fail or done.
  */
-int pop_fetch_data(struct PopData *pop_data, char *query, struct Progress *progressbar,
+int pop_fetch_data(struct PopData *pop_data, const char *query, struct Progress *progressbar,
                    int (*func)(char *, void *), void *data)
 {
   char buf[LONG_STRING];
index d054bdadfeb6352cf66232a750ceb2545268b69f..ed3c44b431fec2e82cf1d8f1c4c60c282c425fbf 100644 (file)
@@ -119,7 +119,7 @@ int pop_parse_path(const char *path, struct Account *acct);
 int pop_connect(struct PopData *pop_data);
 int pop_open_connection(struct PopData *pop_data);
 int pop_query_d(struct PopData *pop_data, char *buf, size_t buflen, char *msg);
-int pop_fetch_data(struct PopData *pop_data, char *query, struct Progress *progressbar,
+int pop_fetch_data(struct PopData *pop_data, const char *query, struct Progress *progressbar,
                    int (*func)(char *, void *), void *data);
 int pop_reconnect(struct Context *ctx);
 void pop_logout(struct Context *ctx);
diff --git a/send.c b/send.c
index e15da4744dff8dd159c8ccbd686704a965f547b2..70f5bcec1c52a1687c96d2ec000fbdd3494074d3 100644 (file)
--- a/send.c
+++ b/send.c
@@ -272,7 +272,7 @@ static struct Address *find_mailing_lists(struct Address *t, struct Address *c)
  * @retval  0 Success
  * @retval -1 Failure
  */
-static int edit_address(struct Address **a, /* const */ char *field)
+static int edit_address(struct Address **a, const char *field)
 {
   char buf[HUGE_STRING];
   char *err = NULL;
@@ -1554,7 +1554,8 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
   /* save current value of "pgp_sign_as"  and "smime_default_key" */
   char *pgp_signas = NULL;
   char *smime_signas = NULL;
-  char *tag = NULL, *err = NULL;
+  const char *tag = NULL;
+  char *err = NULL;
   char *ctype = NULL;
   char *finalpath = NULL;
 
index f592e26308a9fcc99d2c502b773e07748e06bb52..7df312eede5aa4cd8221439504996668907bba37 100644 (file)
@@ -43,8 +43,8 @@
 bool TsSupported; /**< Terminal Setting is supported */
 
 /* de facto standard escapes for tsl/fsl */
-static char *tsl = "\033]0;";
-static char *fsl = "\007";
+static const char *tsl = "\033]0;";
+static const char *fsl = "\007";
 
 /**
  * mutt_ts_capability - Check terminal capabilities
@@ -54,7 +54,7 @@ static char *fsl = "\007";
  */
 bool mutt_ts_capability(void)
 {
-  char *known[] = {
+  const char *known[] = {
     "color-xterm", "cygwin", "eterm",  "kterm", "nxterm",
     "putty",       "rxvt",   "screen", "xterm", NULL,
   };
@@ -85,7 +85,7 @@ bool mutt_ts_capability(void)
   /* Check term types that are known to support the standard escape without
    * necessarily asserting it in terminfo. */
   const char *term = mutt_str_getenv("TERM");
-  for (char **termp = known; termp; termp++)
+  for (const char **termp = known; termp; termp++)
   {
     if (term && *termp && (mutt_str_strncasecmp(term, *termp, strlen(*termp)) != 0))
       return true;
index 39d77bb4cafb6f3ef70e9c3ac48ec2ce755d9e20..acd1fd6de477b67a4a1b7e19635f9b8507f94ce8 100644 (file)
@@ -53,8 +53,8 @@ void test_addr_mbox_to_udomain(void)
 
   { /* integration */
     char buf[256] = { 0 };
-    char *per = "bobby bob";
-    char *mbx = "bob@bobsdomain";
+    char per[64] = "bobby bob";
+    char mbx[64] = "bob@bobsdomain";
 
     struct Address addr = {
       .personal = per,
@@ -73,8 +73,8 @@ void test_addr_mbox_to_udomain(void)
   }
 
   { /* integration */
-    char *per = "bobby bob";
-    char *mbx = "bob@bobsdomain";
+    char per[64] = "bobby bob";
+    char mbx[64] = "bob@bobsdomain";
 
     struct Address addr = {
       .personal = per,
index 51175e3838486e814240998853abf08c1603da68..e57d9734e0ce5b78381303ba93b69b628f1a00f2 100644 (file)
@@ -182,7 +182,7 @@ static bool test_string_set(struct ConfigSet *cs, struct Buffer *err)
   log_line(__func__);
 
   const char *valid[] = { "hello@example.com", "world@example.com", NULL };
-  char *name = "Damson";
+  const char *name = "Damson";
   char *addr = NULL;
 
   int rc;
@@ -280,7 +280,7 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
   log_line(__func__);
 
   struct Address *a = address_create("hello@example.com");
-  char *name = "Ilama";
+  const char *name = "Ilama";
   char *addr = NULL;
   bool result = false;
 
@@ -327,7 +327,7 @@ tbns_out:
 static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
-  char *name = "Kumquat";
+  const char *name = "Kumquat";
 
   if (!TEST_CHECK(cs_str_string_set(cs, name, "kumquat@example.com", err) != INT_MIN))
     return false;
@@ -353,7 +353,7 @@ static bool test_reset(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Lemon";
+  const char *name = "Lemon";
 
   mutt_buffer_reset(err);
 
@@ -423,7 +423,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err)
   struct Address *a = address_create("world@example.com");
   bool result = false;
 
-  char *name = "Nectarine";
+  const char *name = "Nectarine";
   mutt_buffer_reset(err);
   int rc = cs_str_string_set(cs, name, "hello@example.com", err);
   if (TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
index f3207bd97fc5653deb78a50f08d0f055f39bad58..ced8cdb9225ef1355b53ea63ad66c85fbf5ca66a 100644 (file)
@@ -172,7 +172,7 @@ static bool test_string_set(struct ConfigSet *cs, struct Buffer *err)
     "",
     NULL,
   };
-  char *name = "Damson";
+  const char *name = "Damson";
 
   int rc;
   for (unsigned int i = 0; i < mutt_array_size(valid); i++)
@@ -264,7 +264,7 @@ static bool test_string_get(struct ConfigSet *cs, struct Buffer *err)
 static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
-  char *name = "Fig";
+  const char *name = "Fig";
   bool value = true;
 
   TEST_MSG("Setting %s to %d\n", name, value);
@@ -327,7 +327,7 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
 static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
-  char *name = "Guava";
+  const char *name = "Guava";
 
   VarGuava = true;
   mutt_buffer_reset(err);
@@ -347,7 +347,7 @@ static bool test_reset(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Hawthorn";
+  const char *name = "Hawthorn";
   VarHawthorn = true;
   mutt_buffer_reset(err);
 
@@ -406,7 +406,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Jackfruit";
+  const char *name = "Jackfruit";
   VarJackfruit = false;
   mutt_buffer_reset(err);
   int rc = cs_str_string_set(cs, name, "yes", err);
@@ -595,7 +595,7 @@ static bool test_toggle(struct ConfigSet *cs, struct Buffer *err)
 
   struct ToggleTest tests[] = { { false, true }, { true, false } };
 
-  char *name = "Nectarine";
+  const char *name = "Nectarine";
   int rc;
 
   struct HashElem *he = cs_get_elem(cs, name);
index 45431c37de0b4d61f1475e3921c24ac060246b31..edf1ec0616da731e32bdea8d6073437fecae1de2 100644 (file)
@@ -181,7 +181,7 @@ static bool test_string_set(struct ConfigSet *cs, struct Buffer *err)
   log_line(__func__);
 
   const char *valid[] = { "hello", "world", "world", "", NULL };
-  char *name = "Damson";
+  const char *name = "Damson";
 
   int rc;
   for (unsigned int i = 0; i < mutt_array_size(valid); i++)
@@ -299,7 +299,7 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
   log_line(__func__);
 
   const char *valid[] = { "hello", "world", "world", "", NULL };
-  char *name = "Jackfruit";
+  const char *name = "Jackfruit";
 
   int rc;
   for (unsigned int i = 0; i < mutt_array_size(valid); i++)
@@ -373,7 +373,7 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
 static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
-  char *name = "Mango";
+  const char *name = "Mango";
 
   int rc = cs_str_string_set(cs, name, "mango", err);
   if (!TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
@@ -396,7 +396,7 @@ static bool test_reset(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Nectarine";
+  const char *name = "Nectarine";
   mutt_buffer_reset(err);
 
   TEST_MSG("Initial: %s = '%s'\n", name, VarNectarine);
@@ -465,7 +465,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Papaya";
+  const char *name = "Papaya";
   mutt_buffer_reset(err);
   int rc = cs_str_string_set(cs, name, "hello", err);
   if (TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
index 06126346e6efece74efca18d9b74d80919b7f5ec..8160058828cbc53efce8b4734e276c58631bd599 100644 (file)
@@ -167,7 +167,7 @@ static bool test_string_set(struct ConfigSet *cs, struct Buffer *err)
   int longs[] = { -123, 0, -42, 456 };
   const char *invalid[] = { "-9223372036854775809", "9223372036854775808", "junk", "", NULL };
 
-  char *name = "Damson";
+  const char *name = "Damson";
 
   int rc;
   for (unsigned int i = 0; i < mutt_array_size(valid); i++)
@@ -266,7 +266,7 @@ static bool test_string_get(struct ConfigSet *cs, struct Buffer *err)
 static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
-  char *name = "Guava";
+  const char *name = "Guava";
   long value = 12345;
 
   TEST_MSG("Setting %s to %d\n", name, value);
@@ -322,7 +322,7 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
 static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
-  char *name = "Ilama";
+  const char *name = "Ilama";
 
   VarIlama = 3456;
   mutt_buffer_reset(err);
@@ -342,7 +342,7 @@ static bool test_reset(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Jackfruit";
+  const char *name = "Jackfruit";
   VarJackfruit = 345;
   mutt_buffer_reset(err);
 
@@ -401,7 +401,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Lemon";
+  const char *name = "Lemon";
   VarLemon = 123;
   mutt_buffer_reset(err);
   int rc = cs_str_string_set(cs, name, "456", err);
index 0f5a45b192e3d6df7467e1f494180ed752a7b5df..7ed0cab3fa1832a8d60d054396b276fc628450d1 100644 (file)
@@ -162,7 +162,7 @@ static bool test_string_set(struct ConfigSet *cs, struct Buffer *err)
 
   const char *valid[] = { "mbox", "mmdf", "mh", "maildir" };
   const char *invalid[] = { "mbox2", "mm", "", NULL };
-  char *name = "Damson";
+  const char *name = "Damson";
 
   int rc;
   for (unsigned int i = 0; i < mutt_array_size(valid); i++)
@@ -255,7 +255,7 @@ static bool test_string_get(struct ConfigSet *cs, struct Buffer *err)
 static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
-  char *name = "Fig";
+  const char *name = "Fig";
   short value = MUTT_MAILDIR;
 
   VarFig = MUTT_MBOX;
@@ -312,7 +312,7 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
 static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
-  char *name = "Guava";
+  const char *name = "Guava";
 
   VarGuava = MUTT_MAILDIR;
   mutt_buffer_reset(err);
@@ -332,7 +332,7 @@ static bool test_reset(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Hawthorn";
+  const char *name = "Hawthorn";
   VarHawthorn = MUTT_MAILDIR;
   mutt_buffer_reset(err);
 
@@ -397,7 +397,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Jackfruit";
+  const char *name = "Jackfruit";
   VarJackfruit = MUTT_MBOX;
   mutt_buffer_reset(err);
   int rc = cs_str_string_set(cs, name, "maildir", err);
index e1bd84804ded19e17cddd21185ac9c5aaa2d4265..4da1c46cfdf910d7d6d9092ef40f869f7628ceaf 100644 (file)
@@ -177,7 +177,7 @@ static bool test_string_set(struct ConfigSet *cs, struct Buffer *err)
   log_line(__func__);
 
   const char *valid[] = { "hello", "world", "world", "", NULL };
-  char *name = "Damson";
+  const char *name = "Damson";
   char *mb = NULL;
 
   int rc;
@@ -295,7 +295,7 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
   log_line(__func__);
 
   struct MbTable *t = mbtable_parse("hello");
-  char *name = "Ilama";
+  const char *name = "Ilama";
   char *mb = NULL;
   bool result = false;
 
@@ -342,7 +342,7 @@ tns_out:
 static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
-  char *name = "Kumquat";
+  const char *name = "Kumquat";
 
   int rc = cs_str_string_set(cs, name, "kumquat", err);
   if (!TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
@@ -369,7 +369,7 @@ static bool test_reset(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Lemon";
+  const char *name = "Lemon";
 
   mutt_buffer_reset(err);
 
@@ -438,7 +438,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err)
   struct MbTable *t = mbtable_parse("world");
   bool result = false;
 
-  char *name = "Nectarine";
+  const char *name = "Nectarine";
   char *mb = NULL;
   mutt_buffer_reset(err);
   int rc = cs_str_string_set(cs, name, "hello", err);
index 42c3fa33fc096948c662319f11648dbbf501570c..536aa558928aa241331c7dc4fe5eff9365679eef 100644 (file)
@@ -166,7 +166,7 @@ static bool test_string_set(struct ConfigSet *cs, struct Buffer *err)
   const char *valid[] = { "-123", "0", "-42", "456" };
   int numbers[] = { -123, 0, -42, 456 };
   const char *invalid[] = { "-32769", "32768", "junk", "", NULL };
-  char *name = "Damson";
+  const char *name = "Damson";
 
   int rc;
   for (unsigned int i = 0; i < mutt_array_size(valid); i++)
@@ -265,7 +265,7 @@ static bool test_string_get(struct ConfigSet *cs, struct Buffer *err)
 static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
-  char *name = "Guava";
+  const char *name = "Guava";
   short value = 12345;
 
   TEST_MSG("Setting %s to %d\n", name, value);
@@ -341,7 +341,7 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
 static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
-  char *name = "Ilama";
+  const char *name = "Ilama";
 
   VarIlama = 3456;
   mutt_buffer_reset(err);
@@ -361,7 +361,7 @@ static bool test_reset(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Jackfruit";
+  const char *name = "Jackfruit";
   VarJackfruit = 345;
   mutt_buffer_reset(err);
 
@@ -420,7 +420,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Lemon";
+  const char *name = "Lemon";
   VarLemon = 123;
   mutt_buffer_reset(err);
   int rc = cs_str_string_set(cs, name, "456", err);
index 8c3313c29840dbbe6223272d7b34d8378cec65bd..25396f3650e04441dae87d64a5f46d756b0d11cd 100644 (file)
@@ -181,7 +181,7 @@ static bool test_string_set(struct ConfigSet *cs, struct Buffer *err)
   log_line(__func__);
 
   const char *valid[] = { "hello", "world", "world", "", NULL };
-  char *name = "Damson";
+  const char *name = "Damson";
 
   int rc;
   for (unsigned int i = 0; i < mutt_array_size(valid); i++)
@@ -299,7 +299,7 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
   log_line(__func__);
 
   const char *valid[] = { "hello", "world", "world", "", NULL };
-  char *name = "Jackfruit";
+  const char *name = "Jackfruit";
 
   int rc;
   for (unsigned int i = 0; i < mutt_array_size(valid); i++)
@@ -373,7 +373,7 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
 static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
-  char *name = "Mango";
+  const char *name = "Mango";
 
   int rc = cs_str_string_set(cs, name, "mango", err);
   if (!TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
@@ -396,7 +396,7 @@ static bool test_reset(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Nectarine";
+  const char *name = "Nectarine";
   mutt_buffer_reset(err);
 
   TEST_MSG("Initial: %s = '%s'\n", name, VarNectarine);
@@ -465,7 +465,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Papaya";
+  const char *name = "Papaya";
   mutt_buffer_reset(err);
   int rc = cs_str_string_set(cs, name, "hello", err);
   if (TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
index 51e74566e5b5f2ed5acb62c0c1bacfe471eaae60..4ef038268ddbb8a2049a5144469063370f227aeb 100644 (file)
@@ -170,7 +170,7 @@ static bool test_string_set(struct ConfigSet *cs, struct Buffer *err)
     "",
     NULL,
   };
-  char *name = "Damson";
+  const char *name = "Damson";
 
   int rc;
   for (unsigned int i = 0; i < mutt_array_size(valid); i++)
@@ -271,7 +271,7 @@ static bool test_string_get(struct ConfigSet *cs, struct Buffer *err)
 static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
-  char *name = "Fig";
+  const char *name = "Fig";
   char value = MUTT_YES;
 
   TEST_MSG("Setting %s to %d\n", name, value);
@@ -334,7 +334,7 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
 static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
-  char *name = "Guava";
+  const char *name = "Guava";
 
   VarGuava = MUTT_YES;
   mutt_buffer_reset(err);
@@ -354,7 +354,7 @@ static bool test_reset(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Hawthorn";
+  const char *name = "Hawthorn";
   VarHawthorn = MUTT_YES;
   mutt_buffer_reset(err);
 
@@ -413,7 +413,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Jackfruit";
+  const char *name = "Jackfruit";
   VarJackfruit = MUTT_NO;
   mutt_buffer_reset(err);
   int rc = cs_str_string_set(cs, name, "yes", err);
@@ -606,7 +606,7 @@ static bool test_toggle(struct ConfigSet *cs, struct Buffer *err)
     { MUTT_ASKYES, MUTT_ASKNO },
   };
 
-  char *name = "Nectarine";
+  const char *name = "Nectarine";
   int rc;
 
   struct HashElem *he = cs_get_elem(cs, name);
index a6cf4a54a6675efa6905f6c2ff538d66497e428f..6d247bc04bf0c88c8fe9c0aa6486225373b46e47 100644 (file)
@@ -181,7 +181,7 @@ static bool test_string_set(struct ConfigSet *cs, struct Buffer *err)
   log_line(__func__);
 
   const char *valid[] = { "hello.*", "world.*", "world.*", "", NULL };
-  char *name = "Damson";
+  const char *name = "Damson";
   char *regex = NULL;
 
   int rc;
@@ -303,7 +303,7 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
   log_line(__func__);
 
   struct Regex *r = regex_create("hello.*", 0, err);
-  char *name = "Ilama";
+  const char *name = "Ilama";
   char *regex = NULL;
   bool result = false;
 
@@ -383,7 +383,7 @@ tns_out:
 static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
-  char *name = "Lemon";
+  const char *name = "Lemon";
 
   int rc = cs_str_string_set(cs, name, "lemon.*", err);
   if (!TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
@@ -410,7 +410,7 @@ static bool test_reset(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Mango";
+  const char *name = "Mango";
 
   mutt_buffer_reset(err);
 
@@ -491,7 +491,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err)
   struct Regex *r = regex_create("world.*", 0, err);
   bool result = false;
 
-  char *name = "Papaya";
+  const char *name = "Papaya";
   mutt_buffer_reset(err);
   int rc = cs_str_string_set(cs, name, "hello.*", err);
   if (TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
index ea40e852ea1f682d321d4cd6c95a6847b4df638a..00f891c379150273067d0f8a2ce896c5a0465530 100644 (file)
@@ -80,7 +80,7 @@ static struct ConfigDef Vars2[] = {
 };
 // clang-format on
 
-char *name_list[] = {
+const char *name_list[] = {
   "Damson", "Elderberry", "Fig", "Guava", "Hawthorn", "Ilama",
 };
 
@@ -365,7 +365,7 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
     }
   }
 
-  char *name = "Kumquat";
+  const char *name = "Kumquat";
   short value = SORT_THREADS;
   VarKumquat = -1;
   mutt_buffer_reset(err);
@@ -438,7 +438,7 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
 static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
-  char *name = "Lemon";
+  const char *name = "Lemon";
 
   VarLemon = SORT_THREADS;
   mutt_buffer_reset(err);
@@ -458,7 +458,7 @@ static bool test_reset(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Mango";
+  const char *name = "Mango";
   VarMango = SORT_SUBJECT;
   mutt_buffer_reset(err);
 
@@ -522,7 +522,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Olive";
+  const char *name = "Olive";
   VarOlive = SORT_SUBJECT;
   mutt_buffer_reset(err);
   int rc = cs_str_string_set(cs, name, "threads", err);
@@ -692,7 +692,7 @@ static bool test_sort_type(struct ConfigSet *cs, struct Buffer *err)
   log_line(__func__);
 
   const char *name = "Raspberry";
-  char *value = "alpha";
+  const char *value = "alpha";
 
   mutt_buffer_reset(err);
   TEST_MSG("Expect error for next test\n");
index 98a6512ffeef26a3d628068be1b9d5101e3f89ef..fa22eb49dce412291133e14f26382d01fde9339e 100644 (file)
@@ -181,7 +181,7 @@ static bool test_string_set(struct ConfigSet *cs, struct Buffer *err)
   log_line(__func__);
 
   const char *valid[] = { "hello", "world", "world", "", NULL };
-  char *name = "Damson";
+  const char *name = "Damson";
 
   int rc;
   for (unsigned int i = 0; i < mutt_array_size(valid); i++)
@@ -299,7 +299,7 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
   log_line(__func__);
 
   const char *valid[] = { "hello", "world", "world", "", NULL };
-  char *name = "Jackfruit";
+  const char *name = "Jackfruit";
 
   int rc;
   for (unsigned int i = 0; i < mutt_array_size(valid); i++)
@@ -373,7 +373,7 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
 static bool test_native_get(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
-  char *name = "Mango";
+  const char *name = "Mango";
 
   int rc = cs_str_string_set(cs, name, "mango", err);
   if (!TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
@@ -396,7 +396,7 @@ static bool test_reset(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Nectarine";
+  const char *name = "Nectarine";
   mutt_buffer_reset(err);
 
   TEST_MSG("Initial: %s = '%s'\n", name, VarNectarine);
@@ -465,7 +465,7 @@ static bool test_validator(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Papaya";
+  const char *name = "Papaya";
   mutt_buffer_reset(err);
   int rc = cs_str_string_set(cs, name, "hello", err);
   if (TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
index 8a7eb42f1566687dab7b8233eb154bb65400de88..7970405f777c122ce531aa7fdf64f2fafa918001 100644 (file)
@@ -103,8 +103,8 @@ static bool test_native_set(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Fig";
-  char *value = "tree";
+  const char *name = "Fig";
+  const char *value = "tree";
 
   mutt_buffer_reset(err);
   int rc = cs_str_native_set(cs, name, (intptr_t) value, err);
@@ -149,7 +149,7 @@ static bool test_reset(struct ConfigSet *cs, struct Buffer *err)
 {
   log_line(__func__);
 
-  char *name = "Jackfruit";
+  const char *name = "Jackfruit";
   mutt_buffer_reset(err);
 
   TEST_MSG("Initial: %s = '%s'\n", name, NONULL(VarIlama));