From keramida@bytemobile.com  Tue Oct  5 15:34:04 2004
Return-Path: <keramida@bytemobile.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id CDD4416A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  5 Oct 2004 15:34:04 +0000 (GMT)
Received: from rosebud.otenet.gr (rosebud.otenet.gr [195.170.0.26])
	by mx1.FreeBSD.org (Postfix) with ESMTP id E708743D1D
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  5 Oct 2004 15:33:59 +0000 (GMT)
	(envelope-from keramida@bytemobile.com)
Received: from orion.daedalusnetworks.priv (host5.bedc.ondsl.gr [62.103.39.229])
	by rosebud.otenet.gr (8.13.1/8.13.1/Debian-13.OTEnet.1) with SMTP id i95FXw4j001077
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 5 Oct 2004 18:33:58 +0300
Received: from orion.daedalusnetworks.priv (orion [127.0.0.1])
	by orion.daedalusnetworks.priv (8.13.1/8.13.1) with ESMTP id i95FXvSL062672
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 5 Oct 2004 18:33:57 +0300 (EEST)
	(envelope-from keramida@orion.daedalusnetworks.priv)
Received: (from keramida@localhost)
	by orion.daedalusnetworks.priv (8.13.1/8.13.1/Submit) id i95FXv3V062671;
	Tue, 5 Oct 2004 18:33:57 +0300 (EEST)
	(envelope-from keramida)
Message-Id: <200410051533.i95FXv3V062671@orion.daedalusnetworks.priv>
Date: Tue, 5 Oct 2004 18:33:57 +0300 (EEST)
From: Giorgos Keramidas <keramida@freebsd.org>
Reply-To: Giorgos Keramidas <keramida@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: WARNS?=5 cleanup for src/tools/tools/netrate
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         72357
>Category:       bin
>Synopsis:       [patch] WARNS?=5 cleanup for src/tools/tools/netrate
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 05 15:40:21 GMT 2004
>Closed-Date:    Thu Jun 22 19:53:47 GMT 2006
>Last-Modified:  Thu Jun 22 19:53:47 GMT 2006
>Originator:     Giorgos Keramidas
>Release:        FreeBSD 6.0-CURRENT i386
>Organization:
>Environment:

System: FreeBSD orion.daedalusnetworks.priv 6.0-CURRENT \
FreeBSD 6.0-CURRENT #1: Tue Oct 5 13:10:47 EEST 2004 \
root@xxx:/usr/obj/usr/src/sys/GENERIC i386

>Description:

        The attached diff fixes a few warnings in src/tools/tools/netrate
        letting both netsend and netreceive build with WARNS=5

>How-To-Repeat:

        Build netrate with: make WARNS?=5

>Fix:

--- patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/src/tools/tools/netrate/Makefile,v
retrieving revision 1.2
diff -u -u -r1.2 Makefile
--- Makefile	20 Sep 2004 14:04:00 -0000	1.2
+++ Makefile	5 Oct 2004 15:30:32 -0000
@@ -4,4 +4,6 @@
 
 SUBDIR=	netreceive netsend
 
+WARNS?= 5
+
 .include <bsd.subdir.mk>
Index: netsend/netsend.c
===================================================================
RCS file: /home/ncvs/src/tools/tools/netrate/netsend/netsend.c,v
retrieving revision 1.3
diff -u -u -r1.3 netsend.c
--- netsend/netsend.c	21 Sep 2004 20:21:40 -0000	1.3
+++ netsend/netsend.c	5 Oct 2004 15:30:32 -0000
@@ -80,7 +80,7 @@
  * to the caller.  Optionally also increment a counter provided by the
  * caller each time we loop.
  */
-int
+static int
 wait_time(struct timespec ts, struct timespec *wakeup_ts, long long *waited)
 {
 	struct timespec curtime;
@@ -114,7 +114,7 @@
  * wait between our calculated interval and dropping the provided packet
  * into the socket.  If we hit our duration limit, bail.
  */
-int
+static int
 timing_loop(int s, struct timespec interval, long duration, u_char *packet,
     u_int packet_len)
 {
@@ -122,7 +122,7 @@
 	long long waited;
 	u_int32_t counter;
 	long finishtime;
-	int send_errors, send_calls;
+	long send_errors, send_calls;
 
 	if (clock_getres(CLOCK_REALTIME, &tmptime) == -1) {
 		perror("clock_getres");
@@ -190,8 +190,8 @@
 	    starttime.tv_nsec);
 	printf("finish:            %d.%09lu\n", tmptime.tv_sec,
 	    tmptime.tv_nsec);
-	printf("send calls:        %d\n", send_calls);
-	printf("send errors:       %d\n", send_errors);
+	printf("send calls:        %ld\n", send_calls);
+	printf("send errors:       %ld\n", send_errors);
 	printf("approx send rate:  %ld\n", (send_calls - send_errors) /
 	    duration);
 	printf("approx error rate: %ld\n", (send_errors / send_calls));
--- patch ends here ---
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: matteo 
State-Changed-When: Thu Jun 22 19:53:24 UTC 2006 
State-Changed-Why:  
This has already been fixed. Thanks 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72357 
>Unformatted:
