style: use space after comment start and before comment end

/* like this */

/*not this*/

checksrc is updated accordingly

Closes #9828
This commit is contained in:
Daniel Stenberg 2022-10-30 17:38:16 +01:00
parent b8c302dcba
commit 52cc4a85fd
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
42 changed files with 152 additions and 147 deletions

View file

@ -679,7 +679,7 @@ static int uploadpostfields(void *userdata, hyper_context *ctx,
return HYPER_POLL_ERROR;
}
/* increasing the writebytecount here is a little premature but we
don't know exactly when the body is sent*/
don't know exactly when the body is sent */
data->req.writebytecount += (size_t)data->req.p.http->postsize;
Curl_pgrsSetUploadCounter(data, data->req.writebytecount);
data->req.upload_done = TRUE;
@ -732,7 +732,7 @@ static int uploadstreamed(void *userdata, hyper_context *ctx,
return HYPER_POLL_ERROR;
}
/* increasing the writebytecount here is a little premature but we
don't know exactly when the body is sent*/
don't know exactly when the body is sent */
data->req.writebytecount += fillcount;
Curl_pgrsSetUploadCounter(data, fillcount);
}

View file

@ -148,15 +148,12 @@ CURLcode Curl_get_pathname(const char **cpp, char **path, char *homedir)
break;
}
if(cp[i] == '\0') { /* End of string */
/*error("Unterminated quote");*/
goto fail;
}
if(cp[i] == '\\') { /* Escaped characters */
i++;
if(cp[i] != '\'' && cp[i] != '\"' &&
cp[i] != '\\') {
/*error("Bad escaped character '\\%c'",
cp[i]);*/
goto fail;
}
}
@ -164,7 +161,6 @@ CURLcode Curl_get_pathname(const char **cpp, char **path, char *homedir)
}
if(j == 0) {
/*error("Empty quotes");*/
goto fail;
}
*cpp = cp + i + strspn(cp + i, WHITESPACE);

View file

@ -85,7 +85,7 @@ const struct Curl_handler Curl_handler_rtmp = {
PORT_RTMP, /* defport */
CURLPROTO_RTMP, /* protocol */
CURLPROTO_RTMP, /* family */
PROTOPT_NONE /* flags*/
PROTOPT_NONE /* flags */
};
const struct Curl_handler Curl_handler_rtmpt = {
@ -108,7 +108,7 @@ const struct Curl_handler Curl_handler_rtmpt = {
PORT_RTMPT, /* defport */
CURLPROTO_RTMPT, /* protocol */
CURLPROTO_RTMPT, /* family */
PROTOPT_NONE /* flags*/
PROTOPT_NONE /* flags */
};
const struct Curl_handler Curl_handler_rtmpe = {
@ -131,7 +131,7 @@ const struct Curl_handler Curl_handler_rtmpe = {
PORT_RTMP, /* defport */
CURLPROTO_RTMPE, /* protocol */
CURLPROTO_RTMPE, /* family */
PROTOPT_NONE /* flags*/
PROTOPT_NONE /* flags */
};
const struct Curl_handler Curl_handler_rtmpte = {
@ -154,7 +154,7 @@ const struct Curl_handler Curl_handler_rtmpte = {
PORT_RTMPT, /* defport */
CURLPROTO_RTMPTE, /* protocol */
CURLPROTO_RTMPTE, /* family */
PROTOPT_NONE /* flags*/
PROTOPT_NONE /* flags */
};
const struct Curl_handler Curl_handler_rtmps = {
@ -177,7 +177,7 @@ const struct Curl_handler Curl_handler_rtmps = {
PORT_RTMPS, /* defport */
CURLPROTO_RTMPS, /* protocol */
CURLPROTO_RTMP, /* family */
PROTOPT_NONE /* flags*/
PROTOPT_NONE /* flags */
};
const struct Curl_handler Curl_handler_rtmpts = {
@ -200,7 +200,7 @@ const struct Curl_handler Curl_handler_rtmpts = {
PORT_RTMPS, /* defport */
CURLPROTO_RTMPTS, /* protocol */
CURLPROTO_RTMPT, /* family */
PROTOPT_NONE /* flags*/
PROTOPT_NONE /* flags */
};
static CURLcode rtmp_setup_connection(struct Curl_easy *data,

View file

@ -693,7 +693,7 @@
# define UNUSED_PARAM __attribute__((__unused__))
# define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
# define UNUSED_PARAM /*NOTHING*/
# define UNUSED_PARAM /* NOTHING */
# define WARN_UNUSED_RESULT
#endif

View file

@ -33,7 +33,7 @@ extern const struct HMAC_params Curl_HMAC_SHA256[1];
#ifdef USE_WOLFSSL
/* SHA256_DIGEST_LENGTH is an enum value in wolfSSL. Need to import it from
* sha.h*/
* sha.h */
#include <wolfssl/options.h>
#include <wolfssl/openssl/sha.h>
#else

View file

@ -319,4 +319,4 @@ static CURLcode dict_do(struct Curl_easy *data, bool *done)
return CURLE_OK;
}
#endif /*CURL_DISABLE_DICT*/
#endif /* CURL_DISABLE_DICT */

View file

@ -340,7 +340,7 @@ static CURLcode file_upload(struct Curl_easy *data)
nread = readcount;
/*skip bytes before resume point*/
/* skip bytes before resume point */
if(data->state.resume_from) {
if((curl_off_t)nread <= data->state.resume_from) {
data->state.resume_from -= nread;

View file

@ -1164,7 +1164,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data,
port++;
}
/* maybe all ports were in use already*/
/* maybe all ports were in use already */
if(port > port_max) {
failf(data, "bind() failed, we ran out of ports");
Curl_closesocket(data, conn, portsock);

View file

@ -236,4 +236,4 @@ static CURLcode gopher_do(struct Curl_easy *data, bool *done)
Curl_setup_transfer(data, FIRSTSOCKET, -1, FALSE, -1);
return CURLE_OK;
}
#endif /*CURL_DISABLE_GOPHER*/
#endif /* CURL_DISABLE_GOPHER */

View file

@ -2141,7 +2141,7 @@ CURLcode Curl_http_host(struct Curl_easy *data, struct connectdata *conn)
{
const char *ptr;
if(!data->state.this_is_a_follow) {
/* Free to avoid leaking memory on multiple requests*/
/* Free to avoid leaking memory on multiple requests */
free(data->state.first_host);
data->state.first_host = strdup(conn->host.name);
@ -3117,7 +3117,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
/* continue with HTTP/1.1 when explicitly requested */
break;
default:
/* Check if user wants to use HTTP/2 with clear TCP*/
/* Check if user wants to use HTTP/2 with clear TCP */
#ifdef USE_NGHTTP2
if(data->state.httpwant == CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE) {
#ifndef CURL_DISABLE_PROXY

View file

@ -113,7 +113,7 @@ CHUNKcode Curl_httpchunk_read(struct Curl_easy *data,
*wrote = 0; /* nothing's written yet */
/* the original data is written to the client, but we go on with the
chunk read process, to properly calculate the content length*/
chunk read process, to properly calculate the content length */
if(data->set.http_te_skip && !k->ignorebody) {
result = Curl_client_write(data, CLIENTWRITE_BODY, datap, datalen);
if(result) {

View file

@ -242,7 +242,7 @@ static int init_connpack(char *packet, char *remain, int remain_pos)
/* keep-alive 0 = disabled */
packet[remain_pos + 9] = 0x00;
packet[remain_pos + 10] = 0x3c;
/*end of variable header*/
/* end of variable header */
return remain_pos + 10;
}
@ -251,7 +251,7 @@ static CURLcode mqtt_connect(struct Curl_easy *data)
CURLcode result = CURLE_OK;
int pos = 0;
int rc = 0;
/*remain length*/
/* remain length */
int remain_pos = 0;
char remain[4] = {0};
size_t packetlen = 0;

View file

@ -311,7 +311,7 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done)
break;
case RTSPREQ_RECEIVE:
p_request = "";
/* Treat interleaved RTP as body*/
/* Treat interleaved RTP as body */
data->set.opt_no_body = FALSE;
break;
case RTSPREQ_LAST:
@ -650,7 +650,7 @@ static CURLcode rtsp_rtp_readwrite(struct Curl_easy *data,
rtp_length = RTP_PKT_LENGTH(rtp);
if(rtp_dataleft < rtp_length + 4) {
/* Need more - incomplete payload*/
/* Need more - incomplete payload */
*readmore = TRUE;
break;
}

View file

@ -62,7 +62,7 @@ struct RTSP {
* HTTP functions can safely treat this as an HTTP struct, but RTSP aware
* functions can also index into the later elements.
*/
struct HTTP http_wrapper; /*wrap HTTP to do the heavy lifting */
struct HTTP http_wrapper; /* wrap HTTP to do the heavy lifting */
long CSeq_sent; /* CSeq of this request */
long CSeq_recv; /* CSeq received */

View file

@ -571,7 +571,7 @@ void rec_do(struct Curl_easy *data, int option)
sendsuboption(data, option);
}
else if(tn->subnegotiation[option] == CURL_YES) {
/* send information to achieve this option*/
/* send information to achieve this option */
tn->us[option] = CURL_YES;
send_negotiation(data, CURL_WILL, option);
sendsuboption(data, option);

View file

@ -264,7 +264,7 @@ struct ssl_connect_data {
struct ssl_primary_config {
long version; /* what version the client wants to use */
long version_max; /* max supported version the client wants to use*/
long version_max; /* max supported version the client wants to use */
char *CApath; /* certificate dir (doesn't work on windows) */
char *CAfile; /* certificate to verify peer against */
char *issuercert; /* optional issuer certificate filename */
@ -301,7 +301,7 @@ struct ssl_config_data {
char *key_passwd; /* plain text private key password */
BIT(certinfo); /* gather lots of certificate info */
BIT(falsestart);
BIT(enable_beast); /* allow this flaw for interoperability's sake*/
BIT(enable_beast); /* allow this flaw for interoperability's sake */
BIT(no_revoke); /* disable SSL certificate revocation checks */
BIT(no_partialchain); /* don't accept partial certificate chains */
BIT(revoke_best_effort); /* ignore SSL revocation offline/missing revocation

View file

@ -142,7 +142,7 @@ bool Curl_auth_digest_get_pair(const char *str, char *value, char *content,
}
#if !defined(USE_WINDOWS_SSPI)
/* Convert md5 chunk to RFC2617 (section 3.1.3) -suitable ascii string*/
/* Convert md5 chunk to RFC2617 (section 3.1.3) -suitable ascii string */
static void auth_digest_md5_to_ascii(unsigned char *source, /* 16 bytes */
unsigned char *dest) /* 33 bytes */
{
@ -151,7 +151,7 @@ static void auth_digest_md5_to_ascii(unsigned char *source, /* 16 bytes */
msnprintf((char *) &dest[i * 2], 3, "%02x", source[i]);
}
/* Convert sha256 chunk to RFC7616 -suitable ascii string*/
/* Convert sha256 chunk to RFC7616 -suitable ascii string */
static void auth_digest_sha256_to_ascii(unsigned char *source, /* 32 bytes */
unsigned char *dest) /* 65 bytes */
{

View file

@ -471,4 +471,4 @@ void Curl_auth_cleanup_gssapi(struct kerberos5data *krb5)
krb5->token_max = 0;
}
#endif /* USE_WINDOWS_SSPI && USE_KERBEROS5*/
#endif /* USE_WINDOWS_SSPI && USE_KERBEROS5 */

View file

@ -609,9 +609,9 @@ static CURLcode ssh_knownhost(struct Curl_easy *data)
/* remove old host+key that doesn't match */
if(host)
libssh2_knownhost_del(sshc->kh, host);
/*FALLTHROUGH*/
/* FALLTHROUGH */
case CURLKHSTAT_FINE:
/*FALLTHROUGH*/
/* FALLTHROUGH */
case CURLKHSTAT_FINE_ADD_TO_FILE:
/* proceed */
if(keycheck != LIBSSH2_KNOWNHOST_CHECK_MATCH) {
@ -784,7 +784,7 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data)
size_t keylen = 0;
int sshkeytype = 0;
int rc = 0;
/* we handle the process to the callback*/
/* we handle the process to the callback */
const char *remotekey = libssh2_session_hostkey(sshc->ssh_session,
&keylen, &sshkeytype);
if(remotekey) {

View file

@ -262,7 +262,7 @@ set_ssl_version_min_max(DWORD *enabled_protocols, struct Curl_easy *data,
return CURLE_OK;
}
/*longest is 26, buffer is slightly bigger*/
/* longest is 26, buffer is slightly bigger */
#define LONGEST_ALG_ID 32
#define CIPHEROPTION(X) \
if(strcmp(#X, tmp) == 0) \
@ -289,7 +289,7 @@ get_alg_id_by_name(char *name)
CIPHEROPTION(CALG_MAC);
CIPHEROPTION(CALG_RSA_SIGN);
CIPHEROPTION(CALG_DSS_SIGN);
/*ifdefs for the options that are defined conditionally in wincrypt.h*/
/* ifdefs for the options that are defined conditionally in wincrypt.h */
#ifdef CALG_NO_SIGN
CIPHEROPTION(CALG_NO_SIGN);
#endif

View file

@ -835,7 +835,6 @@ static OSStatus SocketRead(SSLConnectionRef connection,
size_t bytesToGo = *dataLength;
size_t initLen = bytesToGo;
UInt8 *currData = (UInt8 *)data;
/*int sock = *(int *)connection;*/
struct ssl_connect_data *connssl = (struct ssl_connect_data *)connection;
struct ssl_backend_data *backend = connssl->backend;
int sock;
@ -898,7 +897,6 @@ static OSStatus SocketWrite(SSLConnectionRef connection,
size_t *dataLength) /* IN/OUT */
{
size_t bytesSent = 0;
/*int sock = *(int *)connection;*/
struct ssl_connect_data *connssl = (struct ssl_connect_data *)connection;
struct ssl_backend_data *backend = connssl->backend;
int sock;