Skip to content

Commit

Permalink
triv: add const to some function prototypes
Browse files Browse the repository at this point in the history
  • Loading branch information
flatcap committed Dec 10, 2021
1 parent 6510d56 commit 51bc5d8
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion alias/alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ struct AliasList Aliases = TAILQ_HEAD_INITIALIZER(Aliases); ///< List of all the
* $ wants to be quoted since it may indicate the start of an environment
* variable.
*/
static void write_safe_address(FILE *fp, char *s)
static void write_safe_address(FILE *fp, const char *s)
{
while (*s)
{
Expand Down
2 changes: 1 addition & 1 deletion alias/dlgquery.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ int query_window_observer(struct NotifyCallback *nc)
* @param query Initial query string
* @retval ptr New Dialog
*/
struct MuttWindow *query_dialog_new(struct AliasMenuData *mdata, char *query)
static struct MuttWindow *query_dialog_new(struct AliasMenuData *mdata, const char *query)
{
struct MuttWindow *dlg = simple_dialog_new(MENU_QUERY, WT_DLG_QUERY, QueryHelp);
struct MuttWindow *sbar = window_find_child(dlg, WT_STATUS_BAR);
Expand Down
2 changes: 1 addition & 1 deletion compmbox/compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ static int comp_tags_edit(struct Mailbox *m, const char *tags, char *buf, size_t
/**
* comp_tags_commit - Save the tags to a message - Implements MxOps::tags_commit() - @ingroup mx_tags_commit
*/
static int comp_tags_commit(struct Mailbox *m, struct Email *e, char *buf)
static int comp_tags_commit(struct Mailbox *m, struct Email *e, const char *buf)
{
if (!m->compress_info)
return 0;
Expand Down
2 changes: 1 addition & 1 deletion core/mxapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ struct MxOps
* - @a e is not NULL
* - @a buf is not NULL
*/
int (*tags_commit) (struct Mailbox *m, struct Email *e, char *buf);
int (*tags_commit) (struct Mailbox *m, struct Email *e, const char *buf);

/**
* @defgroup mx_path_probe path_probe()
Expand Down
2 changes: 1 addition & 1 deletion email/tags.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ char *driver_tags_get_transformed_for(struct TagList *head, const char *name)
*
* Free current tags structures and replace it by new tags
*/
bool driver_tags_replace(struct TagList *head, char *tags)
bool driver_tags_replace(struct TagList *head, const char *tags)
{
if (!head)
return false;
Expand Down
2 changes: 1 addition & 1 deletion email/tags.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ char *driver_tags_get (struct TagList *list);
char *driver_tags_get_transformed (struct TagList *list);
char *driver_tags_get_transformed_for(struct TagList *list, const char *name);
char *driver_tags_get_with_hidden (struct TagList *list);
bool driver_tags_replace (struct TagList *list, char *tags);
bool driver_tags_replace (struct TagList *list, const char *tags);
void driver_tags_add (struct TagList *list, char *tag);

#endif /* MUTT_EMAIL_TAGS_H */
2 changes: 1 addition & 1 deletion enter/enter.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static int my_addwch(struct MuttWindow *win, wchar_t wc)
* @param from Starting point for the replacement
* @param buf Replacement string
*/
static void replace_part(struct EnterState *state, size_t from, char *buf)
static void replace_part(struct EnterState *state, size_t from, const char *buf)
{
/* Save the suffix */
size_t savelen = state->lastchar - state->curpos;
Expand Down
2 changes: 1 addition & 1 deletion icommands.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static const struct ICommand ICommandList[] = {
* - Error (no message): command not found
* - Error with message: command failed
*/
enum CommandResult mutt_parse_icommand(/* const */ char *line, struct Buffer *err)
enum CommandResult mutt_parse_icommand(const char *line, struct Buffer *err)
{
if (!line || (*line == '\0') || !err)
return MUTT_CMD_ERROR;
Expand Down
2 changes: 1 addition & 1 deletion icommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ struct ICommand
intptr_t data; ///< Private data to pass to the command
};

enum CommandResult mutt_parse_icommand(/* const */ char *line, struct Buffer *err);
enum CommandResult mutt_parse_icommand(const char *line, struct Buffer *err);

#endif /* MUTT_ICOMMANDS_H */
4 changes: 2 additions & 2 deletions imap/imap.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ static int complete_hosts(char *buf, size_t buflen)
* @retval 0 Success
* @retval -1 Failure
*/
int imap_create_mailbox(struct ImapAccountData *adata, char *mailbox)
int imap_create_mailbox(struct ImapAccountData *adata, const char *mailbox)
{
char buf[2048], mbox[1024];

Expand Down Expand Up @@ -2334,7 +2334,7 @@ static int imap_tags_edit(struct Mailbox *m, const char *tags, char *buf, size_t
* Also this method check that each flags is support by the server
* first and remove unsupported one.
*/
static int imap_tags_commit(struct Mailbox *m, struct Email *e, char *buf)
static int imap_tags_commit(struct Mailbox *m, struct Email *e, const char *buf)
{
char uid[11];

Expand Down
2 changes: 1 addition & 1 deletion imap/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ struct SeqsetIterator

/* -- private IMAP functions -- */
/* imap.c */
int imap_create_mailbox(struct ImapAccountData *adata, char *mailbox);
int imap_create_mailbox(struct ImapAccountData *adata, const char *mailbox);
int imap_rename_mailbox(struct ImapAccountData *adata, char *oldname, const char *newname);
int imap_exec_msgset(struct Mailbox *m, const char *pre, const char *post,
enum MessageType flag, bool changed, bool invert);
Expand Down
2 changes: 1 addition & 1 deletion mx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ int mx_tags_edit(struct Mailbox *m, const char *tags, char *buf, size_t buflen)
* @retval 0 Success
* @retval -1 Failure
*/
int mx_tags_commit(struct Mailbox *m, struct Email *e, char *tags)
int mx_tags_commit(struct Mailbox *m, struct Email *e, const char *tags)
{
if (!m || !e || !tags)
return -1;
Expand Down
2 changes: 1 addition & 1 deletion mx.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int mx_path_pretty (char *buf, size_t buflen, const char *folder
enum MailboxType mx_path_probe (const char *path);
struct Mailbox *mx_path_resolve (const char *path);
struct Mailbox *mx_resolve (const char *path_or_name);
int mx_tags_commit (struct Mailbox *m, struct Email *e, char *tags);
int mx_tags_commit (struct Mailbox *m, struct Email *e, const char *tags);
int mx_tags_edit (struct Mailbox *m, const char *tags, char *buf, size_t buflen);
enum MailboxType mx_type (struct Mailbox *m);

Expand Down
2 changes: 1 addition & 1 deletion ncrypt/dlgsmime.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static void smime_key_table_free(struct Menu *menu, void **ptr)
* @param query String to match
* @retval ptr Key selected by user
*/
struct SmimeKey *dlg_select_smime_key(struct SmimeKey *keys, char *query)
struct SmimeKey *dlg_select_smime_key(struct SmimeKey *keys, const char *query)
{
struct SmimeKey **table = NULL;
int table_size = 0;
Expand Down
2 changes: 1 addition & 1 deletion ncrypt/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ struct SmimeKey;

struct CryptKeyInfo *dlg_select_gpgme_key(struct CryptKeyInfo *keys, struct Address *p, const char *s, unsigned int app, int *forced_valid);
struct PgpKeyInfo * dlg_select_pgp_key (struct PgpKeyInfo *keys, struct Address *p, const char *s);
struct SmimeKey * dlg_select_smime_key(struct SmimeKey *keys, char *query);
struct SmimeKey * dlg_select_smime_key(struct SmimeKey *keys, const char *query);

#endif /* MUTT_NCRYPT_PRIVATE_H */
2 changes: 1 addition & 1 deletion ncrypt/smime.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ static struct SmimeKey *smime_get_key_by_addr(char *mailbox, KeyFlags abilities,
* @param only_public_key If true, only get the public keys
* @retval ptr Matching key
*/
static struct SmimeKey *smime_get_key_by_str(char *str, KeyFlags abilities, bool only_public_key)
static struct SmimeKey *smime_get_key_by_str(const char *str, KeyFlags abilities, bool only_public_key)
{
if (!str)
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion notmuch/notmuch.c
Original file line number Diff line number Diff line change
Expand Up @@ -2409,7 +2409,7 @@ static int nm_tags_edit(struct Mailbox *m, const char *tags, char *buf, size_t b
/**
* nm_tags_commit - Save the tags to a message - Implements MxOps::tags_commit() - @ingroup mx_tags_commit
*/
static int nm_tags_commit(struct Mailbox *m, struct Email *e, char *buf)
static int nm_tags_commit(struct Mailbox *m, struct Email *e, const char *buf)
{
if (*buf == '\0')
return 0; /* no tag change, so nothing to do */
Expand Down

0 comments on commit 51bc5d8

Please sign in to comment.