Module Name:    src
Committed By:   rillig
Date:           Sun Jun 13 11:06:20 UTC 2021

Modified Files:
        src/tests/lib/libcurses/director: testlang_parse.y

Log Message:
tests/libcurses: sprinkle 'const', normalize sizeof

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/tests/lib/libcurses/director/testlang_parse.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/director/testlang_parse.y
diff -u src/tests/lib/libcurses/director/testlang_parse.y:1.52 src/tests/lib/libcurses/director/testlang_parse.y:1.53
--- src/tests/lib/libcurses/director/testlang_parse.y:1.52	Tue Apr  6 01:29:37 2021
+++ src/tests/lib/libcurses/director/testlang_parse.y	Sun Jun 13 11:06:20 2021
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: testlang_parse.y,v 1.52 2021/04/06 01:29:37 rillig Exp $	*/
+/*	$NetBSD: testlang_parse.y,v 1.53 2021/06/13 11:06:20 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn <bl...@netbsd.org>
@@ -82,7 +82,7 @@ static bool no_input;	/* don't need more
 static wchar_t *vals = NULL;	/* wchars to attach to a cchar type */
 static unsigned nvals;		/* number of wchars */
 
-const char *enum_names[] = {	/* for data_enum_t */
+const char *const enum_names[] = {	/* for data_enum_t */
 	"unused", "numeric", "static", "string", "byte", "cchar", "wchar", "ERR",
 	"OK", "NULL", "not NULL", "variable", "reference", "return count",
 	"slave error"
@@ -116,7 +116,7 @@ typedef struct {
 static size_t nvars; 		/* Number of declared variables */
 static var_t *vars; 		/* Variables defined during the test. */
 
-static int	check_function_table(char *, const char *[], int);
+static int	check_function_table(char *, const char *const[], int);
 static int	find_var_index(const char *);
 static void 	assign_arg(data_enum_t, void *);
 static int	assign_var(const char *);
@@ -149,7 +149,7 @@ static void	set_wchar(char *);
 static wchar_t *add_to_vals(data_enum_t, void *);
 
 #define variants(fn) "" fn, "mv" fn, "w" fn, "mvw" fn
-static const char *input_functions[] = {
+static const char *const input_functions[] = {
 	variants("getch"),
 	variants("getnstr"),
 	variants("getstr"),
@@ -161,7 +161,7 @@ static const char *input_functions[] = {
 #undef variants
 
 static const unsigned ninput_functions =
-	sizeof(input_functions) / sizeof(char *);
+	sizeof(input_functions) / sizeof(input_functions[0]);
 
 extern saved_data_t saved_output;
 
@@ -875,7 +875,7 @@ find_var_index(const char *var_name)
  * there is a match.
  */
 static int
-check_function_table(char *function, const char *table[], int nfunctions)
+check_function_table(char *function, const char *const table[], int nfunctions)
 {
 	int i;
 

Reply via email to