[Midnightbsd-cvs] src [11268] trunk/usr.bin/tsort/tsort.c: make functions static

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Tue Jul 3 19:58:14 EDT 2018


Revision: 11268
          http://svnweb.midnightbsd.org/src/?rev=11268
Author:   laffer1
Date:     2018-07-03 19:58:14 -0400 (Tue, 03 Jul 2018)
Log Message:
-----------
make functions static

Modified Paths:
--------------
    trunk/usr.bin/tsort/Makefile
    trunk/usr.bin/tsort/tsort.1
    trunk/usr.bin/tsort/tsort.c

Property Changed:
----------------
    trunk/usr.bin/tsort/tsort.1

Modified: trunk/usr.bin/tsort/Makefile
===================================================================
--- trunk/usr.bin/tsort/Makefile	2018-07-03 23:57:35 UTC (rev 11267)
+++ trunk/usr.bin/tsort/Makefile	2018-07-03 23:58:14 UTC (rev 11268)
@@ -1,5 +1,6 @@
+# $MidnightBSD$
 #	@(#)Makefile	8.1 (Berkeley) 6/9/93
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/tsort/Makefile 87714 2001-12-12 00:06:52Z markm $
 
 PROG=	tsort
 

Modified: trunk/usr.bin/tsort/tsort.1
===================================================================
--- trunk/usr.bin/tsort/tsort.1	2018-07-03 23:57:35 UTC (rev 11267)
+++ trunk/usr.bin/tsort/tsort.1	2018-07-03 23:58:14 UTC (rev 11268)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
 .\" Copyright (c) 1990, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -29,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)tsort.1	8.3 (Berkeley) 4/1/94
-.\" $MidnightBSD$
+.\" $FreeBSD: stable/10/usr.bin/tsort/tsort.1 216370 2010-12-11 08:32:16Z joel $
 .\"
 .Dd December 27, 2006
 .Dt TSORT 1


Property changes on: trunk/usr.bin/tsort/tsort.1
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/tsort/tsort.c
===================================================================
--- trunk/usr.bin/tsort/tsort.c	2018-07-03 23:57:35 UTC (rev 11267)
+++ trunk/usr.bin/tsort/tsort.c	2018-07-03 23:58:14 UTC (rev 11268)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 1989, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -41,7 +42,7 @@
 #endif /* not lint */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/tsort/tsort.c 227189 2011-11-06 08:17:47Z ed $");
 
 #include <sys/types.h>
 
@@ -96,18 +97,18 @@
 	int b_bsize;
 } BUF;
 
-DB *db;
-NODE *graph, **cycle_buf, **longest_cycle;
-int debug, longest, quiet;
+static DB *db;
+static NODE *graph, **cycle_buf, **longest_cycle;
+static int debug, longest, quiet;
 
-void	 add_arc(char *, char *);
-int	 find_cycle(NODE *, NODE *, int, int);
-NODE	*get_node(char *);
-void	*grow_buf(void *, size_t);
-void	 remove_node(NODE *);
-void	 clear_cycle(void);
-void	 tsort(void);
-void	 usage(void);
+static void	 add_arc(char *, char *);
+static int	 find_cycle(NODE *, NODE *, int, int);
+static NODE	*get_node(char *);
+static void	*grow_buf(void *, size_t);
+static void	 remove_node(NODE *);
+static void	 clear_cycle(void);
+static void	 tsort(void);
+static void	 usage(void);
 
 int
 main(int argc, char *argv[])
@@ -185,7 +186,7 @@
 }
 
 /* double the size of oldbuf and return a pointer to the new buffer. */
-void *
+static void *
 grow_buf(void *bp, size_t size)
 {
 	if ((bp = realloc(bp, size)) == NULL)
@@ -197,7 +198,7 @@
  * add an arc from node s1 to node s2 in the graph.  If s1 or s2 are not in
  * the graph, then add them.
  */
-void
+static void
 add_arc(char *s1, char *s2)
 {
 	NODE *n1;
@@ -232,7 +233,7 @@
 }
 
 /* Find a node in the graph (insert if not found) and return a pointer to it. */
-NODE *
+static NODE *
 get_node(char *name)
 {
 	DBT data, key;
@@ -284,7 +285,7 @@
 /*
  * Clear the NODEST flag from all nodes.
  */
-void
+static void
 clear_cycle(void)
 {
 	NODE *n;
@@ -294,7 +295,7 @@
 }
 
 /* do topological sort on graph */
-void
+static void
 tsort(void)
 {
 	NODE *n, *next;
@@ -357,7 +358,7 @@
 }
 
 /* print node and remove from graph (does not actually free node) */
-void
+static void
 remove_node(NODE *n)
 {
 	NODE **np;
@@ -374,7 +375,7 @@
 
 
 /* look for the longest? cycle from node from to node to. */
-int
+static int
 find_cycle(NODE *from, NODE *to, int longest_len, int depth)
 {
 	NODE **np;
@@ -420,7 +421,7 @@
 	return (longest_len);
 }
 
-void
+static void
 usage(void)
 {
 	(void)fprintf(stderr, "usage: tsort [-dlq] [file]\n");



More information about the Midnightbsd-cvs mailing list