follow-up bits
This commit is contained in:
@@ -898,3 +898,4 @@ adjust window port interface to pass a pointer to a glyph_info struct which
|
|||||||
contains the glyph itself, the ttychar, the color, the glyphflags,
|
contains the glyph itself, the ttychar, the color, the glyphflags,
|
||||||
and the symset index; this affects two window port calls that get
|
and the symset index; this affects two window port calls that get
|
||||||
passed glyphs: print_glyph() and add_menu().
|
passed glyphs: print_glyph() and add_menu().
|
||||||
|
switch from k&r C to C99
|
||||||
|
|||||||
+1
-1
@@ -664,7 +664,7 @@ migr_booty_item(int otyp, const char* gang)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
stolen_booty(VOID_ARGS)
|
stolen_booty(void)
|
||||||
{
|
{
|
||||||
char *gang, gang_name[BUFSZ];
|
char *gang, gang_name[BUFSZ];
|
||||||
struct monst *mtmp;
|
struct monst *mtmp;
|
||||||
|
|||||||
+1
-1
@@ -338,7 +338,7 @@ book_cursed(struct obj* book)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
learn(VOID_ARGS)
|
learn(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
short booktype;
|
short booktype;
|
||||||
|
|||||||
+2
-2
@@ -144,7 +144,7 @@ thiefdead(void)
|
|||||||
/* called via (*g.afternmv)() when hero finishes taking off armor that
|
/* called via (*g.afternmv)() when hero finishes taking off armor that
|
||||||
was slated to be stolen but the thief died in the interim */
|
was slated to be stolen but the thief died in the interim */
|
||||||
static int
|
static int
|
||||||
unstolenarm(VOID_ARGS)
|
unstolenarm(void)
|
||||||
{
|
{
|
||||||
struct obj *obj;
|
struct obj *obj;
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ unstolenarm(VOID_ARGS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
stealarm(VOID_ARGS)
|
stealarm(void)
|
||||||
{
|
{
|
||||||
register struct monst *mtmp;
|
register struct monst *mtmp;
|
||||||
register struct obj *otmp;
|
register struct obj *otmp;
|
||||||
|
|||||||
@@ -21,36 +21,6 @@
|
|||||||
set up by curses_init_nhwindows() */
|
set up by curses_init_nhwindows() */
|
||||||
extern char erase_char, kill_char;
|
extern char erase_char, kill_char;
|
||||||
|
|
||||||
/*
|
|
||||||
* Note:
|
|
||||||
* FIXME
|
|
||||||
* Prototypes need to use the widened/unwidened type macros (CHAR_P, &c)
|
|
||||||
* in order to match fields of the window_procs struct (see winprocs.h).
|
|
||||||
* But for a standard-conforming compiler, we'll end up with the widened
|
|
||||||
* types necessary to match the mixed prototype/old-style function
|
|
||||||
* definition environment as used by nethack's core. Prototype
|
|
||||||
int func(CHAR_P);
|
|
||||||
* becomes
|
|
||||||
int func(int);
|
|
||||||
* after expansion, which matches the definition
|
|
||||||
int func(arg) char arg; { ... }
|
|
||||||
* according to the rules of the C standard. But the use of new-style
|
|
||||||
* definitions
|
|
||||||
int func(char arg) { ... }
|
|
||||||
* by the curses interface turns that into a conflict. No widening takes
|
|
||||||
* place so it ought to be 'int func(char);' instead. Unfortunately that
|
|
||||||
* would be incompatible for functions assigned to window_procs.
|
|
||||||
*
|
|
||||||
* So, the code here (also cursmain.c and cursinvt.c) is mis-using the
|
|
||||||
* widening macros for variable types
|
|
||||||
int func(CHAR_P arg) { ... }
|
|
||||||
* (no doubt modelling it after the C++ code in win/Qt where the option
|
|
||||||
* to switch the applicable definitions to old-style isn't available).
|
|
||||||
* Other alternatives aren't significantly better so just live with it.
|
|
||||||
* [Redoing the windowing interface to avoid narrow arguments would be
|
|
||||||
* better since that would fix Qt's usage too.]
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Dialog windows for curses interface */
|
/* Dialog windows for curses interface */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ static void dummy_update_position_bar(char *);
|
|||||||
#endif
|
#endif
|
||||||
#ifdef CHANGE_COLOR
|
#ifdef CHANGE_COLOR
|
||||||
static void dummy_change_color(int, long, int);
|
static void dummy_change_color(int, long, int);
|
||||||
static char *dummy_get_color_string(VOID_ARGS);
|
static char *dummy_get_color_string(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Public functions for curses NetHack interface */
|
/* Public functions for curses NetHack interface */
|
||||||
|
|||||||
Reference in New Issue
Block a user