From 9dbd6659dc9611110bc48614ee22e40b3935576f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 10 Aug 2004 06:41:13 +0000 Subject: more typecasts to please picky compilers --- lib/ftp.c | 2 +- lib/progress.c | 2 +- lib/transfer.c | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/ftp.c b/lib/ftp.c index 88c9753a7..fb99243e7 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 c6517ad0a..7294894a7 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 5fab2ffbe..93df4c589 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"); -- cgit v1.2.3