Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Dec 2009 12:23:48 +0000 (UTC)
From:      Luigi Rizzo <luigi@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r200056 - head/sbin/ipfw
Message-ID:  <200912031223.nB3CNmtM007730@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: luigi
Date: Thu Dec  3 12:23:48 2009
New Revision: 200056
URL: http://svn.freebsd.org/changeset/base/200056

Log:
  use qsort_r instead of heapsort;
  staticize two functions.
  
  MFC after:	3 days

Modified:
  head/sbin/ipfw/dummynet.c

Modified: head/sbin/ipfw/dummynet.c
==============================================================================
--- head/sbin/ipfw/dummynet.c	Thu Dec  3 11:16:53 2009	(r200055)
+++ head/sbin/ipfw/dummynet.c	Thu Dec  3 12:23:48 2009	(r200056)
@@ -78,7 +78,7 @@ static struct _s_x dummynet_params[] = {
 };
 
 static int
-sort_q(const void *pa, const void *pb)
+sort_q(void *arg, const void *pa, const void *pb)
 {
 	int rev = (co.do_sort < 0);
 	int field = rev ? -co.do_sort : co.do_sort;
@@ -121,7 +121,7 @@ list_queues(struct dn_flow_set *fs, stru
 		return;
 
 	if (co.do_sort != 0)
-		heapsort(q, fs->rq_elements, sizeof *q, sort_q);
+		qsort_r(q, fs->rq_elements, sizeof *q, NULL, sort_q);
 
 	/* Print IPv4 flows */
 	index_printed = 0;
@@ -486,7 +486,7 @@ is_valid_number(const char *s)
  * and return the numeric bandwidth value.
  * set clocking interface or bandwidth value
  */
-void
+static void
 read_bandwidth(char *arg, int *bandwidth, char *if_name, int namelen)
 {
 	if (*bandwidth != -1)
@@ -530,7 +530,7 @@ struct point {
 	double delay;
 };
 
-int
+static int
 compare_points(const void *vp1, const void *vp2)
 {
 	const struct point *p1 = vp1;



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