bsddialog(3): fix disabled shadow

Fix dialogs building and updating fault with disabled shadow
(conf.shadow=false and implicitly bsddialog --no-shadow).

While here delete WARNS=2: all warnings were fixed in upstream and
imported in 0.2.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34958
This commit is contained in:
Alfonso S. Siciliano 2022-04-20 17:39:43 +02:00
parent 7a60e798fb
commit b9e5884ef7
No known key found for this signature in database
GPG Key ID: 3F9EEFACFD371E37
2 changed files with 3 additions and 5 deletions

View File

@ -823,7 +823,7 @@ draw_dialog(struct bsddialog_conf *conf, WINDOW *shadow, WINDOW *widget,
getmaxyx(widget, h, w);
if (shadow != NULL)
if (conf->shadow)
wnoutrefresh(shadow);
draw_borders(conf, widget, h, w, RAISED);
@ -883,7 +883,7 @@ update_dialog(struct bsddialog_conf *conf, WINDOW *shadow, WINDOW *widget,
{
int error;
if (shadow != NULL) {
if (conf->shadow) {
wclear(shadow);
mvwin(shadow, y + t.shadow.h, x + t.shadow.w);
wresize(shadow, h, w);
@ -962,7 +962,7 @@ end_dialog(struct bsddialog_conf *conf, WINDOW *shadow, WINDOW *widget,
delwin(shadow);
if (conf->clear)
hide_widget(y, x, h, w, shadow != NULL);
hide_widget(y, x, h, w, conf->shadow);
if (conf->get_height != NULL)
*conf->get_height = h;

View File

@ -24,6 +24,4 @@ MAN= bsddialog.3
LIBADD= ncursesw tinfow formw
CFLAGS+= -D_XOPEN_SOURCE_EXTENDED
WARNS= 2
.include <bsd.lib.mk>