Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 May 1997 10:24:28 -0400 (EDT)
From:      "Kenneth R. Westerback" <krw@tcn.net>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   misc/3480: Quash warnings generated during compile of libncurses
Message-ID:  <199705031424.KAA03206@Pkrw.tcn.net>
Resent-Message-ID: <199705031430.HAA00297@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         3480
>Category:       misc
>Synopsis:       compiling libncurses generates annoying warnings
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat May  3 07:30:02 PDT 1997
>Last-Modified:
>Originator:     Kenneth R. Westerback
>Organization:
>Release:        FreeBSD 2.2-STABLE i386
>Environment:

	FreeBSD 2.2-STABLE with src-2.2.0261 make world'ed

>Description:

	When libncurses is compiled (several times during make world!)
	it generates a number of warning messages, all recommending that
	some expressions be parenthesized.

	The attached diff file addresses all these warnings by

	1) creating a #define BLANK (' ' | A_NORMAL) in curses.h and
           removing a number of almost identical definitions of BLANK
	   in various files

	2) manually inserting the desired parenthesis in the few places
    	   where the warning was not generated by the use of BLANK

>How-To-Repeat:

	make libncurses and watch for warning messages

>Fix:
	
diff -u ./curses.h /usr/src/lib/libncurses/curses.h
--- ./curses.h	Sat Apr 26 11:44:58 1997
+++ /usr/src/lib/libncurses/curses.h	Sat May  3 09:31:59 1997
@@ -56,6 +56,9 @@
 #define COLOR_PAIR(n)	(n << 8)
 #define PAIR_NUMBER(a)	((a & A_COLOR) >> 8)
 
+/* chtype constants */
+#define BLANK 		(' ' | A_NORMAL)
+
 /* colors */
 extern int COLORS;
 extern int COLOR_PAIRS;
diff -u ./lib_addch.c /usr/src/lib/libncurses/lib_addch.c
--- ./lib_addch.c	Sat Apr 26 11:44:58 1997
+++ /usr/src/lib/libncurses/lib_addch.c	Sat May  3 09:43:03 1997
@@ -56,7 +56,7 @@
         	T(("win attr = %x", win->_attrs));
 		ch |= win->_attrs;
 
-		if (win->_line[y][x]&A_CHARTEXT == ' ')
+		if ((win->_line[y][x]&A_CHARTEXT) == ' ')
 			ch |= win->_bkgd;
 		else
 			ch |= (win->_bkgd&A_ATTRIBUTES);
diff -u ./lib_bkgd.c /usr/src/lib/libncurses/lib_bkgd.c
--- ./lib_bkgd.c	Sat Apr 26 11:44:58 1997
+++ /usr/src/lib/libncurses/lib_bkgd.c	Sat May  3 09:41:35 1997
@@ -27,7 +27,7 @@
 	T(("wbkgd(%x, %x) called", win, ch));
 	for (y = 0; y <= win->_maxy; y++)
 		for (x = 0; x <= win->_maxx; x++)
-			if (win->_line[y][x]&A_CHARTEXT == ' ')
+			if ((win->_line[y][x]&A_CHARTEXT) == ' ')
 				win->_line[y][x] |= ch;
 			else
 				win->_line[y][x] |= (ch&A_ATTRIBUTES);
diff -u ./lib_clrbot.c /usr/src/lib/libncurses/lib_clrbot.c
--- ./lib_clrbot.c	Sat Apr 26 11:44:58 1997
+++ /usr/src/lib/libncurses/lib_clrbot.c	Sat May  3 09:36:50 1997
@@ -12,8 +12,6 @@
 
 #include "curses.priv.h"
 
-#define BLANK ' '|A_NORMAL
-
 int wclrtobot(WINDOW *win)
 {
 chtype	*ptr, *end, *maxx = NULL;
diff -u ./lib_clreol.c /usr/src/lib/libncurses/lib_clreol.c
--- ./lib_clreol.c	Sat Apr 26 11:44:59 1997
+++ /usr/src/lib/libncurses/lib_clreol.c	Sat May  3 09:36:27 1997
@@ -12,8 +12,6 @@
 
 #include "curses.priv.h"
 
-#define BLANK ' '|A_NORMAL
-
 int  wclrtoeol(WINDOW *win)
 {
 chtype	*maxx, *ptr, *end;
diff -u ./lib_doupdate.c /usr/src/lib/libncurses/lib_doupdate.c
--- ./lib_doupdate.c	Sat Apr 26 11:44:59 1997
+++ /usr/src/lib/libncurses/lib_doupdate.c	Sat May  3 09:37:36 1997
@@ -195,8 +195,6 @@
 **
 */
 
-#define BLANK ' '|A_NORMAL
-
 static void ClrUpdate(WINDOW *scr)
 {
 int	i = 0, j = 0;
diff -u ./lib_erase.c /usr/src/lib/libncurses/lib_erase.c
--- ./lib_erase.c	Sat Apr 26 11:44:59 1997
+++ /usr/src/lib/libncurses/lib_erase.c	Sat May  3 09:39:55 1997
@@ -13,8 +13,6 @@
 #include "curses.priv.h"
 #include "terminfo.h"
 
-#define BLANK ' '
-
 int  werase(WINDOW	*win)
 {
 int	y;

>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705031424.KAA03206>