function pointer assignment warnings in VC2005
The latest Micrsoft compilers complain when a function is
assigned to a function pointer, and the function's argument
list does not match the prototype precisely.
It was evem complaining about the difference between this:
int x()
{
[...]
}
and a prototype of
int x(void);
when assigning that function's address to a function pointer.
This quiets those warnings, without suppressing the mismatch
check altogether for more serious mismatches.
This commit is contained in:
56
src/cmd.c
56
src/cmd.c
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)cmd.c 3.5 2006/04/14 */
|
||||
/* SCCS Id: @(#)cmd.c 3.5 2006/06/25 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -170,14 +170,14 @@ STATIC_DCL char *NDECL(parse);
|
||||
STATIC_DCL boolean FDECL(help_dir, (CHAR_P,const char *));
|
||||
|
||||
STATIC_PTR int
|
||||
doprev_message()
|
||||
doprev_message(VOID_ARGS)
|
||||
{
|
||||
return nh_doprev_message();
|
||||
}
|
||||
|
||||
/* Count down by decrementing multi */
|
||||
STATIC_PTR int
|
||||
timed_occupation()
|
||||
timed_occupation(VOID_ARGS)
|
||||
{
|
||||
(*timed_occ_fn)();
|
||||
if (multi > 0)
|
||||
@@ -291,7 +291,7 @@ char ch;
|
||||
#endif /* REDO */
|
||||
|
||||
STATIC_PTR int
|
||||
doextcmd() /* here after # - now read a full-word command */
|
||||
doextcmd(VOID_ARGS) /* here after # - now read a full-word command */
|
||||
{
|
||||
int idx, retval;
|
||||
|
||||
@@ -307,7 +307,7 @@ doextcmd() /* here after # - now read a full-word command */
|
||||
}
|
||||
|
||||
int
|
||||
doextlist() /* here after #? - now list all full-word commands */
|
||||
doextlist(VOID_ARGS) /* here after #? - now list all full-word commands */
|
||||
{
|
||||
register const struct ext_func_tab *efp;
|
||||
char buf[BUFSZ];
|
||||
@@ -453,7 +453,7 @@ extcmd_via_menu() /* here after # - now show pick-list of possible commands */
|
||||
|
||||
/* #monster command - use special monster ability while polymorphed */
|
||||
STATIC_PTR int
|
||||
domonability()
|
||||
domonability(VOID_ARGS)
|
||||
{
|
||||
if (can_breathe(youmonst.data)) return dobreathe();
|
||||
else if (attacktype(youmonst.data, AT_SPIT)) return dospit();
|
||||
@@ -484,7 +484,7 @@ domonability()
|
||||
}
|
||||
|
||||
STATIC_PTR int
|
||||
enter_explore_mode()
|
||||
enter_explore_mode(VOID_ARGS)
|
||||
{
|
||||
if(!discover && !wizard) {
|
||||
pline("Beware! From explore mode there will be no return to normal game.");
|
||||
@@ -503,7 +503,7 @@ enter_explore_mode()
|
||||
|
||||
#ifdef DUNGEON_OVERVIEW
|
||||
STATIC_PTR int
|
||||
dooverview_or_wiz_where()
|
||||
dooverview_or_wiz_where(VOID_ARGS)
|
||||
{
|
||||
#ifdef WIZARD
|
||||
if (wizard) return wiz_where();
|
||||
@@ -518,7 +518,7 @@ dooverview_or_wiz_where()
|
||||
|
||||
/* ^W command - wish for something */
|
||||
STATIC_PTR int
|
||||
wiz_wish() /* Unlimited wishes for debug mode by Paul Polderman */
|
||||
wiz_wish(VOID_ARGS) /* Unlimited wishes for debug mode by Paul Polderman */
|
||||
{
|
||||
if (wizard) {
|
||||
boolean save_verbose = flags.verbose;
|
||||
@@ -535,7 +535,7 @@ wiz_wish() /* Unlimited wishes for debug mode by Paul Polderman */
|
||||
|
||||
/* ^I command - reveal and optionally identify hero's inventory */
|
||||
STATIC_PTR int
|
||||
wiz_identify()
|
||||
wiz_identify(VOID_ARGS)
|
||||
{
|
||||
if (wizard) {
|
||||
iflags.override_ID = (int)cmd_from_func(wiz_identify);
|
||||
@@ -549,7 +549,7 @@ wiz_identify()
|
||||
|
||||
/* ^F command - reveal the level map and any traps on it */
|
||||
STATIC_PTR int
|
||||
wiz_map()
|
||||
wiz_map(VOID_ARGS)
|
||||
{
|
||||
if (wizard) {
|
||||
struct trap *t;
|
||||
@@ -572,7 +572,7 @@ wiz_map()
|
||||
|
||||
/* ^G command - generate monster(s); a count prefix will be honored */
|
||||
STATIC_PTR int
|
||||
wiz_genesis()
|
||||
wiz_genesis(VOID_ARGS)
|
||||
{
|
||||
if (wizard) (void) create_particular();
|
||||
else pline("Unavailable command '%s'.",
|
||||
@@ -582,7 +582,7 @@ wiz_genesis()
|
||||
|
||||
/* ^O command - display dungeon layout */
|
||||
STATIC_PTR int
|
||||
wiz_where()
|
||||
wiz_where(VOID_ARGS)
|
||||
{
|
||||
if (wizard) (void) print_dungeon(FALSE, (schar *)0, (xchar *)0);
|
||||
else pline("Unavailable command '%s'.",
|
||||
@@ -592,7 +592,7 @@ wiz_where()
|
||||
|
||||
/* ^E command - detect unseen (secret doors, traps, hidden monsters) */
|
||||
STATIC_PTR int
|
||||
wiz_detect()
|
||||
wiz_detect(VOID_ARGS)
|
||||
{
|
||||
if(wizard) (void) findit();
|
||||
else pline("Unavailable command '%s'.",
|
||||
@@ -602,7 +602,7 @@ wiz_detect()
|
||||
|
||||
/* ^V command - level teleport */
|
||||
STATIC_PTR int
|
||||
wiz_level_tele()
|
||||
wiz_level_tele(VOID_ARGS)
|
||||
{
|
||||
if (wizard) level_tele();
|
||||
else pline("Unavailable command '%s'.",
|
||||
@@ -612,7 +612,7 @@ wiz_level_tele()
|
||||
|
||||
/* #monpolycontrol command - choose new form for shapechangers, polymorphees */
|
||||
STATIC_PTR int
|
||||
wiz_mon_polycontrol()
|
||||
wiz_mon_polycontrol(VOID_ARGS)
|
||||
{
|
||||
iflags.mon_polycontrol = !iflags.mon_polycontrol;
|
||||
pline("Monster polymorph control is %s.",
|
||||
@@ -622,7 +622,7 @@ wiz_mon_polycontrol()
|
||||
|
||||
/* #levelchange command - adjust hero's experience level */
|
||||
STATIC_PTR int
|
||||
wiz_level_change()
|
||||
wiz_level_change(VOID_ARGS)
|
||||
{
|
||||
char buf[BUFSZ];
|
||||
int newlevel;
|
||||
@@ -662,7 +662,7 @@ wiz_level_change()
|
||||
|
||||
/* #panic command - test program's panic handling */
|
||||
STATIC_PTR int
|
||||
wiz_panic()
|
||||
wiz_panic(VOID_ARGS)
|
||||
{
|
||||
if (yn("Do you want to call panic() and end your game?") == 'y')
|
||||
panic("crash test.");
|
||||
@@ -671,7 +671,7 @@ wiz_panic()
|
||||
|
||||
/* #polyself command - change hero's form */
|
||||
STATIC_PTR int
|
||||
wiz_polyself()
|
||||
wiz_polyself(VOID_ARGS)
|
||||
{
|
||||
polyself(1);
|
||||
return 0;
|
||||
@@ -679,7 +679,7 @@ wiz_polyself()
|
||||
|
||||
/* #seenv command */
|
||||
STATIC_PTR int
|
||||
wiz_show_seenv()
|
||||
wiz_show_seenv(VOID_ARGS)
|
||||
{
|
||||
winid win;
|
||||
int x, y, v, startx, stopx, curx;
|
||||
@@ -721,7 +721,7 @@ wiz_show_seenv()
|
||||
|
||||
/* #vision command */
|
||||
STATIC_PTR int
|
||||
wiz_show_vision()
|
||||
wiz_show_vision(VOID_ARGS)
|
||||
{
|
||||
winid win;
|
||||
int x, y, v;
|
||||
@@ -758,7 +758,7 @@ wiz_show_vision()
|
||||
|
||||
/* #wmode command */
|
||||
STATIC_PTR int
|
||||
wiz_show_wmodes()
|
||||
wiz_show_wmodes(VOID_ARGS)
|
||||
{
|
||||
winid win;
|
||||
int x,y;
|
||||
@@ -793,7 +793,7 @@ wiz_show_wmodes()
|
||||
|
||||
/* #terrain command */
|
||||
STATIC_PTR int
|
||||
wiz_map_terrain()
|
||||
wiz_map_terrain(VOID_ARGS)
|
||||
{
|
||||
winid win;
|
||||
int x, y, terrain;
|
||||
@@ -899,7 +899,7 @@ wiz_map_terrain()
|
||||
|
||||
/* #wizsmell command - test usmellmon(). */
|
||||
STATIC_PTR int
|
||||
wiz_smell()
|
||||
wiz_smell(VOID_ARGS)
|
||||
{
|
||||
char out_str[BUFSZ];
|
||||
struct permonst *pm = 0;
|
||||
@@ -946,7 +946,7 @@ wiz_smell()
|
||||
|
||||
/* #wizrumorcheck command - verify each rumor access */
|
||||
STATIC_PTR int
|
||||
wiz_rumor_check()
|
||||
wiz_rumor_check(VOID_ARGS)
|
||||
{
|
||||
rumor_check();
|
||||
return 0;
|
||||
@@ -1463,7 +1463,7 @@ minimal_enlightenment()
|
||||
|
||||
/* ^X command */
|
||||
STATIC_PTR int
|
||||
doattributes()
|
||||
doattributes(VOID_ARGS)
|
||||
{
|
||||
if (!minimal_enlightenment())
|
||||
return 0;
|
||||
@@ -1476,7 +1476,7 @@ doattributes()
|
||||
* (shares enlightenment's tense handling)
|
||||
*/
|
||||
STATIC_PTR int
|
||||
doconduct()
|
||||
doconduct(VOID_ARGS)
|
||||
{
|
||||
show_conduct(0);
|
||||
return 0;
|
||||
@@ -2865,7 +2865,7 @@ readchar()
|
||||
}
|
||||
|
||||
STATIC_PTR int
|
||||
dotravel()
|
||||
dotravel(VOID_ARGS)
|
||||
{
|
||||
/* Keyboard travel command */
|
||||
static char cmd[2];
|
||||
|
||||
Reference in New Issue
Block a user