svn commit: r227241 - head/usr.bin/m4

Ed Schouten ed at FreeBSD.org
Sun Nov 6 18:49:49 UTC 2011


Author: ed
Date: Sun Nov  6 18:49:48 2011
New Revision: 227241
URL: http://svn.freebsd.org/changeset/base/227241

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

Modified:
  head/usr.bin/m4/gnum4.c
  head/usr.bin/m4/main.c

Modified: head/usr.bin/m4/gnum4.c
==============================================================================
--- head/usr.bin/m4/gnum4.c	Sun Nov  6 18:49:41 2011	(r227240)
+++ head/usr.bin/m4/gnum4.c	Sun Nov  6 18:49:48 2011	(r227241)
@@ -60,7 +60,7 @@ int mimic_gnu = 0;
  * Then M4PATH env variable
  */
 
-struct path_entry {
+static struct path_entry {
 	char *name;
 	struct path_entry *next;
 } *first, *last;

Modified: head/usr.bin/m4/main.c
==============================================================================
--- head/usr.bin/m4/main.c	Sun Nov  6 18:49:41 2011	(r227240)
+++ head/usr.bin/m4/main.c	Sun Nov  6 18:49:48 2011	(r227241)
@@ -99,7 +99,7 @@ char scommt[MAXCCHARS+1] = {SCOMMT};	/* 
 char ecommt[MAXCCHARS+1] = {ECOMMT};	/* end character for comment   */
 int synccpp;			/* Line synchronisation for C preprocessor */
 
-struct keyblk keywrds[] = {	/* m4 keywords to be installed */
+static const struct keyblk keywrds[] = { /* m4 keywords to be installed */
 	{ "include",      INCLTYPE },
 	{ "sinclude",     SINCTYPE },
 	{ "define",       DEFITYPE },


More information about the svn-src-head mailing list