Compiler warning fix
This commit is contained in:
@@ -173,7 +173,7 @@ static void freedirs(struct connectdata *conn)
|
|||||||
*/
|
*/
|
||||||
static bool isBadFtpString(const char *string)
|
static bool isBadFtpString(const char *string)
|
||||||
{
|
{
|
||||||
return strchr(string, '\r') != NULL || strchr(string, '\n') != NULL;
|
return (bool)((NULL != strchr(string, '\r')) || (NULL != strchr(string, '\n')));
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@@ -455,7 +455,7 @@ Curl_http_output_auth(struct connectdata *conn,
|
|||||||
if(auth) {
|
if(auth) {
|
||||||
infof(data, "Proxy auth using %s with user '%s'\n",
|
infof(data, "Proxy auth using %s with user '%s'\n",
|
||||||
auth, conn->proxyuser?conn->proxyuser:"");
|
auth, conn->proxyuser?conn->proxyuser:"");
|
||||||
authproxy->multi = !authproxy->done;
|
authproxy->multi = (bool)(!authproxy->done);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
authproxy->multi = FALSE;
|
authproxy->multi = FALSE;
|
||||||
@@ -525,7 +525,7 @@ Curl_http_output_auth(struct connectdata *conn,
|
|||||||
infof(data, "Server auth using %s with user '%s'\n",
|
infof(data, "Server auth using %s with user '%s'\n",
|
||||||
auth, conn->user);
|
auth, conn->user);
|
||||||
|
|
||||||
authhost->multi = !authhost->done;
|
authhost->multi = (bool)(!authhost->done);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
authhost->multi = FALSE;
|
authhost->multi = FALSE;
|
||||||
|
@@ -706,7 +706,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
|||||||
do {
|
do {
|
||||||
|
|
||||||
if(!GOOD_EASY_HANDLE(easy->easy_handle))
|
if(!GOOD_EASY_HANDLE(easy->easy_handle))
|
||||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
return CURLM_BAD_EASY_HANDLE;
|
||||||
|
|
||||||
if (easy->easy_handle->state.pipe_broke) {
|
if (easy->easy_handle->state.pipe_broke) {
|
||||||
infof(easy->easy_handle, "Pipe broke: handle 0x%x\n", easy);
|
infof(easy->easy_handle, "Pipe broke: handle 0x%x\n", easy);
|
||||||
|
@@ -477,7 +477,7 @@ int Curl_read(struct connectdata *conn, /* connection data */
|
|||||||
|
|
||||||
conn->bits.stream_was_rewound = FALSE;
|
conn->bits.stream_was_rewound = FALSE;
|
||||||
|
|
||||||
*n = bytestocopy;
|
*n = (ssize_t)bytestocopy;
|
||||||
|
|
||||||
if (bytesremaining == 0) {
|
if (bytesremaining == 0) {
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
|
@@ -68,10 +68,10 @@ static bool safe_strequal(char* str1, char* str2)
|
|||||||
{
|
{
|
||||||
if(str1 && str2)
|
if(str1 && str2)
|
||||||
/* both pointers point to something then compare them */
|
/* both pointers point to something then compare them */
|
||||||
return strequal(str1, str2);
|
return (bool)(0 != strequal(str1, str2));
|
||||||
else
|
else
|
||||||
/* if both pointers are NULL then treat them as equal */
|
/* if both pointers are NULL then treat them as equal */
|
||||||
return (!str1 && !str2);
|
return (bool)(!str1 && !str2);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
24
lib/url.c
24
lib/url.c
@@ -1060,7 +1060,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* Use FTP PORT, this also specifies which IP address to use
|
* Use FTP PORT, this also specifies which IP address to use
|
||||||
*/
|
*/
|
||||||
data->set.ftpport = va_arg(param, char *);
|
data->set.ftpport = va_arg(param, char *);
|
||||||
data->set.ftp_use_port = data->set.ftpport?1:0;
|
data->set.ftp_use_port = (bool)(NULL != data->set.ftpport);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLOPT_FTP_USE_EPRT:
|
case CURLOPT_FTP_USE_EPRT:
|
||||||
@@ -1383,7 +1383,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* A string that defines the krb4 security level.
|
* A string that defines the krb4 security level.
|
||||||
*/
|
*/
|
||||||
data->set.krb4_level = va_arg(param, char *);
|
data->set.krb4_level = va_arg(param, char *);
|
||||||
data->set.krb4=data->set.krb4_level?TRUE:FALSE;
|
data->set.krb4 = (bool)(NULL != data->set.krb4_level);
|
||||||
break;
|
break;
|
||||||
case CURLOPT_SSL_VERIFYPEER:
|
case CURLOPT_SSL_VERIFYPEER:
|
||||||
/*
|
/*
|
||||||
@@ -1571,7 +1571,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
* SOURCE URL
|
* SOURCE URL
|
||||||
*/
|
*/
|
||||||
data->set.source_url = va_arg(param, char *);
|
data->set.source_url = va_arg(param, char *);
|
||||||
data->set.printhost = (data->set.source_url != NULL);
|
data->set.printhost = (bool)(NULL != data->set.source_url);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLOPT_SOURCE_USERPWD:
|
case CURLOPT_SOURCE_USERPWD:
|
||||||
@@ -1636,7 +1636,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLOPT_SSL_SESSIONID_CACHE:
|
case CURLOPT_SSL_SESSIONID_CACHE:
|
||||||
data->set.ssl.sessionid = va_arg(param, long)?TRUE:FALSE;
|
data->set.ssl.sessionid = (bool)(0 != va_arg(param, long));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -1842,7 +1842,7 @@ bool Curl_isHandleAtHead(struct SessionHandle *handle,
|
|||||||
{
|
{
|
||||||
struct curl_llist_element *curr = pipe->head;
|
struct curl_llist_element *curr = pipe->head;
|
||||||
if (curr) {
|
if (curr) {
|
||||||
return curr->ptr == handle ? TRUE : FALSE;
|
return (bool)(curr->ptr == handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -3111,9 +3111,10 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||||||
conn->sock[FIRSTSOCKET] = CURL_SOCKET_BAD; /* no file descriptor */
|
conn->sock[FIRSTSOCKET] = CURL_SOCKET_BAD; /* no file descriptor */
|
||||||
conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; /* no file descriptor */
|
conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; /* no file descriptor */
|
||||||
conn->connectindex = -1; /* no index */
|
conn->connectindex = -1; /* no index */
|
||||||
conn->bits.httpproxy = (data->change.proxy && *data->change.proxy &&
|
|
||||||
(data->set.proxytype == CURLPROXY_HTTP))?
|
conn->bits.httpproxy = (bool)(data->change.proxy /* http proxy or not */
|
||||||
TRUE:FALSE; /* http proxy or not */
|
&& *data->change.proxy
|
||||||
|
&& (data->set.proxytype == CURLPROXY_HTTP));
|
||||||
|
|
||||||
/* Default protocol-independent behavior doesn't support persistent
|
/* Default protocol-independent behavior doesn't support persistent
|
||||||
connections, so we set this to force-close. Protocols that support
|
connections, so we set this to force-close. Protocols that support
|
||||||
@@ -3130,13 +3131,14 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||||||
/* Store creation time to help future close decision making */
|
/* Store creation time to help future close decision making */
|
||||||
conn->created = Curl_tvnow();
|
conn->created = Curl_tvnow();
|
||||||
|
|
||||||
data->reqdata.use_range = data->set.set_range?TRUE:FALSE; /* range status */
|
/* range status */
|
||||||
|
data->reqdata.use_range = (bool)(NULL != data->set.set_range);
|
||||||
|
|
||||||
data->reqdata.range = data->set.set_range; /* clone the range setting */
|
data->reqdata.range = data->set.set_range; /* clone the range setting */
|
||||||
data->reqdata.resume_from = data->set.set_resume_from;
|
data->reqdata.resume_from = data->set.set_resume_from;
|
||||||
|
|
||||||
conn->bits.user_passwd = data->set.userpwd?1:0;
|
conn->bits.user_passwd = (bool)(NULL != data->set.userpwd);
|
||||||
conn->bits.proxy_user_passwd = data->set.proxyuserpwd?1:0;
|
conn->bits.proxy_user_passwd = (bool)(NULL != data->set.proxyuserpwd);
|
||||||
conn->bits.no_body = data->set.opt_no_body;
|
conn->bits.no_body = data->set.opt_no_body;
|
||||||
conn->bits.tunnel_proxy = data->set.tunnel_thru_httpproxy;
|
conn->bits.tunnel_proxy = data->set.tunnel_thru_httpproxy;
|
||||||
conn->bits.ftp_use_epsv = data->set.ftp_use_epsv;
|
conn->bits.ftp_use_epsv = data->set.ftp_use_epsv;
|
||||||
|
@@ -1462,7 +1462,11 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
|
|||||||
/* we can loop here if we have multiple single-letters */
|
/* we can loop here if we have multiple single-letters */
|
||||||
|
|
||||||
if(!longopt) {
|
if(!longopt) {
|
||||||
letter = parse?(char)*parse:'\0';
|
if(NULL != parse) {
|
||||||
|
letter = (char)*parse;
|
||||||
|
else {
|
||||||
|
letter = '\0';
|
||||||
|
}
|
||||||
subletter='\0';
|
subletter='\0';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -3048,7 +3052,7 @@ int my_trace(CURL *handle, curl_infotype type,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
newl = (size && (data[size-1] != '\n'));
|
newl = (bool)(size && (data[size-1] != '\n'));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user