mirror of
https://github.com/curl/curl.git
synced 2025-01-18 14:04:30 +08:00
progress: make trspeed avoid floats
and compiler warnings for data conversions. Reported-by: Michał Antoniak Fixes #7645 Closes #7653
This commit is contained in:
parent
e8c8775eaa
commit
c905459e87
@ -377,7 +377,12 @@ static curl_off_t trspeed(curl_off_t size, /* number of bytes */
|
||||
{
|
||||
if(us < 1)
|
||||
return size * 1000000;
|
||||
return (curl_off_t)((long double)size/(long double)us * 1000000);
|
||||
else if(size < CURL_OFF_T_MAX/1000000)
|
||||
return (size * 1000000) / us;
|
||||
else if(us >= 1000000)
|
||||
return size / (us / 1000000);
|
||||
else
|
||||
return CURL_OFF_T_MAX;
|
||||
}
|
||||
|
||||
/* returns TRUE if it's time to show the progress meter */
|
||||
|
Loading…
Reference in New Issue
Block a user