From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 16:54:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7599E1065670; Mon, 14 Dec 2009 16:54:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 631148FC13; Mon, 14 Dec 2009 16:54:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBEGsdV2032118; Mon, 14 Dec 2009 16:54:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBEGsdWk032116; Mon, 14 Dec 2009 16:54:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912141654.nBEGsdWk032116@svn.freebsd.org> From: Xin LI Date: Mon, 14 Dec 2009 16:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200515 - head/usr.bin/xinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 16:54:39 -0000 Author: delphij Date: Mon Dec 14 16:54:39 2009 New Revision: 200515 URL: http://svn.freebsd.org/changeset/base/200515 Log: Style improvements: - Sort function prototypes; - Apply static on all function bodies. To quote bde@: > It is a good obfuscation to declare functions as static only in the > prototype, so that you can't see the static for the actual function. > The reverse obfuscation (with static only in the function definition) > would make more sense, but is a constraint error. Reviewed by: bde Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Mon Dec 14 15:32:32 2009 (r200514) +++ head/usr.bin/xinstall/xinstall.c Mon Dec 14 16:54:39 2009 (r200515) @@ -85,8 +85,8 @@ int dobackup, docompare, dodir, dopreser mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; const char *suffix = BACKUP_SUFFIX; -static void copy(int, const char *, int, const char *, off_t); static int compare(int, const char *, size_t, int, const char *, size_t); +static void copy(int, const char *, int, const char *, off_t); static int create_newfile(const char *, int, struct stat *); static int create_tempfile(const char *, char *, size_t); static void install(const char *, const char *, u_long, u_int); @@ -246,7 +246,7 @@ main(int argc, char *argv[]) /* NOTREACHED */ } -u_long +static u_long numeric_id(const char *name, const char *type) { u_long val; @@ -269,7 +269,7 @@ numeric_id(const char *name, const char * install -- * build a path name and install the file */ -void +static void install(const char *from_name, const char *to_name, u_long fset, u_int flags) { struct stat from_sb, temp_sb, to_sb; @@ -523,7 +523,7 @@ install(const char *from_name, const cha * compare -- * compare two files; non-zero means files differ */ -int +static int compare(int from_fd, const char *from_name __unused, size_t from_len, int to_fd, const char *to_name __unused, size_t to_len) { @@ -587,7 +587,7 @@ compare(int from_fd, const char *from_na * create_tempfile -- * create a temporary file based on path and open it */ -int +static int create_tempfile(const char *path, char *temp, size_t tsize) { char *p; @@ -607,7 +607,7 @@ create_tempfile(const char *path, char * * create_newfile -- * create a new file, overwriting an existing one if necessary */ -int +static int create_newfile(const char *path, int target, struct stat *sbp) { char backup[MAXPATHLEN]; @@ -650,7 +650,7 @@ create_newfile(const char *path, int tar * copy -- * copy from one file to another */ -void +static void copy(int from_fd, const char *from_name, int to_fd, const char *to_name, off_t size) { @@ -703,7 +703,7 @@ copy(int from_fd, const char *from_name, * strip -- * use strip(1) to strip the target file */ -void +static void strip(const char *to_name) { const char *stripbin; @@ -735,7 +735,7 @@ strip(const char *to_name) * install_dir -- * build directory heirarchy */ -void +static void install_dir(char *path) { char *p; @@ -769,7 +769,7 @@ install_dir(char *path) * usage -- * print a usage message and die */ -void +static void usage(void) { (void)fprintf(stderr, @@ -786,7 +786,7 @@ usage(void) * trymmap -- * return true (1) if mmap should be tried, false (0) if not. */ -int +static int trymmap(int fd) { /*