From 16b6daa45bf76f56e57184892c2d31c3b6b710ee Mon Sep 17 00:00:00 2001 From: imp Date: Mon, 13 Dec 2004 07:23:34 +0000 Subject: Rather than casting through a (void *) to avoid the aliasing warning, do things correctly from an aliasing perspective. Put the vop_generic_args element as the first element for all the vop_*_args and adjust the code to take the address of that instead of the structure. OK'd based on a vague description by: phk --- sys/tools/vnode_if.awk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/tools') diff --git a/sys/tools/vnode_if.awk b/sys/tools/vnode_if.awk index 037f599..81b02a7 100644 --- a/sys/tools/vnode_if.awk +++ b/sys/tools/vnode_if.awk @@ -294,7 +294,7 @@ while ((getline < srcfile) > 0) { if (hfile) { # Print out the vop_F_args structure. - printh("struct "name"_args {\n\tstruct vnodeop_desc *a_desc;"); + printh("struct "name"_args {\n\tstruct vop_generic_args a_gen;"); for (i = 0; i < numargs; ++i) printh("\t" t_spc(types[i]) "a_" args[i] ";"); printh("};"); @@ -310,7 +310,7 @@ while ((getline < srcfile) > 0) { } printh("{\n\tstruct " name "_args a;"); printh("\tint rc;"); - printh("\ta.a_desc = VDESC(" name ");"); + printh("\ta.a_gen.a_desc = VDESC(" name ");"); for (i = 0; i < numargs; ++i) printh("\ta.a_" args[i] " = " args[i] ";"); for (i = 0; i < numargs; ++i) @@ -324,7 +324,7 @@ while ((getline < srcfile) > 0) { printh("\t\tif (vop->"name" != NULL)") printh("\t\t\trc = vop->"name"(&a);") printh("\t\telse") - printh("\t\t\trc = vop->vop_bypass((struct vop_generic_args *)(void *)&a);") + printh("\t\t\trc = vop->vop_bypass(&a.a_gen);") printh("\t}") printh(ctrstr); printh("if (rc == 0) {"); -- cgit v1.1