Module Name:    src
Committed By:   christos
Date:           Sat Jun 22 20:46:07 UTC 2019

Modified Files:
        src/usr.sbin/sysinst: bsddisklabel.c configmenu.c disks.c label.c
            main.c net.c part_edit.c partman.c run.c util.c wskbd.c

Log Message:
no need to initialize fields that are already 0.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sysinst/configmenu.c
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sysinst/label.c
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/sysinst/main.c
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/sysinst/net.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/sysinst/part_edit.c
cvs rdiff -u -r1.34 -r1.35 src/usr.sbin/sysinst/partman.c
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sysinst/run.c
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/sysinst/util.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/wskbd.c

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

Modified files:

Index: src/usr.sbin/sysinst/bsddisklabel.c
diff -u src/usr.sbin/sysinst/bsddisklabel.c:1.15 src/usr.sbin/sysinst/bsddisklabel.c:1.16
--- src/usr.sbin/sysinst/bsddisklabel.c:1.15	Thu Jun 20 15:26:41 2019
+++ src/usr.sbin/sysinst/bsddisklabel.c	Sat Jun 22 16:46:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.15 2019/06/20 19:26:41 martin Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.16 2019/06/22 20:46:07 christos Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -414,17 +414,14 @@ fill_ptn_menu(struct partition_usage_set
 	memset(pset->menu_opts, 0, (pset->num+3)*sizeof(*pset->menu_opts));
 	for (m = pset->menu_opts, p = pset->infos, i = 0; i < pset->num;
 	    m++, p++, i++) {
-		m->opt_menu = OPT_NOMENU;
 		m->opt_action = set_ptn_size;
 	}
 
 	m->opt_name = size_separator;
-	m->opt_menu = OPT_NOMENU;
 	m->opt_flags = OPT_IGNORE|OPT_NOSHORT;
 	m++;
 
 	m->opt_name = MSG_add_another_ptn;
-	m->opt_menu = OPT_NOMENU;
 	m->opt_action = add_other_ptn_size;
 	m++;
 
@@ -874,24 +871,18 @@ ask_layout(struct disk_partitions *parts
 
 	if (have_existing) {
 		opt->opt_name = MSG_Keep_existing_partitions;
-		opt->opt_exp_name = NULL;
-		opt->opt_menu = OPT_NOMENU;
 		opt->opt_flags = OPT_EXIT;
 		opt->opt_action = set_keep_existing;
 		opt++;
 		num_opts++;
 	}
 	opt->opt_name = MSG_Set_Sizes;
-	opt->opt_exp_name = NULL;
-	opt->opt_menu = OPT_NOMENU;
 	opt->opt_flags = OPT_EXIT;
 	opt->opt_action = set_edit_part_sizes;
 	opt++;
 	num_opts++;
 
 	opt->opt_name = MSG_Use_Default_Parts;
-	opt->opt_exp_name = NULL;
-	opt->opt_menu = OPT_NOMENU;
 	opt->opt_flags = OPT_EXIT;
 	opt->opt_action = set_use_default_sizes;
 	opt++;

Index: src/usr.sbin/sysinst/configmenu.c
diff -u src/usr.sbin/sysinst/configmenu.c:1.8 src/usr.sbin/sysinst/configmenu.c:1.9
--- src/usr.sbin/sysinst/configmenu.c:1.8	Thu Jun 20 11:58:59 2019
+++ src/usr.sbin/sysinst/configmenu.c	Sat Jun 22 16:46:07 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: configmenu.c,v 1.8 2019/06/20 15:58:59 christos Exp $ */
+/* $NetBSD: configmenu.c,v 1.9 2019/06/22 20:46:07 christos Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -181,10 +181,7 @@ init_config_menu(configinfo *conf, menu_
 		if (opt == CONFIGOPT_LAST)
 			break;
 		*ce = conf;
-		me->opt_menu = OPT_NOMENU;
-		me->opt_flags = 0;
-		me->opt_name = NULL;  /* NULL so set_config will draw */
-		me->opt_exp_name = NULL;
+		memset(me, 0, sizeof(*me));
 		me->opt_action = conf->action;
 		configopts++;
 		ce++;

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.35 src/usr.sbin/sysinst/disks.c:1.36
--- src/usr.sbin/sysinst/disks.c:1.35	Fri Jun 21 17:54:39 2019
+++ src/usr.sbin/sysinst/disks.c	Sat Jun 22 16:46:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.35 2019/06/21 21:54:39 christos Exp $ */
+/*	$NetBSD: disks.c,v 1.36 2019/06/22 20:46:07 christos Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -800,13 +800,11 @@ find_disks(const char *doingwhat)
 			for (i = 0; i < numdisks; i++) {
 				dsk_menu[i].opt_name =
 				    disks[i].dd_descr;
-				dsk_menu[i].opt_menu = OPT_NOMENU;
 				dsk_menu[i].opt_flags = OPT_EXIT;
 				dsk_menu[i].opt_action = set_menu_select;
 			}
 			if (partman_go < 0) {
 				dsk_menu[i].opt_name = MSG_partman;
-				dsk_menu[i].opt_menu = OPT_NOMENU;
 				dsk_menu[i].opt_flags = OPT_EXIT;
 				dsk_menu[i].opt_action = set_menu_select;
 			}

Index: src/usr.sbin/sysinst/label.c
diff -u src/usr.sbin/sysinst/label.c:1.7 src/usr.sbin/sysinst/label.c:1.8
--- src/usr.sbin/sysinst/label.c:1.7	Wed Jun 12 02:20:17 2019
+++ src/usr.sbin/sysinst/label.c	Sat Jun 22 16:46:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: label.c,v 1.7 2019/06/12 06:20:17 martin Exp $	*/
+/*	$NetBSD: label.c,v 1.8 2019/06/22 20:46:07 christos Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.7 2019/06/12 06:20:17 martin Exp $");
+__RCSID("$NetBSD: label.c,v 1.8 2019/06/22 20:46:07 christos Exp $");
 #endif
 
 #include <sys/types.h>
@@ -541,11 +541,9 @@ edit_fs_type_ext(menudesc *menu, void *a
 
 	ndx = 0;
 	opts[ndx].opt_name = msg_string(MSG_fs_type_ffsv2);
-	opts[ndx].opt_menu = OPT_NOMENU;
 	opts[ndx].opt_action = set_fstype_ext;
 	ndx++;
 	opts[ndx].opt_name = msg_string(MSG_fs_type_ffs);
-	opts[ndx].opt_menu = OPT_NOMENU;
 	opts[ndx].opt_action = set_fstype_ext;
 	ndx++;
 	for (i = 0; i < FSMAXTYPES && ndx < cnt; i++) {
@@ -556,7 +554,6 @@ edit_fs_type_ext(menudesc *menu, void *a
 		if (fstypenames[i] == NULL)
 			continue;
 		opts[ndx].opt_name = fstypenames[i];
-		opts[ndx].opt_menu = OPT_NOMENU;
 		opts[ndx].opt_action = set_fstype_ext;
 		ndx++;
 	}
@@ -666,7 +663,6 @@ edit_fs_type(menudesc *menu, void *arg)
 	/* special case entry 0: two FFS entries */
 	for (i = 0; i < __arraycount(edit_fs_common_types); i++) {
 		opts[i+1].opt_name = getfslabelname(edit_fs_common_types[i], 0);
-		opts[i+1].opt_menu = OPT_NOMENU;
 		opts[i+1].opt_action = set_fstype;
 	}
 	/* duplicate FFS (at offset 1) into first entry */
@@ -676,7 +672,6 @@ edit_fs_type(menudesc *menu, void *arg)
 	/* add secondary sub-menu */
 	assert(i+1 < (size_t)cnt);
 	opts[i+1].opt_name = msg_string(MSG_other_fs_type);
-	opts[i+1].opt_menu = OPT_NOMENU;
 	opts[i+1].opt_action = edit_fs_type_ext;
 
 	m = new_menu(MSG_Select_the_type, opts, cnt,
@@ -708,30 +703,30 @@ edit_ptn(menudesc *menu, void *arg)
 	bool is_new_part, with_inst_opt = pset->parts->parent == NULL;
 
 	static const menu_ent edit_ptn_fields_head[] = {
-		{ .opt_menu=OPT_NOMENU, .opt_action=edit_fs_type },
-		{ .opt_menu=OPT_NOMENU, .opt_action=edit_fs_start },
-		{ .opt_menu=OPT_NOMENU, .opt_action=edit_fs_size },
-		{ .opt_menu=OPT_NOMENU, .opt_flags=OPT_IGNORE },
+		{ .opt_action=edit_fs_type },
+		{ .opt_action=edit_fs_start },
+		{ .opt_action=edit_fs_size },
+		{ .opt_flags=OPT_IGNORE },
 	};
 
 	static const menu_ent edit_ptn_fields_head_add[] = {
-		{ .opt_menu=OPT_NOMENU, .opt_action=edit_install },
+		{ .opt_action=edit_install },
 	};
 
 	static const menu_ent edit_ptn_fields_head2[] = {
-		{ .opt_menu=OPT_NOMENU, .opt_action=edit_fs_preserve },
-		{ .opt_menu=OPT_NOMENU, .opt_action=edit_fs_mount },
+		{ .opt_action=edit_fs_preserve },
+		{ .opt_action=edit_fs_mount },
 		{ .opt_menu=MENU_mountoptions, .opt_flags=OPT_SUB },
-		{ .opt_menu=OPT_NOMENU, .opt_action=edit_fs_mountpt },
+		{ .opt_action=edit_fs_mountpt },
 	};
 	static const menu_ent edit_ptn_fields_tail[] = {
 		{ .opt_name=MSG_askunits, .opt_menu=MENU_sizechoice,
 		  .opt_flags=OPT_SUB },
-		{ .opt_name=MSG_restore, .opt_menu=OPT_NOMENU,
+		{ .opt_name=MSG_restore,
 		  .opt_action=edit_restore},
-		{ .opt_name=MSG_Delete_partition, .opt_menu=OPT_NOMENU,
+		{ .opt_name=MSG_Delete_partition,
 		  .opt_action=edit_delete_ptn},
-		{ .opt_name=MSG_cancel, .opt_menu=OPT_NOMENU,
+		{ .opt_name=MSG_cancel,
 		  .opt_action=edit_cancel},
 	};
 
@@ -773,7 +768,6 @@ edit_ptn(menudesc *menu, void *arg)
 		for (size_t i = 0;
 		    i < pset->parts->pscheme->custom_attribute_count;
 		    i++, popt++) {
-			popt->opt_menu = OPT_NOMENU;
 			popt->opt_action = edit_ptn_custom_type;
 		}
 	}
@@ -1291,7 +1285,6 @@ edit_fspart_add(menudesc *m, void *arg)
 	memmove(nmenopts+off+1, nmenopts+off,
 	    (m->numopts-off)*sizeof(*nmenopts));
 	memset(&nmenopts[off], 0, sizeof(nmenopts[off]));
-	nmenopts[off].opt_menu = OPT_NOMENU;
 	nmenopts[off].opt_action = edit_ptn;
 	pset->menu_opts = m->opts = nmenopts;
 	m->numopts++;
@@ -1331,7 +1324,6 @@ add_partition_adder(menudesc *m, struct 
 	memset(&nmenopts[off], 0, sizeof(nmenopts[off]));
 
 	nmenopts[off].opt_name = MSG_addpart;
-	nmenopts[off].opt_menu = OPT_NOMENU;
 	nmenopts[off].opt_flags = OPT_SUB;
 	nmenopts[off].opt_action = edit_fspart_add;
 
@@ -1410,20 +1402,17 @@ edit_and_check_label(struct pm_devs *p, 
 
 	op = pset->menu_opts;
 	for (i = 0; i < pset->parts->num_part; i++) {
-		op->opt_menu = OPT_NOMENU;
 		op->opt_action = edit_ptn;
 		op++;
 	}
 	/* separator line between partitions and actions */
 	op->opt_name = fspart_separator;
-	op->opt_menu = OPT_NOMENU;
 	op->opt_flags = OPT_IGNORE|OPT_NOSHORT;
 	op++;
 
 	/* followed by new partition adder */
 	if (may_add) {
 		op->opt_name = MSG_addpart;
-		op->opt_menu = OPT_NOMENU;
 		op->opt_flags = OPT_SUB;
 		op->opt_action = edit_fspart_add;
 		op++;
@@ -1438,7 +1427,6 @@ edit_and_check_label(struct pm_devs *p, 
 
 	if (may_edit_pack) {
 		op->opt_name = MSG_editpack;
-		op->opt_menu = OPT_NOMENU;
 		op->opt_flags = OPT_SUB;
 		op->opt_action = edit_fspart_pack;
 		op++;
@@ -1446,7 +1434,6 @@ edit_and_check_label(struct pm_devs *p, 
 	        
 	/* and abort option */
 	op->opt_name = MSG_cancel;
-	op->opt_menu = OPT_NOMENU;
 	op->opt_flags = OPT_EXIT;
 	op->opt_action = edit_fspart_abort;
 	op++;

Index: src/usr.sbin/sysinst/main.c
diff -u src/usr.sbin/sysinst/main.c:1.16 src/usr.sbin/sysinst/main.c:1.17
--- src/usr.sbin/sysinst/main.c:1.16	Wed Jun 12 02:20:17 2019
+++ src/usr.sbin/sysinst/main.c	Sat Jun 22 16:46:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.16 2019/06/12 06:20:17 martin Exp $	*/
+/*	$NetBSD: main.c,v 1.17 2019/06/22 20:46:07 christos Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -368,8 +368,6 @@ select_language(void)
 
 	for (lang = 0; lang < num_lang; lang++) {
 		opt[lang].opt_name = lang_msg[lang];
-		opt[lang].opt_exp_name = NULL;
-		opt[lang].opt_menu = OPT_NOMENU;
 		opt[lang].opt_action = set_language;
 	}
 

Index: src/usr.sbin/sysinst/net.c
diff -u src/usr.sbin/sysinst/net.c:1.29 src/usr.sbin/sysinst/net.c:1.30
--- src/usr.sbin/sysinst/net.c:1.29	Wed Jun 19 20:43:55 2019
+++ src/usr.sbin/sysinst/net.c	Sat Jun 22 16:46:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: net.c,v 1.29 2019/06/20 00:43:55 christos Exp $	*/
+/*	$NetBSD: net.c,v 1.30 2019/06/22 20:46:07 christos Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -510,8 +510,6 @@ config_network(void)
 
 	for (i = 0; i < num_devs; i++) {
 		net_menu[i].opt_name = net_devs[i].if_dev;
-		net_menu[i].opt_exp_name = NULL;
-		net_menu[i].opt_menu = OPT_NOMENU;
 		net_menu[i].opt_flags = OPT_EXIT;
 		net_menu[i].opt_action = set_menu_select;
 	}

Index: src/usr.sbin/sysinst/part_edit.c
diff -u src/usr.sbin/sysinst/part_edit.c:1.4 src/usr.sbin/sysinst/part_edit.c:1.5
--- src/usr.sbin/sysinst/part_edit.c:1.4	Wed Jun 19 20:43:55 2019
+++ src/usr.sbin/sysinst/part_edit.c	Sat Jun 22 16:46:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: part_edit.c,v 1.4 2019/06/20 00:43:55 christos Exp $ */
+/*	$NetBSD: part_edit.c,v 1.5 2019/06/22 20:46:07 christos Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -173,7 +173,6 @@ edit_part_type(menudesc *m, void *arg)
 	popt_cnt =  info->parts->pscheme->get_part_types_count() + 2;
 	type_opts = calloc(popt_cnt, sizeof(*type_opts));
 	for (i = 0; i < popt_cnt; i++) {
-		type_opts[i].opt_menu = OPT_NOMENU;
 		type_opts[i].opt_action = set_part_type;
 	}
 	type_menu = new_menu(NULL, type_opts, popt_cnt,
@@ -278,20 +277,20 @@ part_rollback(menudesc *m, void *arg)
 
 static menu_ent common_ptn_edit_opts[] = {
 #define PTN_OPT_TYPE		0
-	{ .opt_menu=OPT_NOMENU, .opt_action=edit_part_type },
+	{ .opt_action=edit_part_type },
 #define PTN_OPT_START		1
-	{ .opt_menu=OPT_NOMENU, .opt_action=edit_part_start },
+	{ .opt_action=edit_part_start },
 #define PTN_OPT_SIZE		2
-	{ .opt_menu=OPT_NOMENU, .opt_action=edit_part_size },
+	{ .opt_action=edit_part_size },
 #define PTN_OPT_END		3
-	{ .opt_menu=OPT_NOMENU, .opt_flags=OPT_IGNORE }, /* read only "end" */
+	{ .opt_flags=OPT_IGNORE }, /* read only "end" */
 
 	/*
 	 * Only the part upto here will be used when adding a new partition
 	 */
 
 #define PTN_OPT_INSTALL		4
-	{ .opt_menu=OPT_NOMENU, .opt_action=edit_part_install },
+	{ .opt_action=edit_part_install },
 
 #define	PTN_OPTS_COMMON		PTN_OPT_INSTALL	/* cut off from here for add */
 };
@@ -328,10 +327,10 @@ static menu_ent ptn_edit_opts[] = {
 	{ .opt_name=MSG_askunits, .opt_menu=MENU_sizechoice,
 	  .opt_flags=OPT_SUB },
 
-	{ .opt_name=MSG_Delete_partition, .opt_menu=OPT_NOMENU,
+	{ .opt_name=MSG_Delete_partition,
 	  .opt_action = delete_part, .opt_flags = OPT_EXIT },
 
-	{ .opt_name=MSG_cancel, .opt_menu=OPT_NOMENU,
+	{ .opt_name=MSG_cancel,
 	  .opt_action = part_rollback, .opt_flags = OPT_EXIT },
 };
 
@@ -339,7 +338,7 @@ static menu_ent ptn_add_opts[] = {
 	{ .opt_name=MSG_askunits, .opt_menu=MENU_sizechoice,
 	  .opt_flags=OPT_SUB },
 
-	{ .opt_name=MSG_cancel, .opt_menu=OPT_NOMENU,
+	{ .opt_name=MSG_cancel,
 	  .opt_action = part_rollback, .opt_flags = OPT_EXIT },
 };
 
@@ -376,7 +375,6 @@ fill_part_edit_menu_opts(struct disk_par
 	p = opts + hdr_cnt;
 	if (with_custom_attrs) {
 		for (i = 0; i < parts->pscheme->custom_attribute_count; i++) {
-			p->opt_menu = OPT_NOMENU;
 			p->opt_action = edit_custom_opt;
 			p++;
 		}
@@ -708,9 +706,6 @@ outer_fill_part_menu_opts(const struct d
 	/* add all exisiting partitions */
 	for (op = opts, i = 0; i < parts->num_part && i < (num_opts-2);
 	    op++, i++) {
-		op->opt_name = NULL;
-		op->opt_exp_name = NULL;
-		op->opt_menu = OPT_NOMENU;
 		op->opt_flags = OPT_SUB;
 		op->opt_action = edit_part_entry;
 	}
@@ -718,24 +713,18 @@ outer_fill_part_menu_opts(const struct d
 	/* if empty, hint that partitions are missing */
 	if (parts->num_part == 0) {
 		op->opt_name = MSG_nopart;
-		op->opt_exp_name = NULL;
-		op->opt_menu = OPT_NOMENU;
 		op->opt_flags = OPT_IGNORE|OPT_NOSHORT;
 		op++;
 	}
 
 	/* separator line between partitions and actions */
 	op->opt_name = outer_part_sep_line;
-	op->opt_exp_name = NULL;
-	op->opt_menu = OPT_NOMENU;
 	op->opt_flags = OPT_IGNORE|OPT_NOSHORT;
 	op++;
 
 	/* followed by new partition adder */
 	if (may_add) {
 		op->opt_name = MSG_addpart;
-		op->opt_exp_name = NULL;
-		op->opt_menu = OPT_NOMENU;
 		op->opt_flags = OPT_SUB;
 		op->opt_action = add_part_entry;
 		op++;
@@ -743,7 +732,6 @@ outer_fill_part_menu_opts(const struct d
 
 	/* and unit changer */
 	op->opt_name = MSG_askunits;
-	op->opt_exp_name = NULL;
 	op->opt_menu = MENU_sizechoice;
 	op->opt_flags = OPT_SUB;
 	op->opt_action = NULL;
@@ -751,8 +739,6 @@ outer_fill_part_menu_opts(const struct d
 
 	/* and abort option */
 	op->opt_name = MSG_cancel;
-	op->opt_exp_name = NULL;
-	op->opt_menu = OPT_NOMENU;
 	op->opt_flags = OPT_EXIT;
 	op->opt_action = part_edit_abort;
 	op++;
@@ -924,24 +910,18 @@ ask_fullpart(struct disk_partitions *par
 	if (parts->pscheme->guess_install_target != NULL &&
 	    parts->pscheme->guess_install_target(parts, &start, &size)) {
 		opt->opt_name = MSG_Keep_existing_partitions;
-		opt->opt_exp_name = NULL;
-		opt->opt_menu = OPT_NOMENU;
 		opt->opt_flags = OPT_EXIT;
 		opt->opt_action = set_keep_existing;
 		opt++;
 		num_opts++;
 	}
 	opt->opt_name = MSG_Use_only_part_of_the_disk;
-	opt->opt_exp_name = NULL;
-	opt->opt_menu = OPT_NOMENU;
 	opt->opt_flags = OPT_EXIT;
 	opt->opt_action = set_use_only_part;
 	opt++;
 	num_opts++;
 
 	opt->opt_name = MSG_Use_the_entire_disk;
-	opt->opt_exp_name = NULL;
-	opt->opt_menu = OPT_NOMENU;
 	opt->opt_flags = OPT_EXIT;
 	opt->opt_action = set_use_entire_disk;
 	opt++;
@@ -1251,8 +1231,6 @@ select_part_scheme(
 			goto out;
 
 		opt[used].opt_name = str[used];
-		opt[used].opt_exp_name = NULL;
-		opt[used].opt_menu = OPT_NOMENU;
 		opt[used].opt_action = set_part_scheme;
 		options[used] = p;
 		used++;

Index: src/usr.sbin/sysinst/partman.c
diff -u src/usr.sbin/sysinst/partman.c:1.34 src/usr.sbin/sysinst/partman.c:1.35
--- src/usr.sbin/sysinst/partman.c:1.34	Wed Jun 19 20:43:55 2019
+++ src/usr.sbin/sysinst/partman.c	Sat Jun 22 16:46:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partman.c,v 1.34 2019/06/20 00:43:55 christos Exp $ */
+/*	$NetBSD: partman.c,v 1.35 2019/06/22 20:46:07 christos Exp $ */
 
 /*
  * Copyright 2012 Eugene Lozovoy
@@ -311,10 +311,8 @@ pm_edit(int menu_entries_count, void (*m
 
 	menu_entries = calloc(menu_entries_count, sizeof *menu_entries);
 	for (i = 0; i < menu_entries_count - 1; i++)
-		menu_entries[i] = (menu_ent) {	.opt_menu=OPT_NOMENU,
-						.opt_action=action };
+		menu_entries[i] = (menu_ent) { .opt_action=action };
 	menu_entries[i] = (menu_ent) {	.opt_name=MSG_fremove,
-					.opt_menu=OPT_NOMENU,
 					.opt_flags=OPT_EXIT,
 					.opt_action=action };
 
@@ -383,7 +381,6 @@ pm_dev_list(int type)
 			menu_entries[num_devs] = (struct menu_ent) {
 				.opt_name = disk_entries[num_devs].fullname,					
 				.opt_action = set_menu_select,
-				.opt_menu = OPT_NOMENU,
 				.opt_flags = OPT_EXIT,
 			};
 			num_devs++;
@@ -581,9 +578,9 @@ pm_raid_set_value(menudesc *m, void *arg
 	struct raid_desc *dev_ptr = arg;
 
 	static menu_ent menuent_disk_adddel[] = {
-	    { .opt_name=MSG_add, .opt_menu=OPT_NOMENU, .opt_flags=OPT_EXIT,
+	    { .opt_name=MSG_add, .opt_flags=OPT_EXIT,
 	      .opt_action=pm_raid_disk_add },
-	    { .opt_name=MSG_remove, .opt_menu=OPT_NOMENU, .opt_flags=OPT_EXIT,
+	    { .opt_name=MSG_remove, .opt_flags=OPT_EXIT,
 	      .opt_action=pm_raid_disk_del }
 	};
 	static int menu_disk_adddel = -1;
@@ -756,7 +753,6 @@ pm_raid_disk_del(menudesc *m, void *arg)
 		menu_entries[num_devs] = (struct menu_ent) {
 			.opt_name = dev_ptr->comp[i].name,
 			.opt_action = set_menu_select,
-			.opt_menu = OPT_NOMENU,
 			.opt_flags = OPT_EXIT,
 		};
 		submenu_args[num_devs].dev_ptr = dev_ptr;
@@ -1484,7 +1480,6 @@ pm_lvm_disk_del(menudesc *m, void *arg)
 		menu_entries[num_devs] = (struct menu_ent) {
 			.opt_name = dev_ptr->pv[i].pm_name,
 			.opt_action = set_menu_select,
-			.opt_menu = OPT_NOMENU,
 			.opt_flags = OPT_EXIT,
 		};
 		submenu_args[num_devs].index = i;
@@ -1591,9 +1586,9 @@ pm_lvm_set_value(menudesc *m, void *arg)
 	lvms_t *dev_ptr = arg;
 
 	static menu_ent menuent_disk_adddel[] = {
-	    { .opt_name=MSG_add, .opt_menu=OPT_NOMENU, .opt_flags=OPT_EXIT,
+	    { .opt_name=MSG_add, .opt_flags=OPT_EXIT,
 	      .opt_action=pm_lvm_disk_add },
-	    { .opt_name=MSG_remove, .opt_menu=OPT_NOMENU, .opt_flags=OPT_EXIT,
+	    { .opt_name=MSG_remove, .opt_flags=OPT_EXIT,
 	      .opt_action=pm_lvm_disk_del }
 	};
 	static int menu_disk_adddel = -1;
@@ -2840,7 +2835,6 @@ pm_upddevlist(menudesc *m, void *arg)
 		.opt_action = pm_commit,
 	};
 	for (ii = 0; ii <= (size_t)i; ii++) {
-		m->opts[ii].opt_menu = OPT_NOMENU;
 		m->opts[ii].opt_flags = OPT_EXIT;
 	}
 

Index: src/usr.sbin/sysinst/run.c
diff -u src/usr.sbin/sysinst/run.c:1.11 src/usr.sbin/sysinst/run.c:1.12
--- src/usr.sbin/sysinst/run.c:1.11	Wed Jun 19 20:43:55 2019
+++ src/usr.sbin/sysinst/run.c	Sat Jun 22 16:46:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: run.c,v 1.11 2019/06/20 00:43:55 christos Exp $	*/
+/*	$NetBSD: run.c,v 1.12 2019/06/22 20:46:07 christos Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -79,8 +79,8 @@ static int script_flip (menudesc *, void
 #define BUFSIZE 4096
 
 menu_ent logmenu [2] = {
-	{ .opt_menu=OPT_NOMENU, .opt_action=log_flip},
-	{ .opt_menu=OPT_NOMENU, .opt_action=script_flip}
+	{ .opt_action=log_flip},
+	{ .opt_action=script_flip}
 };
 
 static void

Index: src/usr.sbin/sysinst/util.c
diff -u src/usr.sbin/sysinst/util.c:1.24 src/usr.sbin/sysinst/util.c:1.25
--- src/usr.sbin/sysinst/util.c:1.24	Wed Jun 19 20:43:55 2019
+++ src/usr.sbin/sysinst/util.c	Sat Jun 22 16:46:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.24 2019/06/20 00:43:55 christos Exp $	*/
+/*	$NetBSD: util.c,v 1.25 2019/06/22 20:46:07 christos Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -565,6 +565,7 @@ get_via_cdrom(void)
 		return SET_OK;
 	}
 
+	memset(cd_menu, 0, sizeof(cd_menu));
 	num_cds = get_available_cds();
 	if (num_cds <= 0) {
 		silent = true;
@@ -576,8 +577,6 @@ get_via_cdrom(void)
 	} else {
 		for (i = 0; i< num_cds; i++) {
 			cd_menu[i].opt_name = cds[i].menu;
-			cd_menu[i].opt_exp_name = NULL;
-			cd_menu[i].opt_menu = OPT_NOMENU;
 			cd_menu[i].opt_flags = OPT_EXIT;
 			cd_menu[i].opt_action = set_menu_select;
 		}
@@ -809,10 +808,7 @@ initialise_set_menu(distinfo *dist, menu
 		if (!(set_status[set] & SET_VALID))
 			continue;
 		*de = dist;
-		me->opt_menu = OPT_NOMENU;
-		me->opt_flags = 0;
-		me->opt_name = NULL;
-		me->opt_exp_name = NULL;
+		memset(me, 0, sizeof(*me));
 		if (set != SET_GROUP)
 			me->opt_action = set_toggle;
 		else {
@@ -830,16 +826,10 @@ initialise_set_menu(distinfo *dist, menu
 	}
 
 	if (all_none) {
-		me->opt_menu = OPT_NOMENU;
-		me->opt_flags = 0;
 		me->opt_name = MSG_select_all;
-		me->opt_exp_name = NULL;
 		me->opt_action = set_all;
 		me++;
-		me->opt_menu = OPT_NOMENU;
-		me->opt_flags = 0;
 		me->opt_name = MSG_select_none;
-		me->opt_exp_name = NULL;
 		me->opt_action = set_none;
 		sets += 2;
 	}
@@ -856,6 +846,7 @@ set_sublist(menudesc *menu, void *arg)
 	int menu_no;
 	int sets;
 
+	memset(me, 0, sizeof(me));
 	sets = initialise_set_menu(dist[menu->cursel] + 1, me, de, 1);
 
 	menu_no = new_menu(NULL, me, sets, 20, 10, 0, select_menu_width,
@@ -880,6 +871,7 @@ customise_sets(void)
 	msg_display(MSG_cur_distsets);
 	msg_table_add(MSG_cur_distsets_header);
 
+	memset(me, 0, sizeof(me));
 	sets = initialise_set_menu(dist_list, me, de, 0);
 
 	menu_no = new_menu(NULL, me, sets, 0, 5, 0, select_menu_width,
@@ -1334,7 +1326,7 @@ tzm_set_names(menudesc *m, void *arg)
 	struct stat sb;
 
 	if (tz_menu == NULL)
-		tz_menu = malloc(maxfiles * sizeof *tz_menu);
+		tz_menu = calloc(maxfiles, sizeof *tz_menu);
 	if (tz_names == NULL)
 		tz_names = malloc(maxfiles * sizeof *tz_names);
 	if (tz_menu == NULL || tz_names == NULL)
@@ -1347,9 +1339,6 @@ tzm_set_names(menudesc *m, void *arg)
 	if (fp != zoneinfo_dir + zonerootlen) {
 		tz_names[0] = 0;
 		tz_menu[0].opt_name = msg_string(MSG_tz_back);
-		tz_menu[0].opt_exp_name = NULL;
-		tz_menu[0].opt_menu = OPT_NOMENU;
-		tz_menu[0].opt_flags = 0;
 		tz_menu[0].opt_action = set_tz_back;
 		nfiles = 1;
 	}
@@ -1382,9 +1371,6 @@ tzm_set_names(menudesc *m, void *arg)
 				continue;
 			tz_names[nfiles] = strdup(zoneinfo_dir + zonerootlen);
 			tz_menu[nfiles].opt_name = tz_names[nfiles];
-			tz_menu[nfiles].opt_exp_name = NULL;
-			tz_menu[nfiles].opt_menu = OPT_NOMENU;
-			tz_menu[nfiles].opt_flags = 0;
 			nfiles++;
 		}
 		closedir(dir);

Index: src/usr.sbin/sysinst/wskbd.c
diff -u src/usr.sbin/sysinst/wskbd.c:1.2 src/usr.sbin/sysinst/wskbd.c:1.3
--- src/usr.sbin/sysinst/wskbd.c:1.2	Wed Jun 12 02:20:18 2019
+++ src/usr.sbin/sysinst/wskbd.c	Sat Jun 22 16:46:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: wskbd.c,v 1.2 2019/06/12 06:20:18 martin Exp $	*/
+/*	$NetBSD: wskbd.c,v 1.3 2019/06/22 20:46:07 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: wskbd.c,v 1.2 2019/06/12 06:20:18 martin Exp $");
+__RCSID("$NetBSD: wskbd.c,v 1.3 2019/06/22 20:46:07 christos Exp $");
 
 #include <unistd.h>
 #include <stdlib.h>
@@ -107,7 +107,6 @@ get_kb_encoding(void)
 				if (strcmp(kb_types[i].kb_name, dflt) == 0)
 					kb_default = i;
 			}
-			opt[i].opt_menu = OPT_NOMENU;
 			opt[i].opt_action = set_kb_encoding;
 		}
 		kb_menu = new_menu(MSG_Keyboard_type, opt, __arraycount(opt),

Reply via email to