fix curses build issue caused by "attr_t same as int" assumption
In file included from ../win/curses/cursmisc.c:6:
../win/curses/cursmisc.c: In function 'curses_convert_attr':
../lib/pdcursesmod/curses.h:562:32: warning: overflow in conversion from 'long long unsigned int' to 'int' changes value from '2147483648' to '-2147483648' [-Woverflow]
562 | #define PDC_ATTRIBUTE_BIT( N) ((chtype)1 << (N))
| ^
../lib/pdcursesmod/curses.h:574:27: note: in expansion of macro 'PDC_ATTRIBUTE_BIT'
574 | # define A_DIM PDC_ATTRIBUTE_BIT( PDC_CHARTEXT_BITS + 10)
| ^~~~~~~~~~~~~~~~~
../win/curses/cursmisc.c:752:23: note: in expansion of macro 'A_DIM'
752 | curses_attr = A_DIM;
| ^~~~~
This commit is contained in:
@@ -729,10 +729,10 @@ curses_get_count(int first_digit)
|
||||
/* Convert the given NetHack text attributes into the format curses
|
||||
understands, and return that format mask. */
|
||||
|
||||
int
|
||||
attr_t
|
||||
curses_convert_attr(int attr)
|
||||
{
|
||||
int curses_attr;
|
||||
attr_t curses_attr;
|
||||
|
||||
/* first, strip off control flags masked onto the display attributes
|
||||
(caller should have already done this...) */
|
||||
|
||||
Reference in New Issue
Block a user