[ntpsec commit] Forward-port util/ hist.c to modern C and write a build recipe for it.

Eric S. Raymond esr at ntpsec.org
Wed Sep 30 15:40:47 UTC 2015


Module:    ntpsec
Branch:    master
Commit:    1125dea607b63f880f07e4b4240fef3ae287360d
Changeset: http://git.ntpsec.org/ntpsec/commit/?id=1125dea607b63f880f07e4b4240fef3ae287360d

Author:    Eric S. Raymond <esr at thyrsus.com>
Date:      Wed Sep 30 11:35:33 2015 -0400

Forward-port util/hist.c to modern C and write a build recipe for it.

---

 util/hist.c  | 10 +++++-----
 util/wscript |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/util/hist.c b/util/hist.c
index e41a880..c4d0642 100644
--- a/util/hist.c
+++ b/util/hist.c
@@ -26,7 +26,7 @@ main(
 	char *argv[]
 	)
 {
-	struct timeval ts, tr, tp;
+	struct timeval ts, tr;
 	struct timezone tzp;
 	int i, j, n;
 	long t, u, v, w, gtod[NBUF], ovfl[NSRT];
@@ -73,24 +73,24 @@ main(
 	 */
 	for (i = 0; i < NBUF - 1; i++) {
 		if (gtod[i] > 0)
-			printf("%ld %ld\n", i, gtod[i]);
+			printf("%d %ld\n", i, gtod[i]);
 	}
 	if (n == 0)
-		return;
+		exit(0);
 	qsort(&ovfl, (size_t)n, sizeof(ovfl[0]), col);
 	w = 0;
 	j = 0;
 	for (i = 0; i < n; i++) {
 		if (ovfl[i] != w) {
 			if (j > 0)
-				printf("%ld %ld\n", w, j);
+				printf("%ld %d\n", w, j);
 			w = ovfl[i];
 			j = 1;
 		} else
 			j++;
 	}
 	if (j > 0)
-		printf("%ld %ld\n", w, j);
+		printf("%ld %d\n", w, j);
  
 	exit(0);
 }
diff --git a/util/wscript b/util/wscript
index 7ef6ebb..614980c 100644
--- a/util/wscript
+++ b/util/wscript
@@ -26,7 +26,7 @@ def build(ctx):
 		install_path= "${PREFIX}/sbin/"
 	)
 
-	for name in ['precision', 'sht', 'testrs6000']:
+	for name in ['hist', 'precision', 'sht', 'testrs6000']:
 		ctx(
 			target		= name,
 			features	= "c cprogram bld_include src_include libisc_include",



More information about the vc mailing list