From owner-svn-src-projects@FreeBSD.ORG Fri Nov 21 23:03:31 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE3EA247; Fri, 21 Nov 2014 23:03:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91302A53; Fri, 21 Nov 2014 23:03:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sALN3VRB039337; Fri, 21 Nov 2014 23:03:31 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sALN3VrU039336; Fri, 21 Nov 2014 23:03:31 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411212303.sALN3VrU039336@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 21 Nov 2014 23:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r274824 - projects/sendfile/sys/tools X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 23:03:31 -0000 Author: glebius Date: Fri Nov 21 23:03:30 2014 New Revision: 274824 URL: https://svnweb.freebsd.org/changeset/base/274824 Log: Revert r260825. We will use typedefs for function arguments. Suggested by: kib Modified: projects/sendfile/sys/tools/vnode_if.awk Modified: projects/sendfile/sys/tools/vnode_if.awk ============================================================================== --- projects/sendfile/sys/tools/vnode_if.awk Fri Nov 21 21:34:19 2014 (r274823) +++ projects/sendfile/sys/tools/vnode_if.awk Fri Nov 21 23:03:30 2014 (r274824) @@ -254,26 +254,16 @@ while ((getline < srcfile) > 0) { if (sub(/;$/, "") < 1) die("Missing end-of-line ; in \"%s\".", $0); - # pick off argument name - if ((argp = match($0, /[A-Za-z0-9_]+$/)) > 0) { - args[numargs] = substr($0, argp); - $0 = substr($0, 1, argp - 1); - sub(/ $/, ""); - delete fargs[numargs]; - types[numargs] = $0; - } else { # try to parse a function pointer argument - if ((argp = match($0, - /\(\*[A-Za-z0-9_]+\)\([A-Za-z0-9_*, ]+\)$/)) < 1) - die("Missing var name \"a_foo\" in \"%s\".", - $0); - args[numargs] = substr($0, argp + 2); - sub(/\).+/, "", args[numargs]); - fargs[numargs] = substr($0, argp); - sub(/^\([^)]+\)/, "", fargs[numargs]); - $0 = substr($0, 1, argp - 1); - sub(/ $/, ""); - types[numargs] = $0; - } + # pick off variable name + if ((argp = match($0, /[A-Za-z0-9_]+$/)) < 1) + die("Missing var name \"a_foo\" in \"%s\".", $0); + args[numargs] = substr($0, argp); + $0 = substr($0, 1, argp - 1); + + # what is left must be type + # remove trailing space (if any) + sub(/ $/, ""); + types[numargs] = $0; } if (numargs > 4) ctrargs = 4; @@ -296,13 +286,8 @@ while ((getline < srcfile) > 0) { if (hfile) { # Print out the vop_F_args structure. printh("struct "name"_args {\n\tstruct vop_generic_args a_gen;"); - for (i = 0; i < numargs; ++i) { - if (fargs[i]) { - printh("\t" t_spc(types[i]) "(*a_" args[i] \ - ")" fargs[i] ";"); - } else - printh("\t" t_spc(types[i]) "a_" args[i] ";"); - } + for (i = 0; i < numargs; ++i) + printh("\t" t_spc(types[i]) "a_" args[i] ";"); printh("};"); printh(""); @@ -316,14 +301,8 @@ while ((getline < srcfile) > 0) { printh(""); printh("static __inline int " uname "("); for (i = 0; i < numargs; ++i) { - if (fargs[i]) { - printh("\t" t_spc(types[i]) "(*" args[i] \ - ")" fargs[i] \ - (i < numargs - 1 ? "," : ")")); - } else { - printh("\t" t_spc(types[i]) args[i] \ - (i < numargs - 1 ? "," : ")")); - } + printh("\t" t_spc(types[i]) args[i] \ + (i < numargs - 1 ? "," : ")")); } printh("{"); printh("\tstruct " name "_args a;");