From owner-svn-src-all@FreeBSD.ORG Sun Nov 6 18:49:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 807941065799; Sun, 6 Nov 2011 18:49:16 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5235A8FC19; Sun, 6 Nov 2011 18:49:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6InG6R035912; Sun, 6 Nov 2011 18:49:16 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6InG1V035910; Sun, 6 Nov 2011 18:49:16 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061849.pA6InG1V035910@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 18:49:16 +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: r227236 - head/usr.bin/compress X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 18:49:16 -0000 Author: ed Date: Sun Nov 6 18:49:16 2011 New Revision: 227236 URL: http://svn.freebsd.org/changeset/base/227236 Log: Mark global functions and/or variables in compress(1) static where possible. This allows compilers and static analyzers to more thorough analysis. Modified: head/usr.bin/compress/compress.c Modified: head/usr.bin/compress/compress.c ============================================================================== --- head/usr.bin/compress/compress.c Sun Nov 6 18:49:10 2011 (r227235) +++ head/usr.bin/compress/compress.c Sun Nov 6 18:49:16 2011 (r227236) @@ -56,15 +56,15 @@ __FBSDID("$FreeBSD$"); #include "zopen.h" -void compress(const char *, const char *, int); -void cwarn(const char *, ...) __printflike(1, 2); -void cwarnx(const char *, ...) __printflike(1, 2); -void decompress(const char *, const char *, int); -int permission(const char *); -void setfile(const char *, struct stat *); -void usage(int); +static void compress(const char *, const char *, int); +static void cwarn(const char *, ...) __printflike(1, 2); +static void cwarnx(const char *, ...) __printflike(1, 2); +static void decompress(const char *, const char *, int); +static int permission(const char *); +static void setfile(const char *, struct stat *); +static void usage(int); -int eval, force, verbose; +static int eval, force, verbose; int main(int argc, char *argv[]) @@ -191,7 +191,7 @@ main(int argc, char *argv[]) exit (eval); } -void +static void compress(const char *in, const char *out, int bits) { size_t nr; @@ -281,7 +281,7 @@ err: if (ofp) { (void)fclose(ifp); } -void +static void decompress(const char *in, const char *out, int bits) { size_t nr; @@ -357,7 +357,7 @@ err: if (ofp) { (void)fclose(ifp); } -void +static void setfile(const char *name, struct stat *fs) { static struct timeval tv[2]; @@ -387,7 +387,7 @@ setfile(const char *name, struct stat *f cwarn("chflags: %s", name); } -int +static int permission(const char *fname) { int ch, first; @@ -401,7 +401,7 @@ permission(const char *fname) return (first == 'y'); } -void +static void usage(int iscompress) { if (iscompress) @@ -413,7 +413,7 @@ usage(int iscompress) exit(1); } -void +static void cwarnx(const char *fmt, ...) { va_list ap; @@ -424,7 +424,7 @@ cwarnx(const char *fmt, ...) eval = 1; } -void +static void cwarn(const char *fmt, ...) { va_list ap;