Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Nov 2011 18:49:36 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r227239 - head/usr.bin/fstat
Message-ID:  <201111061849.pA6Inadi036029@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Sun Nov  6 18:49:36 2011
New Revision: 227239
URL: http://svn.freebsd.org/changeset/base/227239

Log:
  Mark global functions and/or variables in fstat(1) static where possible.
  
  This allows compilers and static analyzers to more thorough analysis.

Modified:
  head/usr.bin/fstat/fstat.c
  head/usr.bin/fstat/fuser.c

Modified: head/usr.bin/fstat/fstat.c
==============================================================================
--- head/usr.bin/fstat/fstat.c	Sun Nov  6 18:49:30 2011	(r227238)
+++ head/usr.bin/fstat/fstat.c	Sun Nov  6 18:49:36 2011	(r227239)
@@ -57,13 +57,13 @@ __FBSDID("$FreeBSD$");
 
 #include "functions.h"
 
-int 	fsflg,	/* show files on same filesystem as file(s) argument */
-	pflg,	/* show files open by a particular pid */
-	uflg;	/* show files open by a particular (effective) user */
-int 	checkfile; /* true if restricting to particular files or filesystems */
-int	nflg;	/* (numerical) display f.s. and rdev as dev_t */
-int	mflg;	/* include memory-mapped files */
-int	vflg;	/* be verbose */
+static int 	fsflg,	/* show files on same filesystem as file(s) argument */
+		pflg,	/* show files open by a particular pid */
+		uflg;	/* show files open by a particular (effective) user */
+static int 	checkfile; /* restrict to particular files or filesystems */
+static int	nflg;	/* (numerical) display f.s. and rdev as dev_t */
+static int	mflg;	/* include memory-mapped files */
+static int	vflg;	/* be verbose */
 
 typedef struct devs {
 	struct devs	*next;
@@ -72,8 +72,8 @@ typedef struct devs {
 	const char	*name;
 } DEVS;
 
-DEVS *devs;
-char *memf, *nlistf;
+static DEVS *devs;
+static char *memf, *nlistf;
 
 static int	getfname(const char *filename);
 static void	dofiles(struct procstat *procstat, struct kinfo_proc *p);

Modified: head/usr.bin/fstat/fuser.c
==============================================================================
--- head/usr.bin/fstat/fuser.c	Sun Nov  6 18:49:30 2011	(r227238)
+++ head/usr.bin/fstat/fuser.c	Sun Nov  6 18:49:36 2011	(r227239)
@@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$");
 /*
  * File access mode flags table.
  */
-struct {
+static const struct {
 	int	flag;
 	char	ch;
 } fflags[] = {
@@ -67,7 +67,7 @@ struct {
 /*
  * Usage flags translation table.
  */
-struct {
+static const struct {
 	int	flag;
 	char	ch;
 } uflags[] = {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111061849.pA6Inadi036029>