1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-24 09:08:49 -05:00

tests: fix narrowing conversion warnings

`timediff_t` is 64 bits wide also on 32-bit systems since
commit b1616dad8f.

Closes https://github.com/curl/curl/pull/4415
This commit is contained in:
Marcel Raad 2019-09-24 18:58:23 +02:00
parent c7e6b71e5a
commit 73089bf7f3
No known key found for this signature in database
GPG Key ID: FE4D8BC5EE1701DD
2 changed files with 3 additions and 3 deletions

View File

@ -68,7 +68,7 @@ struct timetest {
int timeout_ms;
int connecttimeout_ms;
bool connecting;
time_t result;
timediff_t result;
const char *comment;
};
@ -138,7 +138,7 @@ UNITTEST_START
data->progress.t_startop.tv_usec = 0;
for(i = 0; i < sizeof(run)/sizeof(run[0]); i++) {
time_t timeout;
timediff_t timeout;
NOW(run[i].now_s, run[i].now_us);
TIMEOUTS(run[i].timeout_ms, run[i].connecttimeout_ms);
timeout = Curl_timeleft(data, &now, run[i].connecting);

View File

@ -50,7 +50,7 @@ static void fake_t_startsingle_time(struct Curl_easy *data,
data->progress.t_startsingle.tv_usec = fake_now.tv_usec;
}
static bool usec_matches_seconds(time_t time_usec, int expected_seconds)
static bool usec_matches_seconds(timediff_t time_usec, int expected_seconds)
{
int time_sec = (int)(time_usec / usec_magnitude);
bool same = (time_sec == expected_seconds);