From: Pierre Habouzit Date: Thu, 17 May 2007 20:20:46 +0000 (+0200) Subject: fix warnings. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=785bb3cb4dd83ec1071998a64af74e333d076347;p=apps%2Fmadmutt.git fix warnings. Signed-off-by: Pierre Habouzit --- diff --git a/compose.c b/compose.c index 72e6737..c16d5be 100644 --- a/compose.c +++ b/compose.c @@ -688,7 +688,8 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ case OP_COMPOSE_ATTACH_FILE: { - char *prompt, **files; + const char *prompt; + char **files; int error, numfiles; fname[0] = 0; @@ -739,7 +740,7 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ case OP_COMPOSE_ATTACH_NEWS_MESSAGE: #endif { - char *prompt; + const char *prompt; HEADER *h; fname[0] = 0; diff --git a/help.c b/help.c index d5182ca..bce7b3d 100644 --- a/help.c +++ b/help.c @@ -39,7 +39,7 @@ static struct binding_t *help_lookupFunction (int op, int menu) return (NULL); } -void mutt_make_help (char *d, ssize_t dlen, char *txt, int menu, int op) +void mutt_make_help (char *d, ssize_t dlen, const char *txt, int menu, int op) { char buf[STRING]; diff --git a/lib-ui/curs_lib.c b/lib-ui/curs_lib.c index 71be011..aa029ed 100644 --- a/lib-ui/curs_lib.c +++ b/lib-ui/curs_lib.c @@ -152,8 +152,8 @@ void mutt_edit_file(const char *data) int mutt_yesorno (const char *msg, int def) { event_t ch; - char *yes = _("yes"); - char *no = _("no"); + const char *yes = _("yes"); + const char *no = _("no"); char *answer_string; ssize_t answer_string_len; char *expr; @@ -460,7 +460,7 @@ void mutt_curs_set (int cursor) } #endif -int mutt_multi_choice (char *prompt, char *letters) +int mutt_multi_choice (const char *prompt, const char *letters) { event_t ch; int choice; diff --git a/lib-ui/curs_main.c b/lib-ui/curs_main.c index 82eb7e4..799d08b 100644 --- a/lib-ui/curs_main.c +++ b/lib-ui/curs_main.c @@ -393,10 +393,10 @@ int mutt_index_menu (void) int oldcount = -1; int rc = -1; MUTTMENU *menu; - char *cp; /* temporary variable. */ + const char *cp; /* temporary variable. */ int index_hint; /* used to restore cursor position */ int do_buffy_notify = 1; - int closed = 0; /* did we OP_QUIT or OP_EXIT out of this menu? */ + int closed = 0; /* did we OP_QUIT or OP_EXIT out of this menu? */ int attach_msg = option (OPTATTACHMSG); menu = mutt_new_menu (); diff --git a/lib-ui/curses.h b/lib-ui/curses.h index e0612fe..3537d71 100644 --- a/lib-ui/curses.h +++ b/lib-ui/curses.h @@ -179,7 +179,7 @@ int mutt_get_field_unbuffered (char *, char *, ssize_t, int); int mutt_index_menu (void); int mutt_is_mail_list (address_t *); int mutt_is_subscribed_list (address_t *); -int mutt_multi_choice (char *prompt, char *letters); +int mutt_multi_choice (const char *prompt, const char *letters); int mutt_parse_color (BUFFER *, BUFFER *, unsigned long, BUFFER *); int mutt_parse_uncolor (BUFFER *, BUFFER *, unsigned long, BUFFER *); int mutt_parse_mono (BUFFER *, BUFFER *, unsigned long, BUFFER *); diff --git a/lib-ui/menu.h b/lib-ui/menu.h index 7c27264..0b8c68c 100644 --- a/lib-ui/menu.h +++ b/lib-ui/menu.h @@ -29,8 +29,8 @@ #define M_MODEFMT "-- Madmutt: %s" typedef struct menu_t { - char *title; /* the title of this menu */ - char *help; /* quickref for the current menu */ + const char *title; /* the title of this menu */ + const char *help; /* quickref for the current menu */ void *data; /* extra data for the current menu */ int current; /* current entry */ int max; /* the number of entries in the menu */ @@ -46,8 +46,8 @@ typedef struct menu_t { * prompt keys override movement keys. */ char **dialog; /* dialog lines themselves */ - char *prompt; /* prompt for user, similar to mutt_multi_choice */ - char *keys; /* keys used in the prompt */ + const char *prompt; /* prompt for user, similar to mutt_multi_choice */ + const char *keys; /* keys used in the prompt */ /* callback to generate an index line for the requested element */ void (*make_entry) (char *, ssize_t, struct menu_t *, int); diff --git a/nntp/nntp.c b/nntp/nntp.c index bd1fcf0..69dcf0d 100644 --- a/nntp/nntp.c +++ b/nntp/nntp.c @@ -660,8 +660,8 @@ static int nntp_fetch_headers (CONTEXT * ctx, unsigned int first, unsigned int last) { char buf[HUGE_STRING]; - char *msg = _("Fetching message headers..."); - char *msg2 = _("Fetching headers from cache..."); + const char *msg = _("Fetching message headers..."); + const char *msg2 = _("Fetching headers from cache..."); NNTP_DATA *nntp_data = ((NNTP_DATA *) ctx->data); int ret; int num; diff --git a/pattern.c b/pattern.c index 6bcda21..9839aa7 100644 --- a/pattern.c +++ b/pattern.c @@ -1114,7 +1114,7 @@ void mutt_check_simple (char *s, ssize_t len, const char *simple) } } -int mutt_pattern_func (int op, char *prompt) +int mutt_pattern_func (int op, const char *prompt) { pattern_t *pat; char buf[LONG_STRING] = "", *simple, error[STRING]; diff --git a/pattern.h b/pattern.h index db9e6b3..eabfa64 100644 --- a/pattern.h +++ b/pattern.h @@ -54,7 +54,7 @@ DO_DELETE(pattern_t, pattern); DO_SLIST(pattern_t, pattern, pattern_delete); -int mutt_pattern_func (int, char *); +int mutt_pattern_func (int, const char *); int mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, CONTEXT * ctx, HEADER * h); pattern_t *mutt_pattern_comp(const char *s, int flags, BUFFER * err); diff --git a/pop.c b/pop.c index 512dfda..b0415aa 100644 --- a/pop.c +++ b/pop.c @@ -590,7 +590,7 @@ static pop_query_status pop_capabilities(pop_data_t * pop_data, int mode) /* Check capabilities */ if (mode == 2) { - char *msg = NULL; + const char *msg = NULL; if (!pop_data->expire) msg = _("Unable to leave messages on server."); diff --git a/protos.h b/protos.h index bbbc684..3cc4cad 100644 --- a/protos.h +++ b/protos.h @@ -67,7 +67,7 @@ void mutt_help (int); void mutt_draw_tree (CONTEXT *); void mutt_make_attribution (CONTEXT * ctx, HEADER * cur, FILE * out); void mutt_make_forward_subject (ENVELOPE * env, CONTEXT * ctx, HEADER * cur); -void mutt_make_help (char *, ssize_t, char *, int, int); +void mutt_make_help (char *, ssize_t, const char *, int, int); char *mutt_compile_help(char *, ssize_t, int, struct mapping_t *); void mutt_make_misc_reply_headers (ENVELOPE * env, CONTEXT * ctx, HEADER * cur, ENVELOPE * curenv); diff --git a/recvattach.c b/recvattach.c index 3339226..ccbcf1a 100644 --- a/recvattach.c +++ b/recvattach.c @@ -333,7 +333,7 @@ int mutt_tag_attach (MUTTMENU * menu, int n, int m) static int mutt_query_save_attachment (FILE * fp, BODY * body, HEADER * hdr, char **directory) { - char *prompt; + const char *prompt; char buf[_POSIX_PATH_MAX], tfile[_POSIX_PATH_MAX]; int is_message; int append = 0;