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:
nethack.allison
2006-06-25 19:54:31 +00:00
parent c374583632
commit d09c374239
11 changed files with 109 additions and 91 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)do_wear.c 3.5 2006/05/17 */
/* SCCS Id: @(#)do_wear.c 3.5 2006/06/25 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -32,7 +32,7 @@ static NEARDATA const long takeoff_order[] = { WORN_BLINDF, W_WEP,
STATIC_DCL void FDECL(on_msg, (struct obj *));
STATIC_PTR int NDECL(Armor_on);
STATIC_PTR int NDECL(Boots_on);
STATIC_DCL int NDECL(Cloak_on);
STATIC_PTR int NDECL(Cloak_on);
STATIC_PTR int NDECL(Helmet_on);
STATIC_PTR int NDECL(Gloves_on);
STATIC_DCL void FDECL(wielding_corpse, (struct obj *,BOOLEAN_P));
@@ -84,7 +84,7 @@ struct obj *otmp;
STATIC_PTR
int
Boots_on()
Boots_on(VOID_ARGS)
{
long oldprop =
u.uprops[objects[uarmf->otyp].oc_oprop].extrinsic & ~WORN_BOOTS;
@@ -136,7 +136,7 @@ Boots_on()
}
int
Boots_off()
Boots_off(VOID_ARGS)
{
int otyp = uarmf->otyp;
long oldprop = u.uprops[objects[otyp].oc_oprop].extrinsic & ~WORN_BOOTS;
@@ -195,8 +195,8 @@ Boots_off()
return 0;
}
STATIC_OVL int
Cloak_on()
STATIC_PTR int
Cloak_on(VOID_ARGS)
{
long oldprop =
u.uprops[objects[uarmc->otyp].oc_oprop].extrinsic & ~WORN_CLOAK;
@@ -245,7 +245,7 @@ Cloak_on()
}
int
Cloak_off()
Cloak_off(VOID_ARGS)
{
int otyp = uarmc->otyp;
long oldprop = u.uprops[objects[otyp].oc_oprop].extrinsic & ~WORN_CLOAK;
@@ -292,7 +292,7 @@ Cloak_off()
STATIC_PTR
int
Helmet_on()
Helmet_on(VOID_ARGS)
{
switch(uarmh->otyp) {
case FEDORA:
@@ -349,7 +349,7 @@ Helmet_on()
}
int
Helmet_off()
Helmet_off(VOID_ARGS)
{
context.takeoff.mask &= ~W_ARMH;
@@ -392,7 +392,7 @@ Helmet_off()
STATIC_PTR
int
Gloves_on()
Gloves_on(VOID_ARGS)
{
long oldprop =
u.uprops[objects[uarmg->otyp].oc_oprop].extrinsic & ~WORN_GLOVES;
@@ -440,7 +440,7 @@ boolean voluntary; /* taking gloves off on purpose? */
}
int
Gloves_off()
Gloves_off(VOID_ARGS)
{
long oldprop =
u.uprops[objects[uarmg->otyp].oc_oprop].extrinsic & ~WORN_GLOVES;
@@ -481,8 +481,8 @@ Gloves_off()
return 0;
}
STATIC_OVL int
Shield_on()
STATIC_PTR int
Shield_on(VOID_ARGS)
{
/*
switch (uarms->otyp) {
@@ -501,7 +501,7 @@ Shield_on()
}
int
Shield_off()
Shield_off(VOID_ARGS)
{
context.takeoff.mask &= ~W_ARMS;
/*
@@ -522,8 +522,8 @@ Shield_off()
}
#ifdef TOURIST
STATIC_OVL int
Shirt_on()
STATIC_PTR int
Shirt_on(VOID_ARGS)
{
/*
switch (uarmu->otyp) {
@@ -537,7 +537,7 @@ Shirt_on()
}
int
Shirt_off()
Shirt_off(VOID_ARGS)
{
context.takeoff.mask &= ~W_ARMU;
/*
@@ -559,13 +559,13 @@ Shirt_off()
*/
STATIC_PTR
int
Armor_on()
Armor_on(VOID_ARGS)
{
return 0;
}
int
Armor_off()
Armor_off(VOID_ARGS)
{
context.takeoff.mask &= ~W_ARM;
setworn((struct obj *)0, W_ARM);
@@ -1966,7 +1966,7 @@ do_takeoff()
/* occupation callback for 'A' */
STATIC_PTR
int
take_off()
take_off(VOID_ARGS)
{
register int i;
register struct obj *otmp;