diff options
author | imp <imp@FreeBSD.org> | 2004-12-13 07:23:34 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2004-12-13 07:23:34 +0000 |
commit | 16b6daa45bf76f56e57184892c2d31c3b6b710ee (patch) | |
tree | 0f75e33df16925eb6cc9ffa9d3f691305a23c8f4 /sys/tools | |
parent | f4810ece42ec77a6a4f848874a4293959b0c57d4 (diff) | |
download | FreeBSD-src-16b6daa45bf76f56e57184892c2d31c3b6b710ee.zip FreeBSD-src-16b6daa45bf76f56e57184892c2d31c3b6b710ee.tar.gz |
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
Diffstat (limited to 'sys/tools')
-rw-r--r-- | sys/tools/vnode_if.awk | 6 |
1 files changed, 3 insertions, 3 deletions
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) {"); |