diff --git a/lib/ftp.c b/lib/ftp.c index 88c9753a715b37590eae7a4ea66af6e8378a3052..fb99243e77d412825d04d80ba0281975cc598666 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -1690,7 +1690,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn) if(readthisamountnow > BUFSIZE) readthisamountnow = BUFSIZE; - actuallyread = + actuallyread = (curl_off_t) conn->fread(data->state.buffer, 1, (size_t)readthisamountnow, conn->fread_in); diff --git a/lib/progress.c b/lib/progress.c index c6517ad0a7c6c25176b56ba2bd2bc1d06b7b4ed2..7294894a71e8a40bca1470312fee5cd4e7973a0a 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -332,7 +332,7 @@ int Curl_pgrsUpdate(struct connectdata *conn) /* the 'amount' value is bigger than would fit in 32 bits if multiplied with 1000, so we use the double math for this */ data->progress.current_speed = (curl_off_t) - ((double)amount/(span_ms/1000.0)); + ((double)amount/((double)span_ms/1000.0)); else /* the 'amount' value is small enough to fit within 32 bits even when multiplied with 1000 */ diff --git a/lib/transfer.c b/lib/transfer.c index 5fab2ffbeafafe1c985bc11b433487f3d6ed8287..93df4c589ac39b3b5d9e82d4b945ee646c2f9635 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -137,8 +137,10 @@ CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp) conn->upload_fromhere += 10; /* 32bit hex + CRLF */ } - nread = conn->fread(conn->upload_fromhere, 1, - buffersize, conn->fread_in); + /* this function returns a size_t, so we typecast to int to prevent warnings + with picky compilers */ + nread = (int)conn->fread(conn->upload_fromhere, 1, + buffersize, conn->fread_in); if(nread == CURL_READFUNC_ABORT) { failf(data, "operation aborted by callback\n"); diff --git a/src/main.c b/src/main.c index a0c04dc686c0d4e699075e0a3905b8d67ada6929..03c854d1aa2981fc52796fec47f31a18a5f6da84 100644 --- a/src/main.c +++ b/src/main.c @@ -2279,7 +2279,9 @@ static int my_fwrite(void *buffer, size_t sz, size_t nmemb, void *stream) int rc; struct OutStruct *out=(struct OutStruct *)stream; struct Configurable *config = out->config; - curl_off_t size = sz * nmemb; + curl_off_t size = (curl_off_t)(sz * nmemb); /* typecast to prevent + warnings when converting from + unsigned to signed */ if(out && !out->stream) { /* open file for writing */ out->stream=fopen(out->filename, "wb"); @@ -2354,7 +2356,9 @@ static int my_fread(void *buffer, size_t sz, size_t nmemb, void *userp) { struct InStruct *in=(struct InStruct *)userp; struct Configurable *config = in->config; - curl_off_t size = sz * nmemb; + curl_off_t size = (curl_off_t)(sz * nmemb); /* typecast to prevent warnings + when converting from + unsigned to signed */ if(config->sendpersecond) { /*