aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-05-13 12:56:53 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-05-14 00:02:05 +0200
commit66b077576313eda129bce9f58fdc894d857cb121 (patch)
treece4989ca7204ca1fcdcc47dcc50c72d8a8898a6c /lib
parentf3f5d82e2854991cd12ad5dcf022e8abbcea7038 (diff)
checksrc: enhance the ASTERISKSPACE and update code accordingly
Fine: "struct hello *world" Not fine: "struct hello* world" (and variations) Closes #5386
Diffstat (limited to 'lib')
-rw-r--r--lib/asyn-thread.c6
-rwxr-xr-xlib/checksrc.pl6
-rw-r--r--lib/curl_threads.c4
-rw-r--r--lib/ftp.c2
-rw-r--r--lib/mime.c2
-rw-r--r--lib/select.h2
-rw-r--r--lib/setup-os400.h8
-rw-r--r--lib/setup-vms.h6
-rw-r--r--lib/socks_gssapi.c2
-rw-r--r--lib/tftp.c4
-rw-r--r--lib/url.c10
-rw-r--r--lib/url.h2
-rw-r--r--lib/vtls/mbedtls.c4
-rw-r--r--lib/vtls/vtls.c6
-rw-r--r--lib/vtls/vtls.h6
-rw-r--r--lib/vtls/wolfssl.c6
-rw-r--r--lib/x509asn1.c4
17 files changed, 40 insertions, 40 deletions
diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c
index 2138eb5cf..95bd23409 100644
--- a/lib/asyn-thread.c
+++ b/lib/asyn-thread.c
@@ -158,7 +158,7 @@ static bool init_resolve_thread(struct connectdata *conn,
/* Data for synchronization between resolver thread and its parent */
struct thread_sync_data {
- curl_mutex_t * mtx;
+ curl_mutex_t *mtx;
int done;
char *hostname; /* hostname to resolve, Curl_async.hostname
@@ -190,7 +190,7 @@ static struct thread_sync_data *conn_thread_sync_data(struct connectdata *conn)
/* Destroy resolver thread synchronization data */
static
-void destroy_thread_sync_data(struct thread_sync_data * tsd)
+void destroy_thread_sync_data(struct thread_sync_data *tsd)
{
if(tsd->mtx) {
Curl_mutex_destroy(tsd->mtx);
@@ -216,7 +216,7 @@ void destroy_thread_sync_data(struct thread_sync_data * tsd)
/* Initialize resolver thread synchronization data */
static
-int init_thread_sync_data(struct thread_data * td,
+int init_thread_sync_data(struct thread_data *td,
const char *hostname,
int port,
const struct addrinfo *hints)
diff --git a/lib/checksrc.pl b/lib/checksrc.pl
index df93696d7..cbd204adb 100755
--- a/lib/checksrc.pl
+++ b/lib/checksrc.pl
@@ -640,10 +640,10 @@ sub scanfile {
}
# check for 'char * name'
- if(($l =~ /(^.*(char|int|long|void|curl_slist|CURL|CURLM|CURLMsg|curl_httppost) *(\*+)) (\w+)/) && ($4 ne "const")) {
- checkwarn("ASTERISKNOSPACE",
+ if(($l =~ /(^.*(char|int|long|void|CURL|CURLM|CURLMsg|[cC]url_[A-Za-z_]+|struct [a-zA-Z_]+) *(\*+)) (\w+)/) && ($4 !~ /^(const|volatile)$/)) {
+ checkwarn("ASTERISKSPACE",
$line, length($1), $file, $ol,
- "no space after declarative asterisk");
+ "space after declarative asterisk");
}
# check for 'char*'
if(($l =~ /(^.*(char|int|long|void|curl_slist|CURL|CURLM|CURLMsg|curl_httppost|sockaddr_in|FILE)\*)/)) {
diff --git a/lib/curl_threads.c b/lib/curl_threads.c
index 064c075d0..b5f10a20e 100644
--- a/lib/curl_threads.c
+++ b/lib/curl_threads.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -48,7 +48,7 @@ struct curl_actual_call {
static void *curl_thread_create_thunk(void *arg)
{
- struct curl_actual_call * ac = arg;
+ struct curl_actual_call *ac = arg;
unsigned int (*func)(void *) = ac->func;
void *real_arg = ac->arg;
diff --git a/lib/ftp.c b/lib/ftp.c
index 57b22ade9..3b0f03b81 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -136,7 +136,7 @@ static int ftp_getsock(struct connectdata *conn, curl_socket_t *socks);
static int ftp_domore_getsock(struct connectdata *conn, curl_socket_t *socks);
static CURLcode ftp_doing(struct connectdata *conn,
bool *dophase_done);
-static CURLcode ftp_setup_connection(struct connectdata * conn);
+static CURLcode ftp_setup_connection(struct connectdata *conn);
static CURLcode init_wc_data(struct connectdata *conn);
static CURLcode wc_statemach(struct connectdata *conn);
diff --git a/lib/mime.c b/lib/mime.c
index e13d92e94..1d6d70f02 100644
--- a/lib/mime.c
+++ b/lib/mime.c
@@ -685,7 +685,7 @@ static void mime_mem_free(void *ptr)
/* Named file callbacks. */
/* Argument is a pointer to the mime part. */
-static int mime_open_file(curl_mimepart * part)
+static int mime_open_file(curl_mimepart *part)
{
/* Open a MIMEKIND_FILE part. */
diff --git a/lib/select.h b/lib/select.h
index 0fd8ed515..9b3e0783f 100644
--- a/lib/select.h
+++ b/lib/select.h
@@ -91,7 +91,7 @@ int Curl_wait_ms(int timeout_ms);
#ifdef TPF
int tpf_select_libcurl(int maxfds, fd_set* reads, fd_set* writes,
- fd_set* excepts, struct timeval* tv);
+ fd_set* excepts, struct timeval *tv);
#endif
/* Winsock and TPF sockets are not in range [0..FD_SETSIZE-1], which
diff --git a/lib/setup-os400.h b/lib/setup-os400.h
index 629fd94c4..b693cb3b3 100644
--- a/lib/setup-os400.h
+++ b/lib/setup-os400.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -200,10 +200,10 @@ extern OM_uint32 Curl_gss_delete_sec_context_a(OM_uint32 * minor_status,
/* Some socket functions must be wrapped to process textual addresses
like AF_UNIX. */
-extern int Curl_os400_connect(int sd, struct sockaddr * destaddr, int addrlen);
-extern int Curl_os400_bind(int sd, struct sockaddr * localaddr, int addrlen);
+extern int Curl_os400_connect(int sd, struct sockaddr *destaddr, int addrlen);
+extern int Curl_os400_bind(int sd, struct sockaddr *localaddr, int addrlen);
extern int Curl_os400_sendto(int sd, char *buffer, int buflen, int flags,
- struct sockaddr * dstaddr, int addrlen);
+ struct sockaddr *dstaddr, int addrlen);
extern int Curl_os400_recvfrom(int sd, char *buffer, int buflen, int flags,
struct sockaddr *fromaddr, int *addrlen);
extern int Curl_os400_getpeername(int sd, struct sockaddr *addr, int *addrlen);
diff --git a/lib/setup-vms.h b/lib/setup-vms.h
index 6c454aee6..482e69e46 100644
--- a/lib/setup-vms.h
+++ b/lib/setup-vms.h
@@ -73,7 +73,7 @@ char *decc$getenv(const char *__name);
# endif
#endif
- struct passwd * decc_getpwuid(uid_t uid);
+ struct passwd *decc_getpwuid(uid_t uid);
#ifdef __DECC
# if __INITIAL_POINTER_SIZE == 32
@@ -138,9 +138,9 @@ static char *vms_getenv(const char *envvar)
static struct passwd vms_passwd_cache;
-static struct passwd * vms_getpwuid(uid_t uid)
+static struct passwd *vms_getpwuid(uid_t uid)
{
- struct passwd * my_passwd;
+ struct passwd *my_passwd;
/* Hack needed to support 64 bit builds, decc_getpwnam is 32 bit only */
#ifdef __DECC
diff --git a/lib/socks_gssapi.c b/lib/socks_gssapi.c
index 7f66675fc..38a3056a4 100644
--- a/lib/socks_gssapi.c
+++ b/lib/socks_gssapi.c
@@ -115,7 +115,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
gss_buffer_desc gss_send_token = GSS_C_EMPTY_BUFFER;
gss_buffer_desc gss_recv_token = GSS_C_EMPTY_BUFFER;
gss_buffer_desc gss_w_token = GSS_C_EMPTY_BUFFER;
- gss_buffer_desc* gss_token = GSS_C_NO_BUFFER;
+ gss_buffer_desc *gss_token = GSS_C_NO_BUFFER;
gss_name_t server = GSS_C_NO_NAME;
gss_name_t gss_client_name = GSS_C_NO_NAME;
unsigned short us_length;
diff --git a/lib/tftp.c b/lib/tftp.c
index 346f293dc..368b82abe 100644
--- a/lib/tftp.c
+++ b/lib/tftp.c
@@ -154,7 +154,7 @@ static CURLcode tftp_disconnect(struct connectdata *conn,
static CURLcode tftp_do(struct connectdata *conn, bool *done);
static CURLcode tftp_done(struct connectdata *conn,
CURLcode, bool premature);
-static CURLcode tftp_setup_connection(struct connectdata * conn);
+static CURLcode tftp_setup_connection(struct connectdata *conn);
static CURLcode tftp_multi_statemach(struct connectdata *conn, bool *done);
static CURLcode tftp_doing(struct connectdata *conn, bool *dophase_done);
static int tftp_getsock(struct connectdata *conn, curl_socket_t *socks);
@@ -1384,7 +1384,7 @@ static CURLcode tftp_do(struct connectdata *conn, bool *done)
return result;
}
-static CURLcode tftp_setup_connection(struct connectdata * conn)
+static CURLcode tftp_setup_connection(struct connectdata *conn)
{
struct Curl_easy *data = conn->data;
char *type;
diff --git a/lib/url.c b/lib/url.c
index ce94bac05..f250f2ff2 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -865,8 +865,8 @@ static int IsMultiplexingPossible(const struct Curl_easy *handle,
#ifndef CURL_DISABLE_PROXY
static bool
-proxy_info_matches(const struct proxy_info* data,
- const struct proxy_info* needle)
+proxy_info_matches(const struct proxy_info *data,
+ const struct proxy_info *needle)
{
if((data->proxytype == needle->proxytype) &&
(data->port == needle->port) &&
@@ -877,8 +877,8 @@ proxy_info_matches(const struct proxy_info* data,
}
static bool
-socks_proxy_info_matches(const struct proxy_info* data,
- const struct proxy_info* needle)
+socks_proxy_info_matches(const struct proxy_info *data,
+ const struct proxy_info *needle)
{
if(!proxy_info_matches(data, needle))
return FALSE;
@@ -2002,7 +2002,7 @@ static CURLcode setup_range(struct Curl_easy *data)
*/
static CURLcode setup_connection_internals(struct connectdata *conn)
{
- const struct Curl_handler * p;
+ const struct Curl_handler *p;
CURLcode result;
/* Perform setup complement if some. */
diff --git a/lib/url.h b/lib/url.h
index 5000c512a..a22569393 100644
--- a/lib/url.h
+++ b/lib/url.h
@@ -47,7 +47,7 @@ CURLcode Curl_init_do(struct Curl_easy *data, struct connectdata *conn);
CURLcode Curl_open(struct Curl_easy **curl);
CURLcode Curl_init_userdefined(struct Curl_easy *data);
-void Curl_freeset(struct Curl_easy * data);
+void Curl_freeset(struct Curl_easy *data);
CURLcode Curl_uc_to_curlcode(CURLUcode uc);
CURLcode Curl_close(struct Curl_easy **datap); /* opposite of curl_open() */
CURLcode Curl_connect(struct Curl_easy *, bool *async, bool *protocol_connect);
diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c
index cbf3d3dec..0df6bb4ae 100644
--- a/lib/vtls/mbedtls.c
+++ b/lib/vtls/mbedtls.c
@@ -239,7 +239,7 @@ mbed_connect_step1(struct connectdata *conn,
int sockindex)
{
struct Curl_easy *data = conn->data;
- struct ssl_connect_data* connssl = &conn->ssl[sockindex];
+ struct ssl_connect_data *connssl = &conn->ssl[sockindex];
struct ssl_backend_data *backend = connssl->backend;
const char * const ssl_cafile = SSL_CONN_CONFIG(CAfile);
const bool verifypeer = SSL_CONN_CONFIG(verifypeer);
@@ -535,7 +535,7 @@ mbed_connect_step2(struct connectdata *conn,
{
int ret;
struct Curl_easy *data = conn->data;
- struct ssl_connect_data* connssl = &conn->ssl[sockindex];
+ struct ssl_connect_data *connssl = &conn->ssl[sockindex];
struct ssl_backend_data *backend = connssl->backend;
const mbedtls_x509_crt *peercert;
const char * const pinnedpubkey = SSL_IS_PROXY() ?
diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c
index f1b525227..9dc7eaee2 100644
--- a/lib/vtls/vtls.c
+++ b/lib/vtls/vtls.c
@@ -83,8 +83,8 @@
dest->var = NULL;
bool
-Curl_ssl_config_matches(struct ssl_primary_config* data,
- struct ssl_primary_config* needle)
+Curl_ssl_config_matches(struct ssl_primary_config *data,
+ struct ssl_primary_config *needle)
{
if((data->version == needle->version) &&
(data->version_max == needle->version_max) &&
@@ -127,7 +127,7 @@ Curl_clone_primary_ssl_config(struct ssl_primary_config *source,
return TRUE;
}
-void Curl_free_primary_ssl_config(struct ssl_primary_config* sslc)
+void Curl_free_primary_ssl_config(struct ssl_primary_config *sslc)
{
Curl_safefree(sslc->CApath);
Curl_safefree(sslc->CAfile);
diff --git a/lib/vtls/vtls.h b/lib/vtls/vtls.h
index a81b2f22d..d34f42ade 100644
--- a/lib/vtls/vtls.h
+++ b/lib/vtls/vtls.h
@@ -138,11 +138,11 @@ CURLcode Curl_none_md5sum(unsigned char *input, size_t inputlen,
#define SSL_CONN_CONFIG(var) (SSL_IS_PROXY() ? \
conn->proxy_ssl_config.var : conn->ssl_config.var)
-bool Curl_ssl_config_matches(struct ssl_primary_config* data,
- struct ssl_primary_config* needle);
+bool Curl_ssl_config_matches(struct ssl_primary_config *data,
+ struct ssl_primary_config *needle);
bool Curl_clone_primary_ssl_config(struct ssl_primary_config *source,
struct ssl_primary_config *dest);
-void Curl_free_primary_ssl_config(struct ssl_primary_config* sslc);
+void Curl_free_primary_ssl_config(struct ssl_primary_config *sslc);
int Curl_ssl_getsock(struct connectdata *conn, curl_socket_t *socks);
int Curl_ssl_backend(void);
diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c
index 5040b0592..4844c9e39 100644
--- a/lib/vtls/wolfssl.c
+++ b/lib/vtls/wolfssl.c
@@ -120,7 +120,7 @@ wolfssl_connect_step1(struct connectdata *conn,
{
char *ciphers;
struct Curl_easy *data = conn->data;
- struct ssl_connect_data* connssl = &conn->ssl[sockindex];
+ struct ssl_connect_data *connssl = &conn->ssl[sockindex];
struct ssl_backend_data *backend = connssl->backend;
SSL_METHOD* req_method = NULL;
curl_socket_t sockfd = conn->sock[sockindex];
@@ -423,7 +423,7 @@ wolfssl_connect_step2(struct connectdata *conn,
{
int ret = -1;
struct Curl_easy *data = conn->data;
- struct ssl_connect_data* connssl = &conn->ssl[sockindex];
+ struct ssl_connect_data *connssl = &conn->ssl[sockindex];
struct ssl_backend_data *backend = connssl->backend;
const char * const hostname = SSL_IS_PROXY() ? conn->http_proxy.host.name :
conn->host.name;
@@ -760,7 +760,7 @@ static void Curl_wolfssl_cleanup(void)
}
-static bool Curl_wolfssl_data_pending(const struct connectdata* conn,
+static bool Curl_wolfssl_data_pending(const struct connectdata *conn,
int connindex)
{
const struct ssl_connect_data *connssl = &conn->ssl[connindex];
diff --git a/lib/x509asn1.c b/lib/x509asn1.c
index ece5364d8..8fd6b5087 100644
--- a/lib/x509asn1.c
+++ b/lib/x509asn1.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -176,7 +176,7 @@ static const char *getASN1Element(curl_asn1Element *elem,
* Search the null terminated OID or OID identifier in local table.
* Return the table entry pointer or NULL if not found.
*/
-static const curl_OID * searchOID(const char *oid)
+static const curl_OID *searchOID(const char *oid)
{
const curl_OID *op;
for(op = OIDtable; op->numoid; op++)