Differences From Artifact [e84b0f1e4e]:
- File utils/ofhttp/ProgressBar.m — part of check-in [a3f24bdd18] at 2015-06-17 22:19:50 on branch trunk — utils/ofhttp: Make old Apple GCC happy (user: js, size: 5340) [annotate] [blame] [check-ins using]
To Artifact [84262304c6]:
- File
utils/ofhttp/ProgressBar.m
— part of check-in
[2a27cf3000]
at
2016-01-03 00:41:26
on branch trunk
— Update copyright
While at it, also update the mail address. (user: js, size: 5409) [annotate] [blame] [check-ins using] [more...]
1 | /* | | | > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | /* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 * Jonathan Schleifer <js@heap.zone> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" #include <math.h> #include <unistd.h> #ifdef HAVE_SYS_IOCTL_H # include <sys/ioctl.h> #endif #ifdef HAVE_SYS_TERMIOS_H # include <sys/termios.h> #endif #import "OFDate.h" #import "OFStdIOStream.h" #import "OFTimer.h" #import "ProgressBar.h" |
︙ | ︙ | |||
202 203 204 205 206 207 208 | [self _drawReceived]; } - (void)calculateBPSAndETA { _BPS = (float)(_received - _lastReceived) / -(float)[_lastReceivedDate timeIntervalSinceNow]; | | | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | [self _drawReceived]; } - (void)calculateBPSAndETA { _BPS = (float)(_received - _lastReceived) / -(float)[_lastReceivedDate timeIntervalSinceNow]; _ETA = (double)(_length - _received) / _BPS; _lastReceived = _received; [_lastReceivedDate release]; _lastReceivedDate = [[OFDate alloc] init]; } - (void)stop |
︙ | ︙ |