summaryrefslogtreecommitdiff
path: root/lib/connect.c
diff options
context:
space:
mode:
authorMarcel Raad <raad@teamviewer.com>2016-11-18 10:07:08 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-11-18 10:11:55 +0100
commit21aa32d30dbf319f2d336e0cb68d3a3235869fbb (patch)
treef8dc171c75e56b4b96254c87c60a37cd2f34273f /lib/connect.c
parent0b8d682f81ee9acb763dd4c9ad805fe08d1227c0 (diff)
downloadcurl-21aa32d30dbf319f2d336e0cb68d3a3235869fbb.tar.gz
lib: fix compiler warnings after de4de4e3c7c
Visual C++ now complains about implicitly casting time_t (64-bit) to long (32-bit). Fix this by changing some variables from long to time_t, or explicitly casting to long where the public interface would be affected. Closes #1131
Diffstat (limited to 'lib/connect.c')
-rw-r--r--lib/connect.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/connect.c b/lib/connect.c
index 3df34d94a..d87951c88 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -179,12 +179,12 @@ singleipconnect(struct connectdata *conn,
*
* @unittest: 1303
*/
-long Curl_timeleft(struct Curl_easy *data,
- struct timeval *nowp,
- bool duringconnect)
+time_t Curl_timeleft(struct Curl_easy *data,
+ struct timeval *nowp,
+ bool duringconnect)
{
int timeout_set = 0;
- long timeout_ms = duringconnect?DEFAULT_CONNECT_TIMEOUT:0;
+ time_t timeout_ms = duringconnect?DEFAULT_CONNECT_TIMEOUT:0;
struct timeval now;
/* if a timeout is set, use the most restrictive one */
@@ -722,7 +722,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
{
struct Curl_easy *data = conn->data;
CURLcode result = CURLE_OK;
- long allow;
+ time_t allow;
int error = 0;
struct timeval now;
int rc;
@@ -1153,7 +1153,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
struct timeval before = Curl_tvnow();
CURLcode result = CURLE_COULDNT_CONNECT;
- long timeout_ms = Curl_timeleft(data, &before, TRUE);
+ time_t timeout_ms = Curl_timeleft(data, &before, TRUE);
if(timeout_ms < 0) {
/* a precaution, no need to continue if time already is up */