X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Bill Meier <wmeier@newsguy.com>
Subject:  Re: Cygwin setup: DL rate should show as  kB/s not kb/s ?
Date: Wed, 20 Feb 2008 15:16:26 +0000 (UTC)
Lines: 56
Message-ID:  <loom.20080220T144900-251@post.gmane.org>
References:  <200802181525.m1IFPlBS035653@member.newsguy.com> <001601c8729a$8b72dd70$020aa8c0@DFW5RB41>
Mime-Version:  1.0
Content-Type:  text/plain; charset=us-ascii
Content-Transfer-Encoding:  7bit
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Gary R. Van Sickle <g.r.vansickle <at> worldnet.att.net> writes:

> 
> > From:  Bill Meier
> > or maybe KB/s for kilobytes/sec ?
> > 
> 
> It should be an option, but that begs an "Options..." dialog, which doesn't
> exist.
> 


Unfortunately I didn't express myself clearly in my original message.

The numeric DLL rate shown by the Cygwin setup program is actually in units of 
K Bytes/sec and thus either kB/s or KB/s should be used as the text following
the numeric rate.

Looking at the code I also note that maybe the 2nd sprintf should be changed to
use %03.1f to be consistent with the 1st sprintf ...

Bill Meier


=================================================================
From geturl.cc


static void
progress (int bytes)
{
  if (is_local_install)
    return;
  static char buf[100];
  double kbps;

<snip>

  kbps = ((double)bytes) / (double)(tics - start_tics);
  if (max_bytes > 0)
    {
      int perc = (int)(100.0 * ((double)bytes) / (double)max_bytes);
      Progress.SetBar1(bytes, max_bytes);
      sprintf (buf, "%d %%  (%dk/%dk)  %03.1f kb/s",
	       perc, bytes / 1000, max_bytes / 1000, kbps);
      if (total_download_bytes > 0)
     	  Progress.SetBar2(total_download_bytes_sofar + bytes,
			   total_download_bytes);
    }
  else
    sprintf (buf, "%d  %2.1f kb/s", bytes, kbps);

  Progress.SetText3(buf);
}




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

