From 8df8f8ccceb1e293f60e5e54a8e886568b326d64 Mon Sep 17 00:00:00 2001 From: Federico Kircheis Date: Sun, 14 Jul 2019 09:24:09 +0200 Subject: [PATCH] Avoid implicit conversion between bool and quadopt Make the conversion between `bool and `QuadOption` explicit, and avoid depending on the underlying `enum` value. Also state that `mutt_yesorno` works correctly for `MUTT_YES` and `MUTT_NO` --- curs_lib.c | 2 +- init.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/curs_lib.c b/curs_lib.c index b06c71a64..2c636e0d1 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -326,7 +326,7 @@ void mutt_edit_file(const char *editor, const char *file) /** * mutt_yesorno - Ask the user a Yes/No question * @param msg Prompt - * @param def Default answer, see #QuadOption + * @param def Default answer, #MUTT_YES or #MUTT_NO (see #QuadOption) * @retval num Selection made, see #QuadOption */ enum QuadOption mutt_yesorno(const char *msg, enum QuadOption def) diff --git a/init.c b/init.c index c882ee91b..fe0b29c84 100644 --- a/init.c +++ b/init.c @@ -3327,7 +3327,7 @@ enum QuadOption query_quadoption(enum QuadOption opt, const char *prompt) return opt; default: - opt = mutt_yesorno(prompt, (opt == MUTT_ASKYES)); + opt = mutt_yesorno(prompt, (opt == MUTT_ASKYES) ? MUTT_YES : MUTT_NO); mutt_window_clearline(MuttMessageWindow, 0); return opt; } -- 2.49.0