tidy-up: drop redundant == NULL syntax

Where missed by checksrc.

Closes #21935
This commit is contained in:
Viktor Szakats 2026-06-09 14:18:02 +02:00
parent 59213abfb2
commit 014be82a66
No known key found for this signature in database
19 changed files with 39 additions and 41 deletions

View file

@ -657,7 +657,7 @@ struct cf_call_data {
#define CF_DATA_SAVE(save, cf, data) \
do { \
(save) = CF_CTX_CALL_DATA(cf); \
DEBUGASSERT((save).data == NULL || (save).depth > 0); \
DEBUGASSERT(!(save).data || (save).depth > 0); \
CF_CTX_CALL_DATA(cf).depth++; \
CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
} while(0)
@ -665,7 +665,7 @@ struct cf_call_data {
#define CF_DATA_RESTORE(cf, save) \
do { \
DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
DEBUGASSERT((save).data == NULL || (save).depth > 0); \
DEBUGASSERT(!(save).data || (save).depth > 0); \
CF_CTX_CALL_DATA(cf) = (save); \
} while(0)

View file

@ -942,7 +942,7 @@ static void dupeasy_meta_freeentry(void *p)
/* Always FALSE. Cannot use a 0 assert here since compilers
* are not in agreement if they then want a NORETURN attribute or
* not. *sigh* */
DEBUGASSERT(p == NULL);
DEBUGASSERT(!p);
}
/*

View file

@ -196,7 +196,7 @@ void Curl_wildcard_dtor(struct WildcardData **wcp)
wc->dtor = ZERO_NULL;
wc->ftpwc = NULL;
}
DEBUGASSERT(wc->ftpwc == NULL);
DEBUGASSERT(!wc->ftpwc);
Curl_llist_destroy(&wc->filelist, NULL);
curlx_safefree(wc->path);

View file

@ -220,7 +220,7 @@ static void ph_freeentry(void *p)
/* Always FALSE. Cannot use a 0 assert here since compilers
* are not in agreement if they then want a NORETURN attribute or
* not. *sigh* */
DEBUGASSERT(p == NULL);
DEBUGASSERT(!p);
}
/*

View file

@ -152,7 +152,7 @@ CURLcode Curl_pp_vsendf(struct Curl_easy *data,
DEBUGASSERT(pp->sendleft == 0);
DEBUGASSERT(pp->sendsize == 0);
DEBUGASSERT(pp->sendthis == NULL);
DEBUGASSERT(!pp->sendthis);
if(!conn)
/* cannot send without a connection! */

View file

@ -442,7 +442,7 @@ static void easy_meta_freeentry(void *p)
/* Always FALSE. Cannot use a 0 assert here since compilers
* are not in agreement if they then want a NORETURN attribute or
* not. *sigh* */
DEBUGASSERT(p == NULL);
DEBUGASSERT(!p);
}
/**
@ -2591,7 +2591,7 @@ static void conn_meta_freeentry(void *p)
/* Always FALSE. Cannot use a 0 assert here since compilers
* are not in agreement if they then want a NORETURN attribute or
* not. *sigh* */
DEBUGASSERT(p == NULL);
DEBUGASSERT(!p);
}
static CURLcode url_create_needle(struct Curl_easy *data,

View file

@ -1888,8 +1888,8 @@ static void sshc_cleanup(struct ssh_conn *sshc)
}
/* worst-case scenario cleanup */
DEBUGASSERT(sshc->ssh_session == NULL);
DEBUGASSERT(sshc->scp_session == NULL);
DEBUGASSERT(!sshc->ssh_session);
DEBUGASSERT(!sshc->scp_session);
if(sshc->readdir_tmp) {
ssh_string_free_char(sshc->readdir_tmp);

View file

@ -152,8 +152,7 @@ static void kbd_callback(const char *name, int name_len,
/* this function must allocate memory that can be freed by libssh2, which
uses the LIBSSH2_FREE_FUNC callback */
responses[0].text = Curl_cstrdup(passwd);
responses[0].length =
responses[0].text == NULL ? 0 : curlx_uztoui(strlen(passwd));
responses[0].length = responses[0].text ? curlx_uztoui(strlen(passwd)) : 0;
}
(void)prompts;
} /* kbd_callback */
@ -2607,12 +2606,12 @@ static CURLcode sshc_cleanup(struct ssh_conn *sshc, struct Curl_easy *data,
}
/* worst-case scenario cleanup */
DEBUGASSERT(sshc->ssh_session == NULL);
DEBUGASSERT(sshc->ssh_channel == NULL);
DEBUGASSERT(sshc->sftp_session == NULL);
DEBUGASSERT(sshc->sftp_handle == NULL);
DEBUGASSERT(sshc->kh == NULL);
DEBUGASSERT(sshc->ssh_agent == NULL);
DEBUGASSERT(!sshc->ssh_session);
DEBUGASSERT(!sshc->ssh_channel);
DEBUGASSERT(!sshc->sftp_session);
DEBUGASSERT(!sshc->sftp_handle);
DEBUGASSERT(!sshc->kh);
DEBUGASSERT(!sshc->ssh_agent);
curlx_safefree(sshc->rsa_pub);
curlx_safefree(sshc->rsa);

View file

@ -1100,7 +1100,7 @@ static CURLcode cr_init_backend(struct Curl_cfilter *cf,
return CURLE_SSL_CONNECT_ERROR;
}
DEBUGASSERT(rconn == NULL);
DEBUGASSERT(!rconn);
rr = rustls_client_connection_new(backend->config,
connssl->peer.dest->hostname,
&rconn);