From owner-freebsd-bugs@FreeBSD.ORG Tue Oct 5 15:40:22 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7D3E216A4CE for ; Tue, 5 Oct 2004 15:40:22 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E8DF43D45 for ; Tue, 5 Oct 2004 15:40:22 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i95FeMhF082630 for ; Tue, 5 Oct 2004 15:40:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i95FeMC8082625; Tue, 5 Oct 2004 15:40:22 GMT (envelope-from gnats) Resent-Date: Tue, 5 Oct 2004 15:40:22 GMT Resent-Message-Id: <200410051540.i95FeMC8082625@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Giorgos Keramidas Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CDD4416A4CE for ; 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 ; 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])i95FXw4j001077 for ; Tue, 5 Oct 2004 18:33:58 +0300 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) i95FXvSL062672 for ; Tue, 5 Oct 2004 18:33:57 +0300 (EEST) (envelope-from keramida@orion.daedalusnetworks.priv) Received: (from keramida@localhost)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 To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: misc/72357: WARNS?=5 cleanup for src/tools/tools/netrate X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Giorgos Keramidas List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2004 15:40:22 -0000 >Number: 72357 >Category: misc >Synopsis: WARNS?=5 cleanup for src/tools/tools/netrate >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Oct 05 15:40:21 GMT 2004 >Closed-Date: >Last-Modified: >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 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: >Unformatted: