Cory Nelson's work on nuking compiler warnings when building on x64 with
VS2005.
This commit is contained in:
parent
9d7330d879
commit
6b1220b61d
@ -652,7 +652,7 @@ singleipconnect(struct connectdata *conn,
|
||||
/* set socket non-blocking */
|
||||
Curl_nonblock(sockfd, TRUE);
|
||||
|
||||
rc = connect(sockfd, ai->ai_addr, ai->ai_addrlen);
|
||||
rc = connect(sockfd, ai->ai_addr, (socklen_t)ai->ai_addrlen);
|
||||
|
||||
if(-1 == rc) {
|
||||
error = Curl_ourerrno();
|
||||
|
@ -309,7 +309,7 @@ Curl_cookie_add(struct SessionHandle *data,
|
||||
break;
|
||||
}
|
||||
co->expires =
|
||||
atoi((*co->maxage=='\"')?&co->maxage[1]:&co->maxage[0]) + now;
|
||||
atoi((*co->maxage=='\"')?&co->maxage[1]:&co->maxage[0]) + (long)now;
|
||||
}
|
||||
else if(strequal("expires", name)) {
|
||||
co->expirestr=strdup(whatptr);
|
||||
@ -317,7 +317,7 @@ Curl_cookie_add(struct SessionHandle *data,
|
||||
badcookie = TRUE;
|
||||
break;
|
||||
}
|
||||
co->expires = curl_getdate(what, &now);
|
||||
co->expires = (long)curl_getdate(what, &now);
|
||||
}
|
||||
else if(!co->name) {
|
||||
co->name = strdup(name);
|
||||
|
@ -464,7 +464,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else
|
||||
current_form->namelength =
|
||||
array_state?(long)array_value:va_arg(params, long);
|
||||
array_state?(long)array_value:(long)va_arg(params, long);
|
||||
break;
|
||||
|
||||
/*
|
||||
@ -1550,7 +1550,7 @@ char *Curl_FormBoundary(void)
|
||||
if(!retstring)
|
||||
return NULL; /* failed */
|
||||
|
||||
srand(time(NULL)+randomizer++); /* seed */
|
||||
srand((unsigned int)time(NULL)+randomizer++); /* seed */
|
||||
|
||||
strcpy(retstring, "----------------------------");
|
||||
|
||||
|
@ -266,8 +266,8 @@ static CURLcode ftp_readresp(curl_socket_t sockfd,
|
||||
|
||||
ptr=buf + ftp->nread_resp;
|
||||
|
||||
perline= ptr-ftp->linestart_resp; /* number of bytes in the current line,
|
||||
so far */
|
||||
perline= (int)(ptr-ftp->linestart_resp); /* number of bytes in the current
|
||||
line, so far */
|
||||
keepon=TRUE;
|
||||
|
||||
while((ftp->nread_resp<BUFSIZE) && (keepon && !result)) {
|
||||
@ -1739,7 +1739,7 @@ static CURLcode ftp_state_mdtm_resp(struct connectdata *conn,
|
||||
"%04d%02d%02d %02d:%02d:%02d GMT",
|
||||
year, month, day, hour, minute, second);
|
||||
/* now, convert this into a time() value: */
|
||||
data->info.filetime = curl_getdate(buf, &secs);
|
||||
data->info.filetime = (long)curl_getdate(buf, &secs);
|
||||
}
|
||||
|
||||
/* If we asked for a time of the file and we actually got one as well,
|
||||
@ -2086,7 +2086,7 @@ static CURLcode ftp_state_get_resp(struct connectdata *conn,
|
||||
char *bytes;
|
||||
bytes=strstr(buf, " bytes");
|
||||
if(bytes--) {
|
||||
long in=bytes-buf;
|
||||
long in=(long)(bytes-buf);
|
||||
/* this is a hint there is size information in there! ;-) */
|
||||
while(--in) {
|
||||
/* scan for the left parenthesis and break there */
|
||||
|
@ -548,7 +548,7 @@ CURLcode Curl_resolv_fdset(struct connectdata *conn,
|
||||
|
||||
if (td && td->dummy_sock != CURL_SOCKET_BAD) {
|
||||
FD_SET(td->dummy_sock,write_fd_set);
|
||||
*max_fdp = td->dummy_sock;
|
||||
*max_fdp = (int)td->dummy_sock;
|
||||
}
|
||||
(void) read_fd_set;
|
||||
return CURLE_OK;
|
||||
|
@ -114,7 +114,7 @@ inet_pton4(const char *src, unsigned char *dst)
|
||||
const char *pch;
|
||||
|
||||
if ((pch = strchr(digits, ch)) != NULL) {
|
||||
u_int val = *tp * 10 + (pch - digits);
|
||||
u_int val = *tp * 10 + (u_int)(pch - digits);
|
||||
|
||||
if (val > 255)
|
||||
return (0);
|
||||
|
@ -345,7 +345,7 @@ void Curl_md5it(unsigned char *outbuffer, /* 16 bytes */
|
||||
{
|
||||
MD5_CTX ctx;
|
||||
MD5_Init(&ctx);
|
||||
MD5_Update(&ctx, input, strlen((char *)input));
|
||||
MD5_Update(&ctx, input, (unsigned int)strlen((char *)input));
|
||||
MD5_Final(outbuffer, &ctx);
|
||||
}
|
||||
|
||||
|
@ -759,8 +759,8 @@ static int dprintf_formatf(
|
||||
*w-- = digits[num % base];
|
||||
num /= base;
|
||||
}
|
||||
width -= workend - w;
|
||||
prec -= workend - w;
|
||||
width -= (long)(workend - w);
|
||||
prec -= (long)(workend - w);
|
||||
|
||||
if (alt && base == 8 && prec <= 0) {
|
||||
*w-- = '0';
|
||||
@ -839,7 +839,7 @@ static int dprintf_formatf(
|
||||
|
||||
if (prec != -1 && (size_t) prec < len)
|
||||
len = prec;
|
||||
width -= len;
|
||||
width -= (long)len;
|
||||
|
||||
if (p->flags & FLAGS_ALT)
|
||||
OUTCHAR('"');
|
||||
@ -869,7 +869,7 @@ static int dprintf_formatf(
|
||||
base = 16;
|
||||
digits = (p->flags & FLAGS_UPPER)? upper_digits : lower_digits;
|
||||
alt = 1;
|
||||
num = (unsigned long) ptr;
|
||||
num = (size_t) ptr;
|
||||
is_neg = 0;
|
||||
goto number;
|
||||
}
|
||||
|
@ -398,7 +398,7 @@ static time_t Curl_parsedate(const char *date)
|
||||
|
||||
/* Add the time zone diff (between the given timezone and GMT) and the
|
||||
diff between the local time zone and GMT. */
|
||||
delta = (tzoff!=-1?tzoff:0) + (t - t2);
|
||||
delta = (long)((tzoff!=-1?tzoff:0) + (t - t2));
|
||||
|
||||
if((delta>0) && (t + delta < t))
|
||||
return -1; /* time_t overflow */
|
||||
|
@ -151,7 +151,7 @@ int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
|
||||
}
|
||||
|
||||
do {
|
||||
r = select(maxfd + 1, &fds_read, &fds_write, &fds_err, &timeout);
|
||||
r = select((int)maxfd + 1, &fds_read, &fds_write, &fds_err, &timeout);
|
||||
} while((r == -1) && (Curl_ourerrno() == EINTR));
|
||||
|
||||
if (r < 0)
|
||||
@ -236,7 +236,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms)
|
||||
}
|
||||
|
||||
do {
|
||||
r = select(maxfd + 1, &fds_read, &fds_write, &fds_err, ptimeout);
|
||||
r = select((int)maxfd + 1, &fds_read, &fds_write, &fds_err, ptimeout);
|
||||
} while((r == -1) && (Curl_ourerrno() == EINTR));
|
||||
|
||||
if (r < 0)
|
||||
|
@ -571,7 +571,7 @@ const char *Curl_strerror(struct connectdata *conn, int err)
|
||||
else {
|
||||
if (!get_winsock_error(err, buf, max) &&
|
||||
!FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
|
||||
LANG_NEUTRAL, buf, max, NULL))
|
||||
LANG_NEUTRAL, buf, (DWORD)max, NULL))
|
||||
snprintf(buf, max, "Unknown error %d (%#x)", err, err);
|
||||
}
|
||||
#endif
|
||||
|
@ -270,9 +270,9 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
||||
ssize_t nread; /* number of bytes read */
|
||||
int didwhat=0;
|
||||
|
||||
int fd_read;
|
||||
int fd_write;
|
||||
int select_res;
|
||||
curl_socket_t fd_read;
|
||||
curl_socket_t fd_write;
|
||||
curl_socket_t select_res;
|
||||
|
||||
curl_off_t contentlength;
|
||||
|
||||
@ -395,7 +395,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
||||
|
||||
/* decrease the size of the remaining (supposed) header line */
|
||||
rest_length = (k->end_ptr - k->str)+1;
|
||||
nread -= rest_length;
|
||||
nread -= (ssize_t)rest_length;
|
||||
|
||||
k->str = k->end_ptr + 1; /* move past new line */
|
||||
|
||||
@ -520,8 +520,8 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
data->info.header_size += headerlen;
|
||||
conn->headerbytecount += headerlen;
|
||||
data->info.header_size += (long)headerlen;
|
||||
conn->headerbytecount += (long)headerlen;
|
||||
|
||||
conn->deductheadercount =
|
||||
(100 == k->httpcode)?conn->headerbytecount:0;
|
||||
@ -900,7 +900,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
||||
k->timeofdoc = curl_getdate(k->p+strlen("Last-Modified:"),
|
||||
&secs);
|
||||
if(data->set.get_filetime)
|
||||
data->info.filetime = k->timeofdoc;
|
||||
data->info.filetime = (long)k->timeofdoc;
|
||||
}
|
||||
else if((checkprefix("WWW-Authenticate:", k->p) &&
|
||||
(401 == k->httpcode)) ||
|
||||
@ -963,8 +963,8 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
data->info.header_size += k->hbuflen;
|
||||
conn->headerbytecount += k->hbuflen;
|
||||
data->info.header_size += (long)k->hbuflen;
|
||||
conn->headerbytecount += (long)k->hbuflen;
|
||||
|
||||
/* reset hbufp pointer && hbuflen */
|
||||
k->hbufp = data->state.headerbuff;
|
||||
@ -1501,7 +1501,7 @@ void Curl_single_fdset(struct connectdata *conn,
|
||||
*max_fd = -1; /* init */
|
||||
if(conn->keep.keepon & KEEP_READ) {
|
||||
FD_SET(conn->sockfd, read_fd_set);
|
||||
*max_fd = conn->sockfd;
|
||||
*max_fd = (int)conn->sockfd;
|
||||
}
|
||||
if(conn->keep.keepon & KEEP_WRITE) {
|
||||
FD_SET(conn->writesockfd, write_fd_set);
|
||||
@ -1509,7 +1509,7 @@ void Curl_single_fdset(struct connectdata *conn,
|
||||
/* since sockets are curl_socket_t nowadays, we typecast it to int here
|
||||
to compare it nicely */
|
||||
if((int)conn->writesockfd > *max_fd)
|
||||
*max_fd = conn->writesockfd;
|
||||
*max_fd = (int)conn->writesockfd;
|
||||
}
|
||||
/* we don't use exceptions, only touch that one to prevent compiler
|
||||
warnings! */
|
||||
@ -1553,8 +1553,8 @@ Transfer(struct connectdata *conn)
|
||||
return CURLE_OK;
|
||||
|
||||
while (!done) {
|
||||
int fd_read;
|
||||
int fd_write;
|
||||
curl_socket_t fd_read;
|
||||
curl_socket_t fd_write;
|
||||
int interval_ms;
|
||||
|
||||
interval_ms = 1 * 1000;
|
||||
|
Loading…
Reference in New Issue
Block a user