diff --git a/lib/connect.c b/lib/connect.c index 46d7d8e14..ce3d40cf1 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -219,7 +219,7 @@ int waitconnect(curl_socket_t sockfd, /* socket */ FD_ZERO(&errfd); FD_SET(sockfd, &errfd); - interval.tv_sec = timeout_msec/1000; + interval.tv_sec = (int)(timeout_msec/1000); timeout_msec -= interval.tv_sec*1000; interval.tv_usec = timeout_msec*1000; @@ -674,7 +674,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */ *connected = FALSE; /* default to not connected */ if(data->set.timeout || data->set.connecttimeout) { - double has_passed; + long has_passed; /* Evaluate in milliseconds how much time that has passed */ has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.start); @@ -696,7 +696,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */ timeout_ms = data->set.connecttimeout*1000; /* subtract the passed time */ - timeout_ms -= (long)has_passed; + timeout_ms -= has_passed; if(timeout_ms < 0) { /* a precaution, no need to continue if time already is up */ diff --git a/lib/escape.c b/lib/escape.c index 18444d6a9..4466d4cc9 100644 --- a/lib/escape.c +++ b/lib/escape.c @@ -39,14 +39,15 @@ /* The last #include file should be: */ #include "memdebug.h" -char *curl_escape(const char *string, int length) +char *curl_escape(const char *string, int inlength) { - size_t alloc = (length?(size_t)length:strlen(string))+1; + size_t alloc = (inlength?(size_t)inlength:strlen(string))+1; char *ns; char *testing_ptr = NULL; unsigned char in; size_t newlen = alloc; int strindex=0; + size_t length; ns = malloc(alloc); if(!ns) diff --git a/lib/ssluse.c b/lib/ssluse.c index e70462211..7f568bb99 100644 --- a/lib/ssluse.c +++ b/lib/ssluse.c @@ -633,7 +633,7 @@ static int Store_SSL_Session(struct connectdata *conn, int i; struct SessionHandle *data=conn->data; /* the mother of all structs */ struct curl_ssl_session *store = &data->state.session[0]; - int oldest_age=data->state.session[0].age; /* zero if unused */ + long oldest_age=data->state.session[0].age; /* zero if unused */ char *clone_host; clone_host = strdup(conn->host.name); @@ -1351,7 +1351,7 @@ Curl_SSLConnect(struct connectdata *conn, /* we have been connected fine, get out of the connect loop */ break; - interval.tv_sec = timeout_ms/1000; + interval.tv_sec = (int)(timeout_ms/1000); timeout_ms -= interval.tv_sec*1000; interval.tv_usec = timeout_ms*1000; diff --git a/lib/telnet.c b/lib/telnet.c index aea4fdd82..472cd8f53 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -120,7 +120,8 @@ static void set_local_option(struct connectdata *, int cmd, int option); static void set_remote_option(struct connectdata *, int cmd, int option); static void printsub(struct SessionHandle *data, - int direction, unsigned char *pointer, int length); + int direction, unsigned char *pointer, + size_t length); static void suboption(struct connectdata *); /* For negotiation compliant to RFC 1143 */ @@ -663,9 +664,9 @@ void rec_dont(struct connectdata *conn, int option) static void printsub(struct SessionHandle *data, int direction, /* '<' or '>' */ unsigned char *pointer, /* where suboption data is */ - int length) /* length of suboption data */ + size_t length) /* length of suboption data */ { - int i = 0; + unsigned int i = 0; if (data->set.verbose) { diff --git a/lib/transfer.c b/lib/transfer.c index b087fcd86..b962b7e59 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -253,7 +253,7 @@ CURLcode Curl_readwrite(struct connectdata *conn, /* This is where we loop until we have read everything there is to read or we get a EWOULDBLOCK */ do { - int buffersize = data->set.buffer_size? + size_t buffersize = data->set.buffer_size? data->set.buffer_size:BUFSIZE -1; /* receive data from the network! */ @@ -303,8 +303,8 @@ CURLcode Curl_readwrite(struct connectdata *conn, /* header line within buffer loop */ do { - int hbufp_index; - int rest_length; + size_t hbufp_index; + size_t rest_length; size_t full_length; int writetype; @@ -410,7 +410,7 @@ CURLcode Curl_readwrite(struct connectdata *conn, } if (('\n' == *k->p) || ('\r' == *k->p)) { - int headerlen; + size_t headerlen; /* Zero-length header line means end of headers! */ if ('\r' == *k->p) @@ -1264,7 +1264,7 @@ CURLcode Curl_readwrite(struct connectdata *conn, */ - int ms = Curl_tvdiff(k->now, k->start100); + long ms = Curl_tvdiff(k->now, k->start100); if(ms > CURL_TIMEOUT_EXPECT_100) { /* we've waited long enough, continue anyway */ k->write_after_100_header = FALSE; diff --git a/lib/urldata.h b/lib/urldata.h index d44e839b0..03bc5f394 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -578,7 +578,7 @@ struct connectdata { /* 'upload_present' is used to keep a byte counter of how much data there is still left in the buffer, aimed for upload. */ - int upload_present; + ssize_t upload_present; /* 'upload_fromhere' is used as a read-pointer when we uploaded parts of a buffer, so the next read should read from where this pointer points to,