From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32146 invoked by alias); 7 Sep 2006 14:58:22 -0000 Received: (qmail 32133 invoked by uid 22791); 7 Sep 2006 14:58:21 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 07 Sep 2006 14:58:19 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GLLK7-0004a0-5P for gdb-patches@sources.redhat.com; Thu, 07 Sep 2006 16:57:47 +0200 Received: from wind.lvk.cs.msu.su ([158.250.17.9]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Sep 2006 16:57:47 +0200 Received: from ghost by wind.lvk.cs.msu.su with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Sep 2006 16:57:47 +0200 To: gdb-patches@sources.redhat.com From: Vladimir Prus Subject: Re: "Transfer rate" patch Date: Thu, 07 Sep 2006 14:58:00 -0000 Message-ID: References: <44FD2640.7080605@ronetix.at> <45002AB3.7090402@ronetix.at> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8Bit User-Agent: KNode/0.10.2 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-09/txt/msg00029.txt.bz2 Ilko Iliev wrote: [snip quoted entire previous patch] > --- ChangeLog.orig      2006-09-07 15:23:19.000000000 +0200 > +++ ChangeLog   2006-09-07 15:27:46.000000000 +0200 > @@ -1,3 +1,8 @@ > +2006-09-07  Ilko Iliev > + > +       * symfile.c (print_transfer_performance): Fix overflow problem > +        and change bits/sec to KBytes/sec or bytes/sec > + > 2006-08-28  DJ Delorie   > > * m32c-tdep.c (m32c_decode_srcdest4): Initialize fields in sd > > > > --- symfile.c.orig      2006-08-31 15:29:12.000000000 +0200 > +++ symfile.c   2006-09-07 15:19:45.000000000 +0200 > @@ -1769,14 +1769,23 @@ > ui_out_text (uiout, "Transfer rate: "); > if (time_count > 0) > { > -      ui_out_field_fmt (uiout, "transfer-rate", "%lu", > -                       1000 * (data_count * 8) / time_count); > -      ui_out_text (uiout, " bits/sec"); > +      if ( data_count < 1024 ) > +        { > +          ui_out_field_fmt (uiout, "transfer-rate", "%lu", > +            (unsigned long)((((unsigned long long)data_count) * 1000) / > time_count)); I think the above line is longer than 80 characters, and that's probably not OK. Also, I think this branch should be taken if download speed is smaller that 1024 bytes *per second*, not when total download size is less than 1024 bytes. - Volodya