From: Jonathan Neuschäfer Date: Thu, 22 Dec 2011 21:13:04 +0000 (+0100) Subject: options: get_key_names: use bool X-Git-Tag: release-0.20~24 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a023de1cdf0ebcd19b1236c4132175402fc7d4b6;p=ncmpc.git options: get_key_names: use bool (And true/false in calls to it) --- diff --git a/src/command.c b/src/command.c index 4f52560..656bb18 100644 --- a/src/command.c +++ b/src/command.c @@ -330,7 +330,9 @@ command_dump_keys(void) { for (int i = 0; cmds[i].description; i++) if (cmds[i].command != CMD_NONE) - printf(" %20s : %s\n", get_key_names(cmds[i].command,1),cmds[i].name); + printf(" %20s : %s\n", + get_key_names(cmds[i].command, true), + cmds[i].name); } #ifndef NCMPC_MINI @@ -349,7 +351,7 @@ set_key_flags(command_definition_t *cp, command_t command, int flags) #endif const char * -get_key_names(command_t command, int all) +get_key_names(command_t command, bool all) { for (int i = 0; cmds[i].description; i++) { if (cmds[i].command == command) { diff --git a/src/command.h b/src/command.h index 3a7d61d..225d76e 100644 --- a/src/command.h +++ b/src/command.h @@ -23,6 +23,7 @@ #include "config.h" #include +#include #ifndef NCMPC_MINI #include @@ -142,7 +143,7 @@ int write_key_bindings(FILE *f, int all); const char *key2str(int key); const char *get_key_description(command_t command); const char *get_key_command_name(command_t command); -const char *get_key_names(command_t command, int all); +const char *get_key_names(command_t command, bool all); command_t get_key_command(int key); command_t get_key_command_from_name(char *name); int assign_keys(command_t command, int keys[MAX_COMMAND_KEYS]); diff --git a/src/main.c b/src/main.c index 1581e78..ffc310f 100644 --- a/src/main.c +++ b/src/main.c @@ -313,7 +313,7 @@ timer_reconnect(G_GNUC_UNUSED gpointer data) char *name = default_settings_name(); screen_status_printf(_("Connecting to %s... [Press %s to abort]"), - name, get_key_names(CMD_QUIT,0) ); + name, get_key_names(CMD_QUIT, false)); g_free(name); doupdate(); @@ -527,7 +527,7 @@ timer_check_key_bindings(G_GNUC_UNUSED gpointer data) and this is a hint for the user what to press to correct that */ g_snprintf(comment, sizeof(comment), _("press %s for the key editor"), - get_key_names(CMD_SCREEN_KEYDEF, 0)); + get_key_names(CMD_SCREEN_KEYDEF, false)); g_strlcat(buf, comment, sizeof(buf)); g_strlcat(buf, ")", sizeof(buf)); #endif diff --git a/src/screen_search.c b/src/screen_search.c index 5e9226e..81ca8e4 100644 --- a/src/screen_search.c +++ b/src/screen_search.c @@ -382,7 +382,7 @@ screen_search_open(G_GNUC_UNUSED struct mpdclient *c) // search_new(screen, c); // else screen_status_printf(_("Press %s for a new search"), - get_key_names(CMD_SCREEN_SEARCH,0)); + get_key_names(CMD_SCREEN_SEARCH, false)); search_check_mode(); } @@ -416,7 +416,7 @@ screen_search_get_title(char *str, size_t size) _(mode[options.search_mode].label)); else g_snprintf(str, size, _("Search: Press %s for a new search [%s]"), - get_key_names(CMD_SCREEN_SEARCH,0), + get_key_names(CMD_SCREEN_SEARCH, false), _(mode[options.search_mode].label)); return str; diff --git a/src/title_bar.c b/src/title_bar.c index bbbd6de..7fdce0c 100644 --- a/src/title_bar.c +++ b/src/title_bar.c @@ -37,7 +37,7 @@ static void print_hotkey(WINDOW *w, command_t cmd, const char *label) { colors_use(w, COLOR_TITLE_BOLD); - waddstr(w, get_key_names(cmd, FALSE)); + waddstr(w, get_key_names(cmd, false)); colors_use(w, COLOR_TITLE); waddch(w, ':'); waddstr(w, label);