diff options
Diffstat (limited to 'test/insdelln.c')
| -rw-r--r-- | test/insdelln.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/test/insdelln.c b/test/insdelln.c index 52ccfb620f9b..b19384595ecb 100644 --- a/test/insdelln.c +++ b/test/insdelln.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2019-2020,2022 Thomas E. Dickey * + * Copyright 2019-2024,2025 Thomas E. Dickey * * Copyright 2008-2014,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -27,7 +27,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: insdelln.c,v 1.15 2022/12/10 23:31:31 tom Exp $ + * $Id: insdelln.c,v 1.19 2025/07/05 15:21:56 tom Exp $ * * test-driver for deleteln, wdeleteln, insdelln, winsdelln, insertln, winsertln */ @@ -71,7 +71,7 @@ color_params(unsigned state, int *pair) }; /* *INDENT-ON* */ - const char *result = 0; + const char *result = NULL; if (has_colors()) { static bool first = TRUE; @@ -107,7 +107,7 @@ video_params(unsigned state, unsigned *attr) }; /* *INDENT-ON* */ - const char *result = 0; + const char *result = NULL; if (state < SIZEOF(table)) { *attr = table[state].attr; @@ -144,9 +144,9 @@ show_status(WINDOW *win, STATUS * sp) getyx(win, y, x); wmove(win, 0, 0); wprintw(win, "Count %d", sp->count); - if (sp->v_msg != 0) + if (sp->v_msg != NULL) wprintw(win, " Video %s", sp->v_msg); - if (sp->c_msg != 0) + if (sp->c_msg != NULL) wprintw(win, " Color %s", sp->c_msg); wclrtoeol(win); wmove(win, y, x); @@ -160,15 +160,15 @@ reshow_status(WINDOW *win, STATUS * sp) } static void -do_subwindow(WINDOW *win, STATUS * sp, void func(WINDOW *)) +do_subwindow(WINDOW *win, const STATUS * sp, void func(WINDOW *)) { WINDOW *win1 = newwin(sp->y_max - 2, sp->x_max - 2, sp->y_beg + 1, sp->x_beg + 1); - if (win1 != 0 && sp->y_max > 4 && sp->x_max > 4) { + if (win1 != NULL && sp->y_max > 4 && sp->x_max > 4) { WINDOW *win2 = derwin(win1, sp->y_max - 4, sp->x_max - 4, 1, 1); - if (win2 != 0) { + if (win2 != NULL) { box(win1, 0, 0); wrefresh(win1); func(win2); @@ -204,7 +204,7 @@ init_status(WINDOW *win, STATUS * sp) static void show_help(WINDOW *win) { - static const char *table[] = + static NCURSES_CONST char *table[] = { "Basic commands:" ,"Use h/j/k/l or arrow keys to move the cursor." @@ -222,7 +222,7 @@ show_help(WINDOW *win) ,"q quit" ,"= resets count to zero." ,"? shows this help-window" - ,0 + ,NULL }; popup_msg(win, table); @@ -234,14 +234,14 @@ update_status(WINDOW *win, STATUS * sp) switch (sp->ch) { case ' ': /* next test-iteration */ if (has_colors()) { - if ((sp->c_msg = color_params(++(sp->c), &(sp->pair))) == 0) { + if ((sp->c_msg = color_params(++(sp->c), &(sp->pair))) == NULL) { sp->c_msg = color_params(sp->c = 0, &(sp->pair)); - if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) { + if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == NULL) { sp->v_msg = video_params(sp->v = 0, &(sp->attr)); } } } else { - if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) { + if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == NULL) { sp->v_msg = video_params(sp->v = 0, &(sp->attr)); } } @@ -398,11 +398,8 @@ main(int argc, char *argv[]) while ((ch = getopt(argc, argv, OPTS_COMMON)) != -1) { switch (ch) { - case OPTS_VERSION: - show_version(argv); - ExitProgram(EXIT_SUCCESS); default: - usage(ch == OPTS_USAGE); + CASE_COMMON; /* NOTREACHED */ } } |
