explicit typecasts to double to prevent warnings about implicit conversions
that might lose accuracy
This commit is contained in:
parent
2046a6b9e5
commit
aedadfc779
@ -274,13 +274,13 @@ int Curl_pgrsUpdate(struct connectdata *conn)
|
|||||||
|
|
||||||
/* The average download speed this far */
|
/* The average download speed this far */
|
||||||
data->progress.dlspeed = (curl_off_t)
|
data->progress.dlspeed = (curl_off_t)
|
||||||
(data->progress.downloaded/(data->progress.timespent>0?
|
((double)data->progress.downloaded/
|
||||||
data->progress.timespent:1));
|
(data->progress.timespent>0?data->progress.timespent:1));
|
||||||
|
|
||||||
/* The average upload speed this far */
|
/* The average upload speed this far */
|
||||||
data->progress.ulspeed = (curl_off_t)
|
data->progress.ulspeed = (curl_off_t)
|
||||||
(data->progress.uploaded/(data->progress.timespent>0?
|
((double)data->progress.uploaded/
|
||||||
data->progress.timespent:1));
|
(data->progress.timespent>0?data->progress.timespent:1));
|
||||||
|
|
||||||
if(data->progress.lastshow == Curl_tvlong(now))
|
if(data->progress.lastshow == Curl_tvlong(now))
|
||||||
return 0; /* never update this more than once a second if the end isn't
|
return 0; /* never update this more than once a second if the end isn't
|
||||||
@ -332,7 +332,7 @@ int Curl_pgrsUpdate(struct connectdata *conn)
|
|||||||
/* the 'amount' value is bigger than would fit in 32 bits if
|
/* the 'amount' value is bigger than would fit in 32 bits if
|
||||||
multiplied with 1000, so we use the double math for this */
|
multiplied with 1000, so we use the double math for this */
|
||||||
data->progress.current_speed = (curl_off_t)
|
data->progress.current_speed = (curl_off_t)
|
||||||
(amount/(span_ms/1000.0));
|
((double)amount/(span_ms/1000.0));
|
||||||
else
|
else
|
||||||
/* the 'amount' value is small enough to fit within 32 bits even
|
/* the 'amount' value is small enough to fit within 32 bits even
|
||||||
when multiplied with 1000 */
|
when multiplied with 1000 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user