From 89340c3848e3028c50a8eee66ee40753ad0183ad Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 18 Feb 2022 15:45:47 +0100 Subject: [PATCH] [intl] const char * in get_cp_mime_name --- src/intl/charsets.c | 4 ++-- src/intl/charsets.h | 2 +- src/protocol/http/http.c | 2 +- src/terminal/terminal.c | 2 +- src/terminal/terminal.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/intl/charsets.c b/src/intl/charsets.c index 0388133b2..e8a256e14 100644 --- a/src/intl/charsets.c +++ b/src/intl/charsets.c @@ -1647,14 +1647,14 @@ get_cp_config_name(int cp_index) /* Get the codepage's name for sending to a library or server that * understands MIME charset names. This function irreversibly maps * the "System" codepage to the underlying charset. */ -char * +const char * get_cp_mime_name(int cp_index) { if (cp_index < 0) return "none"; cp_index &= ~SYSTEM_CHARSET_FLAG; if (!codepages[cp_index].aliases) return NULL; - return (char *)codepages[cp_index].aliases[0]; + return codepages[cp_index].aliases[0]; } int diff --git a/src/intl/charsets.h b/src/intl/charsets.h index 64aaf7fc0..a58904a9b 100644 --- a/src/intl/charsets.h +++ b/src/intl/charsets.h @@ -127,7 +127,7 @@ char *convert_string(struct conv_table *convert_table, int get_cp_index(const char *); const char *get_cp_name(int); const char *get_cp_config_name(int); -char *get_cp_mime_name(int); +const char *get_cp_mime_name(int); const uint16_t *get_cp_highhalf(const char *); int is_cp_utf8(int); diff --git a/src/protocol/http/http.c b/src/protocol/http/http.c index bb01cd291..c322eb285 100644 --- a/src/protocol/http/http.c +++ b/src/protocol/http/http.c @@ -261,7 +261,7 @@ static void init_accept_charset(void) { struct string ac; - char *cs; + const char *cs; int i; if (!init_string(&ac)) return; diff --git a/src/terminal/terminal.c b/src/terminal/terminal.c index 03a09b091..a69fc8070 100644 --- a/src/terminal/terminal.c +++ b/src/terminal/terminal.c @@ -392,7 +392,7 @@ exec_shell(struct terminal *term) void do_terminal_function(struct terminal *term, unsigned char code, - char *data) + const char *data) { int data_len = strlen(data); char *x_data = (char *)fmem_alloc(data_len + 1 /* code */ + 1 /* null char */); diff --git a/src/terminal/terminal.h b/src/terminal/terminal.h index 65c1be28a..912cea50d 100644 --- a/src/terminal/terminal.h +++ b/src/terminal/terminal.h @@ -236,7 +236,7 @@ void exec_on_terminal(struct terminal *, char *, const char *, term_exec_T); void exec_shell(struct terminal *term); int set_terminal_title(struct terminal *, char *); -void do_terminal_function(struct terminal *, unsigned char, char *); +void do_terminal_function(struct terminal *, unsigned char, const char *); int check_terminal_pipes(void); void close_terminal_pipes(void);