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:
nhmall
2023-06-12 13:53:34 -04:00
parent 41c9c660e8
commit 36ba2b9a0e
3 changed files with 4 additions and 4 deletions

View File

@@ -171,7 +171,7 @@ extern void curses_posthousekeeping(void);
extern void curses_view_file(const char *filename, boolean must_exist);
extern void curses_rtrim(char *str);
extern long curses_get_count(int first_digit);
extern int curses_convert_attr(int attr);
extern attr_t curses_convert_attr(int attr);
extern int curses_read_attrs(const char *attrs);
extern char *curses_fmt_attrs(char *);
extern int curses_convert_keys(int key);

View File

@@ -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...) */

View File

@@ -28,7 +28,7 @@ void curses_posthousekeeping(void);
void curses_view_file(const char *filename, boolean must_exist);
void curses_rtrim(char *str);
long curses_get_count(int first_digit);
int curses_convert_attr(int attr);
attr_t curses_convert_attr(int attr);
int curses_read_attrs(const char *attrs);
char *curses_fmt_attrs(char *);
int curses_convert_keys(int key);