mirror of
https://github.com/curl/curl.git
synced 2026-08-25 01:33:31 +03:00
lib: use bool/TRUE/FALSE properly
booleans should use the type 'bool' and set the value to TRUE/FALSE non-booleans should not be 'bool' and should not set the value to TRUE/FALSE Closes #15123
This commit is contained in:
parent
78ed473dbc
commit
bcec0840b0
44 changed files with 222 additions and 222 deletions
|
|
@ -496,11 +496,11 @@ static int myssh_is_known(struct Curl_easy *data)
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
Curl_set_in_callback(data, true);
|
||||
Curl_set_in_callback(data, TRUE);
|
||||
rc = func(data, knownkeyp, /* from the knownhosts file */
|
||||
&foundkey, /* from the remote host */
|
||||
keymatch, data->set.ssh_keyfunc_userp);
|
||||
Curl_set_in_callback(data, false);
|
||||
Curl_set_in_callback(data, FALSE);
|
||||
|
||||
switch(rc) {
|
||||
case CURLKHSTAT_FINE_ADD_TO_FILE:
|
||||
|
|
@ -1294,10 +1294,10 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block)
|
|||
if(data->state.resume_from > 0) {
|
||||
/* Let's read off the proper amount of bytes from the input. */
|
||||
if(data->set.seek_func) {
|
||||
Curl_set_in_callback(data, true);
|
||||
Curl_set_in_callback(data, TRUE);
|
||||
seekerr = data->set.seek_func(data->set.seek_client,
|
||||
data->state.resume_from, SEEK_SET);
|
||||
Curl_set_in_callback(data, false);
|
||||
Curl_set_in_callback(data, FALSE);
|
||||
}
|
||||
|
||||
if(seekerr != CURL_SEEKFUNC_OK) {
|
||||
|
|
@ -2317,7 +2317,7 @@ CURLcode scp_perform(struct Curl_easy *data,
|
|||
static CURLcode myssh_do_it(struct Curl_easy *data, bool *done)
|
||||
{
|
||||
CURLcode result;
|
||||
bool connected = 0;
|
||||
bool connected = FALSE;
|
||||
struct connectdata *conn = data->conn;
|
||||
struct ssh_conn *sshc = &conn->proto.sshc;
|
||||
|
||||
|
|
|
|||
|
|
@ -580,11 +580,11 @@ static CURLcode ssh_knownhost(struct Curl_easy *data)
|
|||
keymatch = (enum curl_khmatch)keycheck;
|
||||
|
||||
/* Ask the callback how to behave */
|
||||
Curl_set_in_callback(data, true);
|
||||
Curl_set_in_callback(data, TRUE);
|
||||
rc = func(data, knownkeyp, /* from the knownhosts file */
|
||||
&foundkey, /* from the remote host */
|
||||
keymatch, data->set.ssh_keyfunc_userp);
|
||||
Curl_set_in_callback(data, false);
|
||||
Curl_set_in_callback(data, FALSE);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -782,10 +782,10 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data)
|
|||
&keylen, &sshkeytype);
|
||||
if(remotekey) {
|
||||
enum curl_khtype keytype = convert_ssh2_keytype(sshkeytype);
|
||||
Curl_set_in_callback(data, true);
|
||||
Curl_set_in_callback(data, TRUE);
|
||||
rc = data->set.ssh_hostkeyfunc(data->set.ssh_hostkeyfunc_userp,
|
||||
(int)keytype, remotekey, keylen);
|
||||
Curl_set_in_callback(data, false);
|
||||
Curl_set_in_callback(data, FALSE);
|
||||
if(rc!= CURLKHMATCH_OK) {
|
||||
state(data, SSH_SESSION_FREE);
|
||||
sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION;
|
||||
|
|
@ -849,7 +849,7 @@ static CURLcode ssh_force_knownhost_key_type(struct Curl_easy *data)
|
|||
const char *kh_name_end = NULL;
|
||||
size_t kh_name_size = 0;
|
||||
int port = 0;
|
||||
bool found = false;
|
||||
bool found = FALSE;
|
||||
|
||||
if(sshc->kh && !data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5]) {
|
||||
/* lets try to find our host in the known hosts file */
|
||||
|
|
@ -870,18 +870,18 @@ static CURLcode ssh_force_knownhost_key_type(struct Curl_easy *data)
|
|||
kh_name_size = strlen(store->name) - 1 - strlen(kh_name_end);
|
||||
if(strncmp(store->name + 1,
|
||||
conn->host.name, kh_name_size) == 0) {
|
||||
found = true;
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(strcmp(store->name, conn->host.name) == 0) {
|
||||
found = true;
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
found = true;
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -2148,10 +2148,10 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block)
|
|||
if(data->state.resume_from > 0) {
|
||||
/* Let's read off the proper amount of bytes from the input. */
|
||||
if(data->set.seek_func) {
|
||||
Curl_set_in_callback(data, true);
|
||||
Curl_set_in_callback(data, TRUE);
|
||||
seekerr = data->set.seek_func(data->set.seek_client,
|
||||
data->state.resume_from, SEEK_SET);
|
||||
Curl_set_in_callback(data, false);
|
||||
Curl_set_in_callback(data, FALSE);
|
||||
}
|
||||
|
||||
if(seekerr != CURL_SEEKFUNC_OK) {
|
||||
|
|
@ -2170,11 +2170,11 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block)
|
|||
sizeof(scratch) : curlx_sotouz(data->state.resume_from - passed);
|
||||
|
||||
size_t actuallyread;
|
||||
Curl_set_in_callback(data, true);
|
||||
Curl_set_in_callback(data, TRUE);
|
||||
actuallyread = data->state.fread_func(scratch, 1,
|
||||
readthisamountnow,
|
||||
data->state.in);
|
||||
Curl_set_in_callback(data, false);
|
||||
Curl_set_in_callback(data, FALSE);
|
||||
|
||||
passed += actuallyread;
|
||||
if((actuallyread == 0) || (actuallyread > readthisamountnow)) {
|
||||
|
|
@ -3453,7 +3453,7 @@ static CURLcode scp_doing(struct Curl_easy *data,
|
|||
static CURLcode ssh_do(struct Curl_easy *data, bool *done)
|
||||
{
|
||||
CURLcode result;
|
||||
bool connected = 0;
|
||||
bool connected = FALSE;
|
||||
struct connectdata *conn = data->conn;
|
||||
struct ssh_conn *sshc = &conn->proto.sshc;
|
||||
|
||||
|
|
|
|||
|
|
@ -629,10 +629,10 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data, bool *block)
|
|||
/* Let's read off the proper amount of bytes from the input. */
|
||||
int seekerr = CURL_SEEKFUNC_OK;
|
||||
if(data->set.seek_func) {
|
||||
Curl_set_in_callback(data, true);
|
||||
Curl_set_in_callback(data, TRUE);
|
||||
seekerr = data->set.seek_func(data->set.seek_client,
|
||||
data->state.resume_from, SEEK_SET);
|
||||
Curl_set_in_callback(data, false);
|
||||
Curl_set_in_callback(data, FALSE);
|
||||
}
|
||||
|
||||
if(seekerr != CURL_SEEKFUNC_OK) {
|
||||
|
|
@ -651,11 +651,11 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data, bool *block)
|
|||
sizeof(scratch) : curlx_sotouz(data->state.resume_from - passed);
|
||||
|
||||
size_t actuallyread;
|
||||
Curl_set_in_callback(data, true);
|
||||
Curl_set_in_callback(data, TRUE);
|
||||
actuallyread = data->state.fread_func(scratch, 1,
|
||||
readthisamountnow,
|
||||
data->state.in);
|
||||
Curl_set_in_callback(data, false);
|
||||
Curl_set_in_callback(data, FALSE);
|
||||
|
||||
passed += actuallyread;
|
||||
if((actuallyread == 0) || (actuallyread > readthisamountnow)) {
|
||||
|
|
@ -962,7 +962,7 @@ CURLcode wsftp_perform(struct Curl_easy *data,
|
|||
static CURLcode wssh_do(struct Curl_easy *data, bool *done)
|
||||
{
|
||||
CURLcode result;
|
||||
bool connected = 0;
|
||||
bool connected = FALSE;
|
||||
struct connectdata *conn = data->conn;
|
||||
struct ssh_conn *sshc = &conn->proto.sshc;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue