From: Anton Rieger Date: Mon, 25 Sep 2017 19:05:41 +0000 (+0200) Subject: bool: convert function parameters in history.h X-Git-Tag: neomutt-20171006~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b2177792de58593067802808c1d823369346d71;p=neomutt bool: convert function parameters in history.h * mutt_history_add() * mutt_history_at_scratch() --- diff --git a/enter.c b/enter.c index 75b0cd71a..04be6c2e6 100644 --- a/enter.c +++ b/enter.c @@ -705,7 +705,7 @@ int _mutt_enter_string(char *buf, size_t buflen, int col, int flags, int multipl { mutt_pretty_mailbox(buf, buflen); if (!pass) - mutt_history_add(hclass, buf, 1); + mutt_history_add(hclass, buf, true); rv = 0; goto bye; } @@ -824,7 +824,7 @@ int _mutt_enter_string(char *buf, size_t buflen, int col, int flags, int multipl /* Convert from wide characters */ my_wcstombs(buf, buflen, state->wbuf, state->lastchar); if (!pass) - mutt_history_add(hclass, buf, 1); + mutt_history_add(hclass, buf, true); if (multiple) { diff --git a/history.c b/history.c index c6074e776..52fedee7c 100644 --- a/history.c +++ b/history.c @@ -136,7 +136,7 @@ void mutt_read_histfile(void) if (p) { mutt_convert_string(&p, "utf-8", Charset, 0); - mutt_history_add(hclass, p, 0); + mutt_history_add(hclass, p, false); FREE(&p); } } @@ -382,7 +382,7 @@ void mutt_init_history(void) OldSize = History; } -void mutt_history_add(enum HistoryClass hclass, const char *s, int save) +void mutt_history_add(enum HistoryClass hclass, const char *s, bool save) { int prev; struct History *h = GET_HISTORY(hclass); @@ -468,12 +468,12 @@ void mutt_reset_history_state(enum HistoryClass hclass) h->cur = h->last; } -int mutt_history_at_scratch(enum HistoryClass hclass) +bool mutt_history_at_scratch(enum HistoryClass hclass) { struct History *h = GET_HISTORY(hclass); if (!History || !h) - return 0; /* disabled */ + return false; /* disabled */ return h->cur == h->last; } diff --git a/history.h b/history.h index 7fcd45e19..3c0a66105 100644 --- a/history.h +++ b/history.h @@ -23,6 +23,8 @@ #ifndef _MUTT_HISTORY_H #define _MUTT_HISTORY_H +#include + /** * enum HistoryClass - Type to differentiate different histories */ @@ -43,11 +45,11 @@ enum HistoryClass void mutt_init_history(void); void mutt_read_histfile(void); -void mutt_history_add(enum HistoryClass hclass, const char *s, int save); +void mutt_history_add(enum HistoryClass hclass, const char *s, bool save); char *mutt_history_next(enum HistoryClass hclass); char *mutt_history_prev(enum HistoryClass hclass); void mutt_reset_history_state(enum HistoryClass hclass); -int mutt_history_at_scratch(enum HistoryClass hclass); +bool mutt_history_at_scratch(enum HistoryClass hclass); void mutt_history_save_scratch(enum HistoryClass hclass, const char *s); #endif /* _MUTT_HISTORY_H */