if(readthisamountnow > BUFSIZE)
readthisamountnow = BUFSIZE;
- actuallyread =
+ actuallyread = (curl_off_t)
conn->fread(data->state.buffer, 1, (size_t)readthisamountnow,
conn->fread_in);
/* 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 */
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");
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");
{
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) {
/*