diff options
author | bde <bde@FreeBSD.org> | 1995-11-09 08:17:23 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1995-11-09 08:17:23 +0000 |
commit | 449a11eb8852c894681575cf4226b1c639a2f9bc (patch) | |
tree | d1df2f42cd1cf04bc5757d3dff0d353c3e6a3a58 /sys/kern | |
parent | 7b39ff1acd679291e1eaa968c4a256d7c6e3b22f (diff) | |
download | FreeBSD-src-449a11eb8852c894681575cf4226b1c639a2f9bc.zip FreeBSD-src-449a11eb8852c894681575cf4226b1c639a2f9bc.tar.gz |
Introduced a type `vop_t' for vnode operation functions and used
it 1138 times (:-() in casts and a few more times in declarations.
This change is null for the i386.
The type has to be `typedef int vop_t(void *)' and not `typedef
int vop_t()' because `gcc -Wstrict-prototypes' warns about the
latter. Since vnode op functions are called with args of different
(struct pointer) types, neither of these function types is any use
for type checking of the arg, so it would be preferable not to use
the complete function type, especially since using the complete
type requires adding 1138 casts to avoid compiler warnings and
another 40+ casts to reverse the function pointer conversions before
calling the functions.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_export.c | 6 | ||||
-rw-r--r-- | sys/kern/vfs_init.c | 16 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 6 |
3 files changed, 14 insertions, 14 deletions
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index 8e40e66..32cdf70 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94 - * $Id: vfs_subr.c,v 1.37 1995/10/28 08:50:08 bde Exp $ + * $Id: vfs_subr.c,v 1.38 1995/11/07 05:09:43 dyson Exp $ */ /* @@ -312,7 +312,7 @@ vattr_null(vap) /* * Routines having to do with the management of the vnode table. */ -extern int (**dead_vnodeop_p) (); +extern vop_t **dead_vnodeop_p; extern void vclean(); /* @@ -322,7 +322,7 @@ int getnewvnode(tag, mp, vops, vpp) enum vtagtype tag; struct mount *mp; - int (**vops) (); + vop_t **vops; struct vnode **vpp; { register struct vnode *vp; diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index 4cecaf1..5c98182 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_init.c 8.3 (Berkeley) 1/4/94 - * $Id: vfs_init.c,v 1.11 1995/08/28 09:18:55 julian Exp $ + * $Id: vfs_init.c,v 1.12 1995/09/09 18:10:16 davidg Exp $ */ @@ -91,8 +91,6 @@ extern struct vnodeop_desc *vfs_op_descs[]; */ int vfs_opv_numops; -typedef int (*PFI)(); /* the standard Pointer to a Function returning an Int */ - /* * A miscellaneous routine. * A generic "default" routine that just returns an error. @@ -124,8 +122,8 @@ void vfs_opv_init(struct vnodeopv_desc **them) { int i, j, k; - int (***opv_desc_vector_p)(); - int (**opv_desc_vector)(); + vop_t ***opv_desc_vector_p; + vop_t **opv_desc_vector; struct vnodeopv_entry_desc *opve_descp; /* @@ -139,9 +137,11 @@ vfs_opv_init(struct vnodeopv_desc **them) */ if (*opv_desc_vector_p == NULL) { /* XXX - shouldn't be M_VNODE */ - MALLOC(*opv_desc_vector_p, PFI*, - vfs_opv_numops*sizeof(PFI), M_VNODE, M_WAITOK); - bzero (*opv_desc_vector_p, vfs_opv_numops*sizeof(PFI)); + MALLOC(*opv_desc_vector_p, vop_t **, + vfs_opv_numops * sizeof(vop_t *), M_VNODE, + M_WAITOK); + bzero(*opv_desc_vector_p, + vfs_opv_numops * sizeof(vop_t *)); DODEBUG(printf("vector at %x allocated\n", opv_desc_vector_p)); } diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 8e40e66..32cdf70 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94 - * $Id: vfs_subr.c,v 1.37 1995/10/28 08:50:08 bde Exp $ + * $Id: vfs_subr.c,v 1.38 1995/11/07 05:09:43 dyson Exp $ */ /* @@ -312,7 +312,7 @@ vattr_null(vap) /* * Routines having to do with the management of the vnode table. */ -extern int (**dead_vnodeop_p) (); +extern vop_t **dead_vnodeop_p; extern void vclean(); /* @@ -322,7 +322,7 @@ int getnewvnode(tag, mp, vops, vpp) enum vtagtype tag; struct mount *mp; - int (**vops) (); + vop_t **vops; struct vnode **vpp; { register struct vnode *vp; |