fix some compiler warnings
This commit is contained in:
parent
97386c3c84
commit
8af4b657d0
@ -95,7 +95,7 @@ static void
|
|||||||
tcpkeepalive(struct SessionHandle *data,
|
tcpkeepalive(struct SessionHandle *data,
|
||||||
int sockfd)
|
int sockfd)
|
||||||
{
|
{
|
||||||
int optval = data->set.tcp_keepalive;
|
int optval = data->set.tcp_keepalive?1:0;
|
||||||
|
|
||||||
/* only set IDLE and INTVL if setting KEEPALIVE is successful */
|
/* only set IDLE and INTVL if setting KEEPALIVE is successful */
|
||||||
if(setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE,
|
if(setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE,
|
||||||
|
@ -4244,7 +4244,8 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
|
||||||
ftpc->dirs[0] = curl_easy_unescape(conn->data, slash_pos ? cur_pos : "/",
|
ftpc->dirs[0] = curl_easy_unescape(conn->data, slash_pos ? cur_pos : "/",
|
||||||
slash_pos?(int)(slash_pos-cur_pos):1,
|
slash_pos ?
|
||||||
|
curlx_sztosi(slash_pos-cur_pos) : 1,
|
||||||
NULL);
|
NULL);
|
||||||
if(!ftpc->dirs[0]) {
|
if(!ftpc->dirs[0]) {
|
||||||
freedirs(ftpc);
|
freedirs(ftpc);
|
||||||
@ -4283,7 +4284,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|||||||
/* we skip empty path components, like "x//y" since the FTP command
|
/* we skip empty path components, like "x//y" since the FTP command
|
||||||
CWD requires a parameter and a non-existent parameter a) doesn't
|
CWD requires a parameter and a non-existent parameter a) doesn't
|
||||||
work on many servers and b) has no effect on the others. */
|
work on many servers and b) has no effect on the others. */
|
||||||
int len = (int)(slash_pos - cur_pos + absolute_dir);
|
int len = curlx_sztosi(slash_pos - cur_pos + absolute_dir);
|
||||||
ftpc->dirs[ftpc->dirdepth] =
|
ftpc->dirs[ftpc->dirdepth] =
|
||||||
curl_easy_unescape(conn->data, cur_pos - absolute_dir, len, NULL);
|
curl_easy_unescape(conn->data, cur_pos - absolute_dir, len, NULL);
|
||||||
if(!ftpc->dirs[ftpc->dirdepth]) { /* run out of memory ... */
|
if(!ftpc->dirs[ftpc->dirdepth]) { /* run out of memory ... */
|
||||||
@ -4354,8 +4355,8 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
dlen -= ftpc->file?(int)strlen(ftpc->file):0;
|
dlen -= ftpc->file?curlx_uztosi(strlen(ftpc->file)):0;
|
||||||
if((dlen == (int)strlen(ftpc->prevpath)) &&
|
if((dlen == curlx_uztosi(strlen(ftpc->prevpath))) &&
|
||||||
strnequal(path, ftpc->prevpath, dlen)) {
|
strnequal(path, ftpc->prevpath, dlen)) {
|
||||||
infof(data, "Request has same path as previous transfer\n");
|
infof(data, "Request has same path as previous transfer\n");
|
||||||
ftpc->cwddone = TRUE;
|
ftpc->cwddone = TRUE;
|
||||||
|
@ -67,6 +67,7 @@
|
|||||||
#include <x509v3.h>
|
#include <x509v3.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "warnless.h"
|
||||||
#include "curl_memory.h"
|
#include "curl_memory.h"
|
||||||
#include "non-ascii.h" /* for Curl_convert_from_utf8 prototype */
|
#include "non-ascii.h" /* for Curl_convert_from_utf8 prototype */
|
||||||
|
|
||||||
@ -254,7 +255,7 @@ static int ossl_seed(struct SessionHandle *data)
|
|||||||
if(!area)
|
if(!area)
|
||||||
return 3; /* out of memory */
|
return 3; /* out of memory */
|
||||||
|
|
||||||
len = (int)strlen(area);
|
len = curlx_uztosi(strlen(area));
|
||||||
RAND_add(area, len, (len >> 1));
|
RAND_add(area, len, (len >> 1));
|
||||||
|
|
||||||
free(area); /* now remove the random junk */
|
free(area); /* now remove the random junk */
|
||||||
@ -1252,7 +1253,7 @@ static CURLcode verifyhost(struct connectdata *conn,
|
|||||||
else /* not a UTF8 name */
|
else /* not a UTF8 name */
|
||||||
j = ASN1_STRING_to_UTF8(&peer_CN, tmp);
|
j = ASN1_STRING_to_UTF8(&peer_CN, tmp);
|
||||||
|
|
||||||
if(peer_CN && ((int)strlen((char *)peer_CN) != j)) {
|
if(peer_CN && (curlx_uztosi(strlen((char *)peer_CN)) != j)) {
|
||||||
/* there was a terminating zero before the end of string, this
|
/* there was a terminating zero before the end of string, this
|
||||||
cannot match and we return failure! */
|
cannot match and we return failure! */
|
||||||
failf(data, "SSL: illegal cert name field");
|
failf(data, "SSL: illegal cert name field");
|
||||||
|
@ -69,6 +69,7 @@
|
|||||||
#include "select.h"
|
#include "select.h"
|
||||||
#include "strequal.h"
|
#include "strequal.h"
|
||||||
#include "rawstr.h"
|
#include "rawstr.h"
|
||||||
|
#include "warnless.h"
|
||||||
|
|
||||||
/* The last #include file should be: */
|
/* The last #include file should be: */
|
||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
|
@ -752,7 +752,7 @@ CURLcode Curl_init_userdefined(struct UserDefined *set)
|
|||||||
/* tcp keepalives are disabled by default, but provide reasonable values for
|
/* tcp keepalives are disabled by default, but provide reasonable values for
|
||||||
* the interval and idle times.
|
* the interval and idle times.
|
||||||
*/
|
*/
|
||||||
set->tcp_keepalive = 0;
|
set->tcp_keepalive = FALSE;
|
||||||
set->tcp_keepintvl = 60;
|
set->tcp_keepintvl = 60;
|
||||||
set->tcp_keepidle = 60;
|
set->tcp_keepidle = 60;
|
||||||
|
|
||||||
|
@ -286,6 +286,25 @@ size_t curlx_sotouz(curl_off_t sonum)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
** signed ssize_t to signed int
|
||||||
|
*/
|
||||||
|
|
||||||
|
int curlx_sztosi(ssize_t sznum)
|
||||||
|
{
|
||||||
|
#ifdef __INTEL_COMPILER
|
||||||
|
# pragma warning(push)
|
||||||
|
# pragma warning(disable:810) /* conversion may lose significant bits */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
DEBUGASSERT(sznum >= 0);
|
||||||
|
return (int)(sznum & (ssize_t) CURL_MASK_SINT);
|
||||||
|
|
||||||
|
#ifdef __INTEL_COMPILER
|
||||||
|
# pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** signed int to unsigned size_t
|
** signed int to unsigned size_t
|
||||||
*/
|
*/
|
||||||
|
@ -40,6 +40,8 @@ ssize_t curlx_uztosz(size_t uznum);
|
|||||||
|
|
||||||
size_t curlx_sotouz(curl_off_t sonum);
|
size_t curlx_sotouz(curl_off_t sonum);
|
||||||
|
|
||||||
|
int curlx_sztosi(ssize_t sznum);
|
||||||
|
|
||||||
size_t curlx_sitouz(int sinum);
|
size_t curlx_sitouz(int sinum);
|
||||||
|
|
||||||
#if defined(__INTEL_COMPILER) && defined(__unix__)
|
#if defined(__INTEL_COMPILER) && defined(__unix__)
|
||||||
|
@ -389,7 +389,7 @@ CURLcode tool_setopt(CURL *curl, bool str, struct Configurable *config,
|
|||||||
{
|
{
|
||||||
va_list arg;
|
va_list arg;
|
||||||
char buf[256];
|
char buf[256];
|
||||||
const char *value;
|
const char *value = NULL;
|
||||||
bool remark = FALSE;
|
bool remark = FALSE;
|
||||||
bool skip = FALSE;
|
bool skip = FALSE;
|
||||||
bool escape = FALSE;
|
bool escape = FALSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user