WSL2-Linux-Kernel/scripts/kconfig
Masahiro Yamada 08718745d8 kconfig: nconf: refactor in print_in_middle()
This helper is the same as the sample code in the NCURSES HOWTO [1],
but it is over-engineering to be used for nconf.

I do not see any good reason to use the 'float' type just for the
division by 2.

All the call-sites pass a non-NULL pointer to the first argument,
so 'if (win == NULL) win = stdscr;' is dead code.

'if (startx != 0) x = startx;' is dead code because 'x' will be
overridden some lines below, by 'x = startx + (int)temp;'.

All the call-sites pass a non-zero value to the second argument,
so 'if (starty != 0)' is always true.

getyx(win, y, x) is also dead-code because both 'y' and 'x' are
overridden.

All the call-sites pass 0 to the third parameter, so 'startx' can
be removed.

All the call-sites pass a non-zero value to the fourth parameter,
so 'if (width == 0) width = 80;' is dead code.

The window will be refreshed later, so there is no need to call
refresh() in this function.

Change the type of the last parameter from 'chtype' to 'int' to be
aligned with the prototype, 'int wattrset(WINDOW *win, int attrs);'

I also slightly cleaned up the indentation style.

[1]: https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/color.html

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14 15:25:43 +09:00
..
lxdialog kconfig: lxdialog: A spello fix and a punctuation added 2021-04-14 15:22:49 +09:00
tests kconfig: change "modules" from sub-option to first-level attribute 2021-04-14 15:22:49 +09:00
.gitignore kconfig: qconf: compile moc object separately 2020-08-01 20:54:39 +09:00
Makefile kconfig: use /boot/config-* etc. as DEFCONFIG_LIST only for native build 2021-04-14 15:22:49 +09:00
conf.c kconfig: remove allnoconfig_y option 2021-04-14 15:22:49 +09:00
confdata.c kconfig: change sym_change_count to a boolean flag 2021-04-14 15:22:49 +09:00
expr.c kconfig: distinguish between dependencies and visibility in help text 2020-01-07 02:18:45 +09:00
expr.h kconfig: remove allnoconfig_y option 2021-04-14 15:22:49 +09:00
gconf-cfg.sh kconfig: do not require pkg-config on make {menu,n}config 2018-09-03 02:13:48 +09:00
gconf.c kconfig: fix an "implicit declaration of function" warning 2020-01-10 02:44:54 +09:00
gconf.glade scripts/kconfig/gconf.glade Update broken web addresses. 2010-09-17 16:54:42 +02:00
images.c kconfig: constify XPM data 2020-08-14 13:30:03 +09:00
images.h kconfig: constify XPM data 2020-08-14 13:30:03 +09:00
lexer.l kconfig: change "modules" from sub-option to first-level attribute 2021-04-14 15:22:49 +09:00
list.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
lkc.h kconfig: change sym_change_count to a boolean flag 2021-04-14 15:22:49 +09:00
lkc_proto.h kconfig: change sym_change_count to a boolean flag 2021-04-14 15:22:49 +09:00
mconf-cfg.sh kconfig: mconf: fix HOSTCC call 2021-01-27 03:17:42 +09:00
mconf.c kconfig: mconf,nconf: remove unneeded '\0' termination after snprintf() 2021-04-14 15:22:49 +09:00
menu.c kconfig: change "modules" from sub-option to first-level attribute 2021-04-14 15:22:49 +09:00
merge_config.sh merge_config.sh: ignore unwanted grep errors 2019-09-04 23:12:50 +09:00
nconf-cfg.sh kconfig: be more helpful if pkg-config is missing 2019-11-11 20:10:01 +09:00
nconf.c kconfig: nconf: refactor in print_in_middle() 2021-04-14 15:25:43 +09:00
nconf.gui.c kconfig: nconf: refactor in print_in_middle() 2021-04-14 15:25:43 +09:00
nconf.h kconfig: nconf: refactor in print_in_middle() 2021-04-14 15:25:43 +09:00
parser.y kconfig: change sym_change_count to a boolean flag 2021-04-14 15:22:49 +09:00
preprocess.c kconfig: fix return value of do_error_if() 2020-12-21 14:48:54 +09:00
qconf-cfg.sh kconfig: qconf: use a variable to pass packages to pkg-config 2020-12-08 23:31:29 +09:00
qconf.cc kconfig: qconf: show Qt version in the About dialog 2020-12-08 23:31:29 +09:00
qconf.h kconfig: qconf: remove Y, M, N columns 2020-09-25 00:37:13 +09:00
streamline_config.pl kconfig: streamline_config.pl: Couple of typo fixes 2021-04-14 15:22:49 +09:00
symbol.c kconfig: change sym_change_count to a boolean flag 2021-04-14 15:22:49 +09:00
util.c kconfig: convert to SPDX License Identifier 2018-12-28 22:22:28 +09:00