Skip to content

Commit dbadaeb

Browse files
committed
checksrc: code style: use 'char *name' style
1 parent bc7e084 commit dbadaeb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+331
-330
lines changed

docs/examples/cacertinmem.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ size_t writefunction(void *ptr, size_t size, size_t nmemb, void *stream)
3434
return (nmemb*size);
3535
}
3636

37-
static CURLcode sslctx_function(CURL * curl, void * sslctx, void * parm)
37+
static CURLcode sslctx_function(CURL *curl, void *sslctx, void *parm)
3838
{
39-
X509_STORE * store;
40-
X509 * cert=NULL;
41-
BIO * bio;
42-
char * mypem = /* www.cacert.org */
39+
X509_STORE *store;
40+
X509 *cert=NULL;
41+
BIO *bio;
42+
char *mypem = /* www.cacert.org */
4343
"-----BEGIN CERTIFICATE-----\n"\
4444
"MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290\n"\
4545
"IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB\n"\
@@ -107,7 +107,7 @@ static CURLcode sslctx_function(CURL * curl, void * sslctx, void * parm)
107107

108108
int main(void)
109109
{
110-
CURL * ch;
110+
CURL *ch;
111111
CURLcode rv;
112112

113113
rv=curl_global_init(CURL_GLOBAL_ALL);

docs/examples/curlx.c

+21-21
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,14 @@ static const char *curlx_usage[]={
133133
/* This is a context that we pass to all callbacks */
134134

135135
typedef struct sslctxparm_st {
136-
unsigned char * p12file;
137-
const char * pst;
138-
PKCS12 * p12;
139-
EVP_PKEY * pkey;
140-
X509 * usercert;
136+
unsigned char *p12file;
137+
const char *pst;
138+
PKCS12 *p12;
139+
EVP_PKEY *pkey;
140+
X509 *usercert;
141141
STACK_OF(X509) * ca;
142-
CURL * curl;
143-
BIO * errorbio;
142+
CURL *curl;
143+
BIO *errorbio;
144144
int accesstype;
145145
int verbose;
146146

@@ -196,7 +196,7 @@ static int ssl_app_verify_callback(X509_STORE_CTX *ctx, void *arg)
196196
BIO_printf(p->errorbio, "entering ssl_app_verify_callback\n");
197197

198198
if((ok= X509_verify_cert(ctx)) && ctx->cert) {
199-
unsigned char * accessinfo;
199+
unsigned char *accessinfo;
200200
if(p->verbose > 1)
201201
X509_print_ex(p->errorbio, ctx->cert, 0, 0);
202202

@@ -228,10 +228,10 @@ static int ssl_app_verify_callback(X509_STORE_CTX *ctx, void *arg)
228228
- an application verification callback (the function above)
229229
*/
230230

231-
static CURLcode sslctxfun(CURL * curl, void * sslctx, void * parm)
231+
static CURLcode sslctxfun(CURL *curl, void *sslctx, void *parm)
232232
{
233-
sslctxparm * p = (sslctxparm *) parm;
234-
SSL_CTX * ctx = (SSL_CTX *) sslctx;
233+
sslctxparm *p = (sslctxparm *) parm;
234+
SSL_CTX *ctx = (SSL_CTX *) sslctx;
235235

236236
if(!SSL_CTX_use_certificate(ctx, p->usercert)) {
237237
BIO_printf(p->errorbio, "SSL_CTX_use_certificate problem\n");
@@ -270,24 +270,24 @@ int main(int argc, char **argv)
270270
BIO* in=NULL;
271271
BIO* out=NULL;
272272

273-
char * outfile = NULL;
274-
char * infile = NULL;
273+
char *outfile = NULL;
274+
char *infile = NULL;
275275

276276
int tabLength=100;
277277
char *binaryptr;
278-
char* mimetype;
279-
char* mimetypeaccept=NULL;
280-
char* contenttype;
281-
const char** pp;
282-
unsigned char* hostporturl = NULL;
283-
BIO * p12bio;
278+
char *mimetype;
279+
char *mimetypeaccept=NULL;
280+
char *contenttype;
281+
const char **pp;
282+
unsigned char *hostporturl = NULL;
283+
BIO *p12bio;
284284
char **args = argv + 1;
285-
unsigned char * serverurl;
285+
unsigned char *serverurl;
286286
sslctxparm p;
287287
char *response;
288288

289289
CURLcode res;
290-
struct curl_slist * headers=NULL;
290+
struct curl_slist *headers=NULL;
291291
int badarg=0;
292292

293293
binaryptr = malloc(tabLength);

docs/examples/fopen.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ URL_FILE *url_fopen(const char *url, const char *operation);
8484
int url_fclose(URL_FILE *file);
8585
int url_feof(URL_FILE *file);
8686
size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file);
87-
char * url_fgets(char *ptr, size_t size, URL_FILE *file);
87+
char *url_fgets(char *ptr, size_t size, URL_FILE *file);
8888
void url_rewind(URL_FILE *file);
8989

9090
/* we use a global one for convenience */

docs/examples/ftpuploadresume.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
/* The MinGW headers are missing a few Win32 function definitions,
3737
you shouldn't need this if you use VC++ */
3838
#if defined(__MINGW32__) && !defined(__MINGW64__)
39-
int __cdecl _snscanf(const char * input, size_t length,
40-
const char * format, ...);
39+
int __cdecl _snscanf(const char *input, size_t length,
40+
const char *format, ...);
4141
#endif
4242

4343

@@ -77,7 +77,7 @@ size_t readfunc(void *ptr, size_t size, size_t nmemb, void *stream)
7777
}
7878

7979

80-
int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
80+
int upload(CURL *curlhandle, const char *remotepath, const char *localpath,
8181
long timeout, long tries)
8282
{
8383
FILE *f;

docs/examples/opensslthreadlock.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void handle_error(const char *file, int lineno, const char *msg)
5252
/* This array will store all of the mutexes available to OpenSSL. */
5353
static MUTEX_TYPE *mutex_buf= NULL;
5454

55-
static void locking_function(int mode, int n, const char * file, int line)
55+
static void locking_function(int mode, int n, const char *file, int line)
5656
{
5757
if(mode & CRYPTO_LOCK)
5858
MUTEX_LOCK(mutex_buf[n]);

include/curl/curl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ struct curl_httppost {
143143
char *buffer; /* pointer to allocated buffer contents */
144144
long bufferlength; /* length of buffer field */
145145
char *contenttype; /* Content-Type */
146-
struct curl_slist* contentheader; /* list of extra headers for this form */
146+
struct curl_slist *contentheader; /* list of extra headers for this form */
147147
struct curl_httppost *more; /* if one field name has more than one
148148
file, this link should link to following
149149
files */
@@ -270,7 +270,7 @@ struct curl_fileinfo {
270270
unsigned int flags;
271271

272272
/* used internally */
273-
char * b_data;
273+
char *b_data;
274274
size_t b_size;
275275
size_t b_used;
276276
};

include/curl/easy.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* | (__| |_| | _ <| |___
88
* \___|\___/|_| \_\_____|
99
*
10-
* Copyright (C) 1998 - 2008, Daniel Stenberg, <[email protected]>, et al.
10+
* Copyright (C) 1998 - 2016, Daniel Stenberg, <[email protected]>, et al.
1111
*
1212
* This software is licensed as described in the file COPYING, which
1313
* you should have received as part of this distribution. The terms
@@ -58,7 +58,7 @@ CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
5858
* curl_easy_duphandle() for each new thread to avoid a series of identical
5959
* curl_easy_setopt() invokes in every thread.
6060
*/
61-
CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl);
61+
CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);
6262

6363
/*
6464
* NAME curl_easy_reset()

include/curl/typecheck-gcc.h

+8-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* | (__| |_| | _ <| |___
88
* \___|\___/|_| \_\_____|
99
*
10-
* Copyright (C) 1998 - 2015, Daniel Stenberg, <[email protected]>, et al.
10+
* Copyright (C) 1998 - 2016, Daniel Stenberg, <[email protected]>, et al.
1111
*
1212
* This software is licensed as described in the file COPYING, which
1313
* you should have received as part of this distribution. The terms
@@ -151,7 +151,7 @@ _CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
151151
"curl_easy_setopt expects a curl_off_t argument for this option")
152152
_CURL_WARNING(_curl_easy_setopt_err_string,
153153
"curl_easy_setopt expects a "
154-
"string (char* or char[]) argument for this option"
154+
"string ('char *' or char[]) argument for this option"
155155
)
156156
_CURL_WARNING(_curl_easy_setopt_err_write_callback,
157157
"curl_easy_setopt expects a curl_write_callback argument for this option")
@@ -184,22 +184,23 @@ _CURL_WARNING(_curl_easy_setopt_err_error_buffer,
184184
_CURL_WARNING(_curl_easy_setopt_err_FILE,
185185
"curl_easy_setopt expects a FILE* argument for this option")
186186
_CURL_WARNING(_curl_easy_setopt_err_postfields,
187-
"curl_easy_setopt expects a void* or char* argument for this option")
187+
"curl_easy_setopt expects a 'void *' or 'char *' argument for this option")
188188
_CURL_WARNING(_curl_easy_setopt_err_curl_httpost,
189-
"curl_easy_setopt expects a struct curl_httppost* argument for this option")
189+
"curl_easy_setopt expects a 'struct curl_httppost *' "
190+
"argument for this option")
190191
_CURL_WARNING(_curl_easy_setopt_err_curl_slist,
191-
"curl_easy_setopt expects a struct curl_slist* argument for this option")
192+
"curl_easy_setopt expects a 'struct curl_slist *' argument for this option")
192193
_CURL_WARNING(_curl_easy_setopt_err_CURLSH,
193194
"curl_easy_setopt expects a CURLSH* argument for this option")
194195

195196
_CURL_WARNING(_curl_easy_getinfo_err_string,
196-
"curl_easy_getinfo expects a pointer to char * for this info")
197+
"curl_easy_getinfo expects a pointer to 'char *' for this info")
197198
_CURL_WARNING(_curl_easy_getinfo_err_long,
198199
"curl_easy_getinfo expects a pointer to long for this info")
199200
_CURL_WARNING(_curl_easy_getinfo_err_double,
200201
"curl_easy_getinfo expects a pointer to double for this info")
201202
_CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
202-
"curl_easy_getinfo expects a pointer to struct curl_slist * for this info")
203+
"curl_easy_getinfo expects a pointer to 'struct curl_slist *' for this info")
203204

204205
/* groups of curl_easy_setops options that take the same type of argument */
205206

lib/asyn-thread.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ struct thread_sync_data {
155155
curl_mutex_t * mtx;
156156
int done;
157157

158-
char * hostname; /* hostname to resolve, Curl_async.hostname
159-
duplicate */
158+
char *hostname; /* hostname to resolve, Curl_async.hostname
159+
duplicate */
160160
int port;
161161
int sock_error;
162162
Curl_addrinfo *res;
@@ -200,7 +200,7 @@ void destroy_thread_sync_data(struct thread_sync_data * tsd)
200200
/* Initialize resolver thread synchronization data */
201201
static
202202
int init_thread_sync_data(struct thread_data * td,
203-
const char * hostname,
203+
const char *hostname,
204204
int port,
205205
const struct addrinfo *hints)
206206
{

lib/connect.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,8 @@ void Curl_persistconninfo(struct connectdata *conn)
606606
}
607607

608608
/* retrieves ip address and port from a sockaddr structure */
609-
static bool getaddressinfo(struct sockaddr* sa, char* addr,
610-
long* port)
609+
static bool getaddressinfo(struct sockaddr *sa, char *addr,
610+
long *port)
611611
{
612612
unsigned short us_port;
613613
struct sockaddr_in* si = NULL;
@@ -843,7 +843,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
843843
if(result) {
844844
/* no more addresses to try */
845845

846-
const char* hostname;
846+
const char *hostname;
847847

848848
/* if the first address family runs out of addresses to try before
849849
the happy eyeball timeout, go ahead and try the next family now */

lib/cookie.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,12 @@ static bool tailmatch(const char *cooke_domain, const char *hostname)
146146
* matching cookie path and url path
147147
* RFC6265 5.1.4 Paths and Path-Match
148148
*/
149-
static bool pathmatch(const char* cookie_path, const char* request_uri)
149+
static bool pathmatch(const char *cookie_path, const char *request_uri)
150150
{
151151
size_t cookie_path_len;
152152
size_t uri_path_len;
153-
char* uri_path = NULL;
154-
char* pos;
153+
char *uri_path = NULL;
154+
char *pos;
155155
bool ret = FALSE;
156156

157157
/* cookie_path must not have last '/' separator. ex: /sample */

lib/curl_gethostname.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* | (__| |_| | _ <| |___
66
* \___|\___/|_| \_\_____|
77
*
8-
* Copyright (C) 1998 - 2012, Daniel Stenberg, <[email protected]>, et al.
8+
* Copyright (C) 1998 - 2016, Daniel Stenberg, <[email protected]>, et al.
99
*
1010
* This software is licensed as described in the file COPYING, which
1111
* you should have received as part of this distribution. The terms
@@ -59,7 +59,7 @@ int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) {
5959

6060
#else
6161
int err;
62-
char* dot;
62+
char *dot;
6363

6464
#ifdef DEBUGBUILD
6565

lib/curl_hmac.h

+13-13
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* | (__| |_| | _ <| |___
88
* \___|\___/|_| \_\_____|
99
*
10-
* Copyright (C) 1998 - 2010, Daniel Stenberg, <[email protected]>, et al.
10+
* Copyright (C) 1998 - 2016, Daniel Stenberg, <[email protected]>, et al.
1111
*
1212
* This software is licensed as described in the file COPYING, which
1313
* you should have received as part of this distribution. The terms
@@ -24,11 +24,11 @@
2424

2525
#ifndef CURL_DISABLE_CRYPTO_AUTH
2626

27-
typedef void (* HMAC_hinit_func)(void * context);
28-
typedef void (* HMAC_hupdate_func)(void * context,
29-
const unsigned char * data,
27+
typedef void (* HMAC_hinit_func)(void *context);
28+
typedef void (* HMAC_hupdate_func)(void *context,
29+
const unsigned char *data,
3030
unsigned int len);
31-
typedef void (* HMAC_hfinal_func)(unsigned char * result, void * context);
31+
typedef void (* HMAC_hfinal_func)(unsigned char *result, void *context);
3232

3333

3434
/* Per-hash function HMAC parameters. */
@@ -46,21 +46,21 @@ typedef struct {
4646
/* HMAC computation context. */
4747

4848
typedef struct {
49-
const HMAC_params * hmac_hash; /* Hash function definition. */
50-
void * hmac_hashctxt1; /* Hash function context 1. */
51-
void * hmac_hashctxt2; /* Hash function context 2. */
49+
const HMAC_params *hmac_hash; /* Hash function definition. */
50+
void *hmac_hashctxt1; /* Hash function context 1. */
51+
void *hmac_hashctxt2; /* Hash function context 2. */
5252
} HMAC_context;
5353

5454

5555
/* Prototypes. */
5656

57-
HMAC_context * Curl_HMAC_init(const HMAC_params * hashparams,
58-
const unsigned char * key,
57+
HMAC_context * Curl_HMAC_init(const HMAC_params *hashparams,
58+
const unsigned char *key,
5959
unsigned int keylen);
60-
int Curl_HMAC_update(HMAC_context * context,
61-
const unsigned char * data,
60+
int Curl_HMAC_update(HMAC_context *context,
61+
const unsigned char *data,
6262
unsigned int len);
63-
int Curl_HMAC_final(HMAC_context * context, unsigned char * result);
63+
int Curl_HMAC_final(HMAC_context *context, unsigned char *result);
6464

6565
#endif
6666

lib/curl_sasl.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
266266
conn->host.name;
267267
const long int port = SSL_IS_PROXY() ? conn->port : conn->remote_port;
268268
#if defined(USE_KERBEROS5)
269-
const char* service = data->set.str[STRING_SERVICE_NAME] ?
270-
data->set.str[STRING_SERVICE_NAME] :
271-
sasl->params->service;
269+
const char *service = data->set.str[STRING_SERVICE_NAME] ?
270+
data->set.str[STRING_SERVICE_NAME] :
271+
sasl->params->service;
272272
#endif
273273

274274
sasl->force_ir = force_ir; /* Latch for future use */

lib/curl_setup.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,8 @@
467467

468468
# ifdef __minix
469469
/* Minix 3 versions up to at least 3.1.3 are missing these prototypes */
470-
extern char * strtok_r(char *s, const char *delim, char **last);
471-
extern struct tm * gmtime_r(const time_t * const timep, struct tm *tmp);
470+
extern char *strtok_r(char *s, const char *delim, char **last);
471+
extern struct tm *gmtime_r(const time_t * const timep, struct tm *tmp);
472472
# endif
473473

474474
# define DIR_CHAR "/"

lib/file.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ static CURLcode file_upload(struct connectdata *conn)
313313
curl_off_t bytecount = 0;
314314
struct timeval now = Curl_tvnow();
315315
struct_stat file_stat;
316-
const char* buf2;
316+
const char *buf2;
317317

318318
/*
319319
* Since FILE: doesn't do the full init, we need to provide some extra

0 commit comments

Comments
 (0)