X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Flist_keys.c;h=5beb52c9a8c11eff8899b20a3da957850fc22b50;hp=346878a5bac1c81446d06b3c66c54a6efa390309;hb=690589d8f19e38925db061296d4f704e4a965bb2;hpb=e2e9c09c48b19b24979cafb2d4864f538b5ddd1c diff --git a/test/list_keys.c b/test/list_keys.c index 346878a5..5beb52c9 100644 --- a/test/list_keys.c +++ b/test/list_keys.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2016 Free Software Foundation, Inc. * + * Copyright (c) 2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: list_keys.c,v 1.17 2016/09/10 21:24:44 tom Exp $ + * $Id: list_keys.c,v 1.21 2017/06/24 22:13:47 tom Exp $ * * Author: Thomas E Dickey * @@ -89,7 +89,7 @@ show_key(const char *name, bool show) { int width = 0; char buffer[10]; - NCURSES_CONST char *value = tigetstr(name); + NCURSES_CONST char *value = tigetstr((NCURSES_CONST char *) name); if (show && t_opt) fputc('"', stdout); @@ -159,7 +159,7 @@ show_key(const char *name, bool show) } static bool -valid_key(const char *name, TERMINAL ** terms, int count) +valid_key(const char *name, TERMINAL **terms, int count) { bool result = FALSE; if (*name == 'k') { @@ -238,7 +238,7 @@ modified_key(const char *name) map &= ~6; map |= (bit1 << 1) | (bit2 >> 1); _nc_SPRINTF(result, _nc_SLIMIT(sizeof(result)) - "%sF%d", modifiers[map][f_opt], 1 + key); + "%sF%d", modifiers[map][(unsigned)f_opt], 1 + key); } else if (sscanf(name, "k%[A-Z]%d%c", buffer, &value, &chr) == 2 && (value > 1 && value <= 8) && @@ -253,7 +253,7 @@ modified_key(const char *name) !strcmp(buffer, "NXT") || !strcmp(buffer, "PRV"))) { _nc_SPRINTF(result, _nc_SLIMIT(sizeof(result)) - "%sk%s", modifiers[value - 1][f_opt], buffer); + "%sk%s", modifiers[value - 1][(unsigned)f_opt], buffer); } else if (sscanf(name, "k%[A-Z]%c", buffer, &chr) == 1 && (!strcmp(buffer, "UP") || !strcmp(buffer, "DN"))) { @@ -266,7 +266,7 @@ modified_key(const char *name) } static void -list_keys(TERMINAL ** terms, int count) +list_keys(TERMINAL **terms, int count) { int j, k; int widths0 = 0; @@ -288,7 +288,7 @@ list_keys(TERMINAL ** terms, int count) TERMTYPE *term; for (k = 0; k < count; ++k) { set_curterm(terms[k]); - term = &(cur_term->type); + term = (TERMTYPE *) cur_term; total += (size_t) (NUM_STRINGS(term) - STRCOUNT); } } @@ -309,7 +309,7 @@ list_keys(TERMINAL ** terms, int count) int m, n; for (k = 0; k < count; ++k) { set_curterm(terms[k]); - term = &(cur_term->type); + term = (TERMTYPE *) cur_term; for (n = STRCOUNT; n < NUM_STRINGS(term); ++n) { bool found = FALSE; const char *estr = ExtStrname(term, (int) n, strnames); @@ -486,6 +486,8 @@ main(int argc, char *argv[]) list_keys(terms, 1); } + free(terms); + ExitProgram(EXIT_SUCCESS); }