]> granicus.if.org Git - neomutt/commitdiff
Fix unused function warnings when sidebar is disabled. (closes #3936)
authorKevin McCarthy <kevin@8t8.us>
Sun, 30 Apr 2017 21:24:37 +0000 (14:24 -0700)
committerKevin McCarthy <kevin@8t8.us>
Sun, 30 Apr 2017 21:24:37 +0000 (14:24 -0700)
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.

init.c
init.h

diff --git a/init.c b/init.c
index d0026e5a30b72843910c30a6c88e025f59ebd8bf..2a3305888728020684bba17daa9755cbbc3ac14a 100644 (file)
--- 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 09436bb59a9f11fc0ffb1dbdba2f7103fb7d8a54..a8e5ee508f44964507514f7a26ca393217649897 100644 (file)
--- 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 *);