From: Kevin McCarthy Date: Sun, 30 Apr 2017 21:24:37 +0000 (-0700) Subject: Fix unused function warnings when sidebar is disabled. (closes #3936) X-Git-Tag: mutt-1-8-3-rel~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=caa8d2b2ab38e7574afb06deeb3dd7f6b54d12a3;p=mutt Fix unused function warnings when sidebar is disabled. (closes #3936) parse_path_list/unlist are currently only used by the un/sidebar_whitelist commands. Add an ifdef around them to stop an unused function warning. Add a comment too, so it's clear why they are ifdef'ed. --- diff --git a/init.c b/init.c index d0026e5a..2a330588 100644 --- a/init.c +++ b/init.c @@ -941,6 +941,12 @@ static int parse_unlist (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err return 0; } +/* These two functions aren't sidebar-specific, but they are currently only + * used by the sidebar_whitelist/unsidebar_whitelist commands. + * Putting in an #ifdef to silence an unused function warning when the sidebar + * is disabled. + */ +#ifdef USE_SIDEBAR static int parse_path_list (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) { char path[_POSIX_PATH_MAX]; @@ -980,6 +986,7 @@ static int parse_path_unlist (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER return 0; } +#endif /* USE_SIDEBAR */ static int parse_lists (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) { diff --git a/init.h b/init.h index 09436bb5..a8e5ee50 100644 --- a/init.h +++ b/init.h @@ -3880,8 +3880,10 @@ const struct mapping_t SortSidebarMethods[] = { static int parse_list (BUFFER *, BUFFER *, unsigned long, BUFFER *); static int parse_spam_list (BUFFER *, BUFFER *, unsigned long, BUFFER *); static int parse_unlist (BUFFER *, BUFFER *, unsigned long, BUFFER *); +#ifdef USE_SIDEBAR static int parse_path_list (BUFFER *, BUFFER *, unsigned long, BUFFER *); static int parse_path_unlist (BUFFER *, BUFFER *, unsigned long, BUFFER *); +#endif /* USE_SIDEBAR */ static int parse_group (BUFFER *, BUFFER *, unsigned long, BUFFER *);