diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2006-01-02 05:05:12 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2006-01-02 05:05:12 +0000 |
commit | 901ecd6850e956f5d963fd8a5474fb7c193dc84c (patch) | |
tree | f3959015f3c245b50b6a80326f7c8f16b2111ea0 /sys/kern/vnode_if.sh | |
parent | 9d93ec3938778ba4970fd7d3fef1b5497323da81 (diff) |
Make this generate code with ansi function declarations.
No binary change in compiled version of generated file.
Diffstat (limited to 'sys/kern/vnode_if.sh')
-rw-r--r-- | sys/kern/vnode_if.sh | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/sys/kern/vnode_if.sh b/sys/kern/vnode_if.sh index 9e8d38501b5..026c47aa773 100644 --- a/sys/kern/vnode_if.sh +++ b/sys/kern/vnode_if.sh @@ -29,7 +29,7 @@ copyright="\ * SUCH DAMAGE. */ " -SCRIPT_ID='$OpenBSD: vnode_if.sh,v 1.14 2005/05/22 21:07:23 pedro Exp $' +SCRIPT_ID='$OpenBSD: vnode_if.sh,v 1.15 2006/01/02 05:05:11 jsg Exp $' # SCRIPT_ID='$NetBSD: vnode_if.sh,v 1.9 1996/02/29 20:58:22 cgd Exp $' # Script to produce VFS front-end sugar. @@ -315,14 +315,23 @@ function doit() { # Define inline function. printf("\nint %s(", toupper(name)); + desclen = 5 + length(name); for (i=0; i<argc; i++) { - printf("%s", argname[i]); - if (i < (argc-1)) printf(", "); + arglen = length(argtype[i]) + length(argname[i]); + + if (arglen + desclen > 77) { + printf("\n "); + arglen += 4; + desclen = 0; + } + printf("%s %s", argtype[i], argname[i]); + if (i < (argc-1)) { + printf(", "); + desclen += 2; + } + desclen += arglen; } printf(")\n"); - for (i=0; i<argc; i++) { - printf("\t%s %s;\n", argtype[i], argname[i]); - } printf("{\n\tstruct %s_args a;\n", name); printf("\ta.a_desc = VDESC(%s);\n", name); for (i=0; i<argc; i++) { |