From ae5ee376f3016329669920d980488d431eecd522 Mon Sep 17 00:00:00 2001 From: Kp Date: Sun, 27 Dec 2020 22:03:09 +0000 Subject: [PATCH] Move music file picking behind USE_SDLMIXER None of these functions are used when sdlmixer=0, but the recursive usage prevented the compiler from reporting this. --- similar/main/menu.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/similar/main/menu.cpp b/similar/main/menu.cpp index 6b0e65a22..09129ea98 100644 --- a/similar/main/menu.cpp +++ b/similar/main/menu.cpp @@ -312,8 +312,10 @@ struct netgame_menu : netgame_menu_items, newmenu } namespace dcx { + namespace { +#if DXX_USE_SDLMIXER __attribute_nonnull() static int select_file_recursive2(const menu_title title, const std::array &orig_path, const partial_range_t &ext_list, int select_dir, select_file_subfunction when_selected, void *userdata); @@ -323,6 +325,7 @@ static int select_file_recursive(const menu_title title, const std::array>(when_selected), reinterpret_cast(userdata)); } +#endif } } @@ -1988,6 +1991,7 @@ struct browser std::array view_path; // The absolute path we're currently looking at }; +#if DXX_USE_SDLMIXER static void list_dir_el(void *vb, const char *, const char *fname) { browser *b = reinterpret_cast(vb); @@ -2193,6 +2197,7 @@ static int select_file_recursive2(const menu_title title, const std::arraylist.pointer().size(), &pb->list.pointer().front(), 1, 0, select_file_handler, std::move(b)) != NULL; } +#endif #define DXX_MENU_ITEM_BROWSE(VERB, TXT, OPT) \ DXX_MENUITEM(VERB, MENU, TXT " (browse...)", OPT)