summaryrefslogtreecommitdiff
path: root/test/test_getstr.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2026-01-14 13:37:49 +0100
committerBaptiste Daroussin <bapt@FreeBSD.org>2026-01-14 13:37:49 +0100
commitc5a1e08b52b2f6c05e0116d46277904b711b6bdb (patch)
treea6ad7350d1b1100356ca59616d22c51dd29743eb /test/test_getstr.c
parent24fa7a5107c5b75d1c197accf0305be64bc72882 (diff)
Vendor import ncurses 6.6vendor/ncurses/6.6vendor/ncurses
Diffstat (limited to 'test/test_getstr.c')
-rw-r--r--test/test_getstr.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/test/test_getstr.c b/test/test_getstr.c
index dbc0a0a271ed..8e1720b834e4 100644
--- a/test/test_getstr.c
+++ b/test/test_getstr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020,2022 Thomas E. Dickey *
+ * Copyright 2020-2024,2025 Thomas E. Dickey *
* Copyright 2007-2012,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -27,7 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_getstr.c,v 1.16 2022/12/10 23:58:37 tom Exp $
+ * $Id: test_getstr.c,v 1.21 2025/07/05 15:21:56 tom Exp $
*
* Author: Thomas E Dickey
*
@@ -76,7 +76,7 @@ Quit(int ch)
}
static int
-Remainder(WINDOW *txtwin)
+Remainder(NCURSES_CONST WINDOW *txtwin)
{
int result = getmaxx(txtwin) - getcurx(txtwin);
return (result > 0) ? result : 0;
@@ -145,7 +145,7 @@ ShowFlavor(WINDOW *strwin, WINDOW *txtwin, int flavor, int limit)
static int
recursive_test(int level, char **argv, WINDOW *strwin)
{
- static const char *help[] =
+ static NCURSES_CONST char *help[] =
{
"Commands:",
" q,^Q,ESC - quit this program",
@@ -165,10 +165,10 @@ recursive_test(int level, char **argv, WINDOW *strwin)
"",
" w - recur to subwindow",
" ?,<F1> - show help-screen",
- 0
+ NULL
};
- WINDOW *txtbox = 0;
- WINDOW *txtwin = 0;
+ WINDOW *txtbox = NULL;
+ WINDOW *txtwin = NULL;
FILE *fp;
int ch;
int rc;
@@ -180,7 +180,7 @@ recursive_test(int level, char **argv, WINDOW *strwin)
char buffer[MAX_COLS];
- if (argv[level] == 0) {
+ if (argv[level] == NULL) {
beep();
return FALSE;
}
@@ -208,7 +208,7 @@ recursive_test(int level, char **argv, WINDOW *strwin)
txt_x = 0;
wmove(txtwin, txt_y, txt_x);
- if ((fp = fopen(argv[level], "r")) != 0) {
+ if ((fp = fopen(argv[level], "r")) != NULL) {
while ((ch = fgetc(fp)) != EOF) {
if (waddch(txtwin, UChar(ch)) != OK) {
break;
@@ -258,7 +258,7 @@ recursive_test(int level, char **argv, WINDOW *strwin)
case 'w':
recursive_test(level + 1, argv, strwin);
- if (txtbox != 0) {
+ if (txtbox != NULL) {
touchwin(txtbox);
wnoutrefresh(txtbox);
} else {
@@ -391,11 +391,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 */
}
}