1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

checksrc: code style: use 'char *name' style

This commit is contained in:
Daniel Stenberg 2016-11-23 07:53:24 +01:00
parent bc7e08471c
commit dbadaebfc4
68 changed files with 330 additions and 329 deletions

View File

@ -34,12 +34,12 @@ size_t writefunction(void *ptr, size_t size, size_t nmemb, void *stream)
return (nmemb*size); return (nmemb*size);
} }
static CURLcode sslctx_function(CURL * curl, void * sslctx, void * parm) static CURLcode sslctx_function(CURL *curl, void *sslctx, void *parm)
{ {
X509_STORE * store; X509_STORE *store;
X509 * cert=NULL; X509 *cert=NULL;
BIO * bio; BIO *bio;
char * mypem = /* www.cacert.org */ char *mypem = /* www.cacert.org */
"-----BEGIN CERTIFICATE-----\n"\ "-----BEGIN CERTIFICATE-----\n"\
"MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290\n"\ "MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290\n"\
"IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB\n"\ "IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB\n"\
@ -107,7 +107,7 @@ static CURLcode sslctx_function(CURL * curl, void * sslctx, void * parm)
int main(void) int main(void)
{ {
CURL * ch; CURL *ch;
CURLcode rv; CURLcode rv;
rv=curl_global_init(CURL_GLOBAL_ALL); rv=curl_global_init(CURL_GLOBAL_ALL);

View File

@ -133,14 +133,14 @@ static const char *curlx_usage[]={
/* This is a context that we pass to all callbacks */ /* This is a context that we pass to all callbacks */
typedef struct sslctxparm_st { typedef struct sslctxparm_st {
unsigned char * p12file; unsigned char *p12file;
const char * pst; const char *pst;
PKCS12 * p12; PKCS12 *p12;
EVP_PKEY * pkey; EVP_PKEY *pkey;
X509 * usercert; X509 *usercert;
STACK_OF(X509) * ca; STACK_OF(X509) * ca;
CURL * curl; CURL *curl;
BIO * errorbio; BIO *errorbio;
int accesstype; int accesstype;
int verbose; int verbose;
@ -196,7 +196,7 @@ static int ssl_app_verify_callback(X509_STORE_CTX *ctx, void *arg)
BIO_printf(p->errorbio, "entering ssl_app_verify_callback\n"); BIO_printf(p->errorbio, "entering ssl_app_verify_callback\n");
if((ok= X509_verify_cert(ctx)) && ctx->cert) { if((ok= X509_verify_cert(ctx)) && ctx->cert) {
unsigned char * accessinfo; unsigned char *accessinfo;
if(p->verbose > 1) if(p->verbose > 1)
X509_print_ex(p->errorbio, ctx->cert, 0, 0); X509_print_ex(p->errorbio, ctx->cert, 0, 0);
@ -228,10 +228,10 @@ static int ssl_app_verify_callback(X509_STORE_CTX *ctx, void *arg)
- an application verification callback (the function above) - an application verification callback (the function above)
*/ */
static CURLcode sslctxfun(CURL * curl, void * sslctx, void * parm) static CURLcode sslctxfun(CURL *curl, void *sslctx, void *parm)
{ {
sslctxparm * p = (sslctxparm *) parm; sslctxparm *p = (sslctxparm *) parm;
SSL_CTX * ctx = (SSL_CTX *) sslctx; SSL_CTX *ctx = (SSL_CTX *) sslctx;
if(!SSL_CTX_use_certificate(ctx, p->usercert)) { if(!SSL_CTX_use_certificate(ctx, p->usercert)) {
BIO_printf(p->errorbio, "SSL_CTX_use_certificate problem\n"); BIO_printf(p->errorbio, "SSL_CTX_use_certificate problem\n");
@ -270,24 +270,24 @@ int main(int argc, char **argv)
BIO* in=NULL; BIO* in=NULL;
BIO* out=NULL; BIO* out=NULL;
char * outfile = NULL; char *outfile = NULL;
char * infile = NULL; char *infile = NULL;
int tabLength=100; int tabLength=100;
char *binaryptr; char *binaryptr;
char* mimetype; char *mimetype;
char* mimetypeaccept=NULL; char *mimetypeaccept=NULL;
char* contenttype; char *contenttype;
const char** pp; const char **pp;
unsigned char* hostporturl = NULL; unsigned char *hostporturl = NULL;
BIO * p12bio; BIO *p12bio;
char **args = argv + 1; char **args = argv + 1;
unsigned char * serverurl; unsigned char *serverurl;
sslctxparm p; sslctxparm p;
char *response; char *response;
CURLcode res; CURLcode res;
struct curl_slist * headers=NULL; struct curl_slist *headers=NULL;
int badarg=0; int badarg=0;
binaryptr = malloc(tabLength); binaryptr = malloc(tabLength);

View File

@ -84,7 +84,7 @@ URL_FILE *url_fopen(const char *url, const char *operation);
int url_fclose(URL_FILE *file); int url_fclose(URL_FILE *file);
int url_feof(URL_FILE *file); int url_feof(URL_FILE *file);
size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file); size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file);
char * url_fgets(char *ptr, size_t size, URL_FILE *file); char *url_fgets(char *ptr, size_t size, URL_FILE *file);
void url_rewind(URL_FILE *file); void url_rewind(URL_FILE *file);
/* we use a global one for convenience */ /* we use a global one for convenience */

View File

@ -36,8 +36,8 @@
/* The MinGW headers are missing a few Win32 function definitions, /* The MinGW headers are missing a few Win32 function definitions,
you shouldn't need this if you use VC++ */ you shouldn't need this if you use VC++ */
#if defined(__MINGW32__) && !defined(__MINGW64__) #if defined(__MINGW32__) && !defined(__MINGW64__)
int __cdecl _snscanf(const char * input, size_t length, int __cdecl _snscanf(const char *input, size_t length,
const char * format, ...); const char *format, ...);
#endif #endif
@ -77,7 +77,7 @@ size_t readfunc(void *ptr, size_t size, size_t nmemb, void *stream)
} }
int upload(CURL *curlhandle, const char * remotepath, const char * localpath, int upload(CURL *curlhandle, const char *remotepath, const char *localpath,
long timeout, long tries) long timeout, long tries)
{ {
FILE *f; FILE *f;

View File

@ -52,7 +52,7 @@ void handle_error(const char *file, int lineno, const char *msg)
/* This array will store all of the mutexes available to OpenSSL. */ /* This array will store all of the mutexes available to OpenSSL. */
static MUTEX_TYPE *mutex_buf= NULL; static MUTEX_TYPE *mutex_buf= NULL;
static void locking_function(int mode, int n, const char * file, int line) static void locking_function(int mode, int n, const char *file, int line)
{ {
if(mode & CRYPTO_LOCK) if(mode & CRYPTO_LOCK)
MUTEX_LOCK(mutex_buf[n]); MUTEX_LOCK(mutex_buf[n]);

View File

@ -143,7 +143,7 @@ struct curl_httppost {
char *buffer; /* pointer to allocated buffer contents */ char *buffer; /* pointer to allocated buffer contents */
long bufferlength; /* length of buffer field */ long bufferlength; /* length of buffer field */
char *contenttype; /* Content-Type */ char *contenttype; /* Content-Type */
struct curl_slist* contentheader; /* list of extra headers for this form */ struct curl_slist *contentheader; /* list of extra headers for this form */
struct curl_httppost *more; /* if one field name has more than one struct curl_httppost *more; /* if one field name has more than one
file, this link should link to following file, this link should link to following
files */ files */
@ -270,7 +270,7 @@ struct curl_fileinfo {
unsigned int flags; unsigned int flags;
/* used internally */ /* used internally */
char * b_data; char *b_data;
size_t b_size; size_t b_size;
size_t b_used; size_t b_used;
}; };

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * 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, ...);
* curl_easy_duphandle() for each new thread to avoid a series of identical * curl_easy_duphandle() for each new thread to avoid a series of identical
* curl_easy_setopt() invokes in every thread. * curl_easy_setopt() invokes in every thread.
*/ */
CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl); CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);
/* /*
* NAME curl_easy_reset() * NAME curl_easy_reset()

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -151,7 +151,7 @@ _CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
"curl_easy_setopt expects a curl_off_t argument for this option") "curl_easy_setopt expects a curl_off_t argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_string, _CURL_WARNING(_curl_easy_setopt_err_string,
"curl_easy_setopt expects a " "curl_easy_setopt expects a "
"string (char* or char[]) argument for this option" "string ('char *' or char[]) argument for this option"
) )
_CURL_WARNING(_curl_easy_setopt_err_write_callback, _CURL_WARNING(_curl_easy_setopt_err_write_callback,
"curl_easy_setopt expects a curl_write_callback argument for this option") "curl_easy_setopt expects a curl_write_callback argument for this option")
@ -184,22 +184,23 @@ _CURL_WARNING(_curl_easy_setopt_err_error_buffer,
_CURL_WARNING(_curl_easy_setopt_err_FILE, _CURL_WARNING(_curl_easy_setopt_err_FILE,
"curl_easy_setopt expects a FILE* argument for this option") "curl_easy_setopt expects a FILE* argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_postfields, _CURL_WARNING(_curl_easy_setopt_err_postfields,
"curl_easy_setopt expects a void* or char* argument for this option") "curl_easy_setopt expects a 'void *' or 'char *' argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_curl_httpost, _CURL_WARNING(_curl_easy_setopt_err_curl_httpost,
"curl_easy_setopt expects a struct curl_httppost* argument for this option") "curl_easy_setopt expects a 'struct curl_httppost *' "
"argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_curl_slist, _CURL_WARNING(_curl_easy_setopt_err_curl_slist,
"curl_easy_setopt expects a struct curl_slist* argument for this option") "curl_easy_setopt expects a 'struct curl_slist *' argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_CURLSH, _CURL_WARNING(_curl_easy_setopt_err_CURLSH,
"curl_easy_setopt expects a CURLSH* argument for this option") "curl_easy_setopt expects a CURLSH* argument for this option")
_CURL_WARNING(_curl_easy_getinfo_err_string, _CURL_WARNING(_curl_easy_getinfo_err_string,
"curl_easy_getinfo expects a pointer to char * for this info") "curl_easy_getinfo expects a pointer to 'char *' for this info")
_CURL_WARNING(_curl_easy_getinfo_err_long, _CURL_WARNING(_curl_easy_getinfo_err_long,
"curl_easy_getinfo expects a pointer to long for this info") "curl_easy_getinfo expects a pointer to long for this info")
_CURL_WARNING(_curl_easy_getinfo_err_double, _CURL_WARNING(_curl_easy_getinfo_err_double,
"curl_easy_getinfo expects a pointer to double for this info") "curl_easy_getinfo expects a pointer to double for this info")
_CURL_WARNING(_curl_easy_getinfo_err_curl_slist, _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
"curl_easy_getinfo expects a pointer to struct curl_slist * for this info") "curl_easy_getinfo expects a pointer to 'struct curl_slist *' for this info")
/* groups of curl_easy_setops options that take the same type of argument */ /* groups of curl_easy_setops options that take the same type of argument */

View File

@ -155,8 +155,8 @@ struct thread_sync_data {
curl_mutex_t * mtx; curl_mutex_t * mtx;
int done; int done;
char * hostname; /* hostname to resolve, Curl_async.hostname char *hostname; /* hostname to resolve, Curl_async.hostname
duplicate */ duplicate */
int port; int port;
int sock_error; int sock_error;
Curl_addrinfo *res; Curl_addrinfo *res;
@ -200,7 +200,7 @@ void destroy_thread_sync_data(struct thread_sync_data * tsd)
/* Initialize resolver thread synchronization data */ /* Initialize resolver thread synchronization data */
static static
int init_thread_sync_data(struct thread_data * td, int init_thread_sync_data(struct thread_data * td,
const char * hostname, const char *hostname,
int port, int port,
const struct addrinfo *hints) const struct addrinfo *hints)
{ {

View File

@ -606,8 +606,8 @@ void Curl_persistconninfo(struct connectdata *conn)
} }
/* retrieves ip address and port from a sockaddr structure */ /* retrieves ip address and port from a sockaddr structure */
static bool getaddressinfo(struct sockaddr* sa, char* addr, static bool getaddressinfo(struct sockaddr *sa, char *addr,
long* port) long *port)
{ {
unsigned short us_port; unsigned short us_port;
struct sockaddr_in* si = NULL; struct sockaddr_in* si = NULL;
@ -843,7 +843,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
if(result) { if(result) {
/* no more addresses to try */ /* no more addresses to try */
const char* hostname; const char *hostname;
/* if the first address family runs out of addresses to try before /* if the first address family runs out of addresses to try before
the happy eyeball timeout, go ahead and try the next family now */ the happy eyeball timeout, go ahead and try the next family now */

View File

@ -146,12 +146,12 @@ static bool tailmatch(const char *cooke_domain, const char *hostname)
* matching cookie path and url path * matching cookie path and url path
* RFC6265 5.1.4 Paths and Path-Match * RFC6265 5.1.4 Paths and Path-Match
*/ */
static bool pathmatch(const char* cookie_path, const char* request_uri) static bool pathmatch(const char *cookie_path, const char *request_uri)
{ {
size_t cookie_path_len; size_t cookie_path_len;
size_t uri_path_len; size_t uri_path_len;
char* uri_path = NULL; char *uri_path = NULL;
char* pos; char *pos;
bool ret = FALSE; bool ret = FALSE;
/* cookie_path must not have last '/' separator. ex: /sample */ /* cookie_path must not have last '/' separator. ex: /sample */

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -59,7 +59,7 @@ int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) {
#else #else
int err; int err;
char* dot; char *dot;
#ifdef DEBUGBUILD #ifdef DEBUGBUILD

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -24,11 +24,11 @@
#ifndef CURL_DISABLE_CRYPTO_AUTH #ifndef CURL_DISABLE_CRYPTO_AUTH
typedef void (* HMAC_hinit_func)(void * context); typedef void (* HMAC_hinit_func)(void *context);
typedef void (* HMAC_hupdate_func)(void * context, typedef void (* HMAC_hupdate_func)(void *context,
const unsigned char * data, const unsigned char *data,
unsigned int len); unsigned int len);
typedef void (* HMAC_hfinal_func)(unsigned char * result, void * context); typedef void (* HMAC_hfinal_func)(unsigned char *result, void *context);
/* Per-hash function HMAC parameters. */ /* Per-hash function HMAC parameters. */
@ -46,21 +46,21 @@ typedef struct {
/* HMAC computation context. */ /* HMAC computation context. */
typedef struct { typedef struct {
const HMAC_params * hmac_hash; /* Hash function definition. */ const HMAC_params *hmac_hash; /* Hash function definition. */
void * hmac_hashctxt1; /* Hash function context 1. */ void *hmac_hashctxt1; /* Hash function context 1. */
void * hmac_hashctxt2; /* Hash function context 2. */ void *hmac_hashctxt2; /* Hash function context 2. */
} HMAC_context; } HMAC_context;
/* Prototypes. */ /* Prototypes. */
HMAC_context * Curl_HMAC_init(const HMAC_params * hashparams, HMAC_context * Curl_HMAC_init(const HMAC_params *hashparams,
const unsigned char * key, const unsigned char *key,
unsigned int keylen); unsigned int keylen);
int Curl_HMAC_update(HMAC_context * context, int Curl_HMAC_update(HMAC_context *context,
const unsigned char * data, const unsigned char *data,
unsigned int len); unsigned int len);
int Curl_HMAC_final(HMAC_context * context, unsigned char * result); int Curl_HMAC_final(HMAC_context *context, unsigned char *result);
#endif #endif

View File

@ -266,9 +266,9 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
conn->host.name; conn->host.name;
const long int port = SSL_IS_PROXY() ? conn->port : conn->remote_port; const long int port = SSL_IS_PROXY() ? conn->port : conn->remote_port;
#if defined(USE_KERBEROS5) #if defined(USE_KERBEROS5)
const char* service = data->set.str[STRING_SERVICE_NAME] ? const char *service = data->set.str[STRING_SERVICE_NAME] ?
data->set.str[STRING_SERVICE_NAME] : data->set.str[STRING_SERVICE_NAME] :
sasl->params->service; sasl->params->service;
#endif #endif
sasl->force_ir = force_ir; /* Latch for future use */ sasl->force_ir = force_ir; /* Latch for future use */

View File

@ -467,8 +467,8 @@
# ifdef __minix # ifdef __minix
/* Minix 3 versions up to at least 3.1.3 are missing these prototypes */ /* Minix 3 versions up to at least 3.1.3 are missing these prototypes */
extern char * strtok_r(char *s, const char *delim, char **last); extern char *strtok_r(char *s, const char *delim, char **last);
extern struct tm * gmtime_r(const time_t * const timep, struct tm *tmp); extern struct tm *gmtime_r(const time_t * const timep, struct tm *tmp);
# endif # endif
# define DIR_CHAR "/" # define DIR_CHAR "/"

View File

@ -313,7 +313,7 @@ static CURLcode file_upload(struct connectdata *conn)
curl_off_t bytecount = 0; curl_off_t bytecount = 0;
struct timeval now = Curl_tvnow(); struct timeval now = Curl_tvnow();
struct_stat file_stat; struct_stat file_stat;
const char* buf2; const char *buf2;
/* /*
* Since FILE: doesn't do the full init, we need to provide some extra * Since FILE: doesn't do the full init, we need to provide some extra

View File

@ -81,7 +81,7 @@ AddHttpPost(char *name, size_t namelength,
char *buffer, size_t bufferlength, char *buffer, size_t bufferlength,
char *contenttype, char *contenttype,
long flags, long flags,
struct curl_slist* contentHeader, struct curl_slist *contentHeader,
char *showfilename, char *userp, char *showfilename, char *userp,
struct curl_httppost *parent_post, struct curl_httppost *parent_post,
struct curl_httppost **httppost, struct curl_httppost **httppost,
@ -548,9 +548,9 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
{ {
/* this "cast increases required alignment of target type" but /* this "cast increases required alignment of target type" but
we consider it OK anyway */ we consider it OK anyway */
struct curl_slist* list = array_state? struct curl_slist *list = array_state?
(struct curl_slist*)(void*)array_value: (struct curl_slist *)(void *)array_value:
va_arg(params, struct curl_slist*); va_arg(params, struct curl_slist *);
if(current_form->contentheader) if(current_form->contentheader)
return_value = CURL_FORMADD_OPTION_TWICE; return_value = CURL_FORMADD_OPTION_TWICE;
@ -762,8 +762,8 @@ CURLFORMcode curl_formadd(struct curl_httppost **httppost,
* and CD/DVD images should be either a STREAM_LF format or a fixed format. * and CD/DVD images should be either a STREAM_LF format or a fixed format.
* *
*/ */
curl_off_t VmsRealFileSize(const char * name, curl_off_t VmsRealFileSize(const char *name,
const struct_stat * stat_buf) const struct_stat *stat_buf)
{ {
char buffer[8192]; char buffer[8192];
curl_off_t count; curl_off_t count;
@ -792,8 +792,8 @@ curl_off_t VmsRealFileSize(const char * name,
* if not to call a routine to get the correct size. * if not to call a routine to get the correct size.
* *
*/ */
static curl_off_t VmsSpecialSize(const char * name, static curl_off_t VmsSpecialSize(const char *name,
const struct_stat * stat_buf) const struct_stat *stat_buf)
{ {
switch(stat_buf->st_fab_rfm) { switch(stat_buf->st_fab_rfm) {
case FAB$C_VAR: case FAB$C_VAR:
@ -1167,7 +1167,7 @@ CURLcode Curl_getformdata(struct Curl_easy *data,
curl_off_t size = 0; /* support potentially ENORMOUS formposts */ curl_off_t size = 0; /* support potentially ENORMOUS formposts */
char *boundary; char *boundary;
char *fileboundary = NULL; char *fileboundary = NULL;
struct curl_slist* curList; struct curl_slist *curList;
*finalform = NULL; /* default form is empty */ *finalform = NULL; /* default form is empty */

View File

@ -65,7 +65,7 @@ typedef struct FormInfo {
file name will be used */ file name will be used */
bool showfilename_alloc; bool showfilename_alloc;
char *userp; /* pointer for the read callback */ char *userp; /* pointer for the read callback */
struct curl_slist* contentheader; struct curl_slist *contentheader;
struct FormInfo *more; struct FormInfo *more;
} FormInfo; } FormInfo;

View File

@ -143,7 +143,7 @@ struct ftp_conn {
ftpstate state_saved; /* transfer type saved to be reloaded after ftpstate state_saved; /* transfer type saved to be reloaded after
data connection is established */ data connection is established */
curl_off_t retr_size_saved; /* Size of retrieved file saved */ curl_off_t retr_size_saved; /* Size of retrieved file saved */
char * server_os; /* The target server operating system. */ char *server_os; /* The target server operating system. */
curl_off_t known_filesize; /* file size is different from -1, if wildcard curl_off_t known_filesize; /* file size is different from -1, if wildcard
LIST parsing was done and wc_statemach set LIST parsing was done and wc_statemach set
it */ it */

View File

@ -291,9 +291,9 @@ Curl_hash_clean_with_criterium(struct curl_hash *h, void *user,
} }
} }
size_t Curl_hash_str(void* key, size_t key_length, size_t slots_num) size_t Curl_hash_str(void *key, size_t key_length, size_t slots_num)
{ {
const char* key_str = (const char *) key; const char *key_str = (const char *) key;
const char *end = key_str + key_length; const char *end = key_str + key_length;
unsigned long h = 5381; unsigned long h = 5381;

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -29,16 +29,16 @@
#include "llist.h" #include "llist.h"
/* Hash function prototype */ /* Hash function prototype */
typedef size_t (*hash_function) (void* key, typedef size_t (*hash_function) (void *key,
size_t key_length, size_t key_length,
size_t slots_num); size_t slots_num);
/* /*
Comparator function prototype. Compares two keys. Comparator function prototype. Compares two keys.
*/ */
typedef size_t (*comp_function) (void* key1, typedef size_t (*comp_function) (void *key1,
size_t key1_len, size_t key1_len,
void*key2, void *key2,
size_t key2_len); size_t key2_len);
typedef void (*curl_hash_dtor)(void *); typedef void (*curl_hash_dtor)(void *);
@ -76,7 +76,7 @@ int Curl_hash_init(struct curl_hash *h,
void *Curl_hash_add(struct curl_hash *h, void *key, size_t key_len, void *p); void *Curl_hash_add(struct curl_hash *h, void *key, size_t key_len, void *p);
int Curl_hash_delete(struct curl_hash *h, void *key, size_t key_len); int Curl_hash_delete(struct curl_hash *h, void *key, size_t key_len);
void *Curl_hash_pick(struct curl_hash *, void * key, size_t key_len); void *Curl_hash_pick(struct curl_hash *, void *key, size_t key_len);
void Curl_hash_apply(struct curl_hash *h, void *user, void Curl_hash_apply(struct curl_hash *h, void *user,
void (*cb)(void *user, void *ptr)); void (*cb)(void *user, void *ptr));
int Curl_hash_count(struct curl_hash *h); int Curl_hash_count(struct curl_hash *h);
@ -84,10 +84,9 @@ void Curl_hash_destroy(struct curl_hash *h);
void Curl_hash_clean(struct curl_hash *h); void Curl_hash_clean(struct curl_hash *h);
void Curl_hash_clean_with_criterium(struct curl_hash *h, void *user, void Curl_hash_clean_with_criterium(struct curl_hash *h, void *user,
int (*comp)(void *, void *)); int (*comp)(void *, void *));
size_t Curl_hash_str(void* key, size_t key_length, size_t slots_num); size_t Curl_hash_str(void *key, size_t key_length, size_t slots_num);
size_t Curl_str_key_compare(void*k1, size_t key1_len, void*k2, size_t Curl_str_key_compare(void *k1, size_t key1_len, void *k2,
size_t key2_len); size_t key2_len);
void Curl_hash_start_iterate(struct curl_hash *hash, void Curl_hash_start_iterate(struct curl_hash *hash,
struct curl_hash_iterator *iter); struct curl_hash_iterator *iter);
struct curl_hash_element * struct curl_hash_element *

View File

@ -49,12 +49,12 @@ static const unsigned char hmac_opad = 0x5C;
HMAC_context * HMAC_context *
Curl_HMAC_init(const HMAC_params * hashparams, Curl_HMAC_init(const HMAC_params * hashparams,
const unsigned char * key, const unsigned char *key,
unsigned int keylen) unsigned int keylen)
{ {
size_t i; size_t i;
HMAC_context * ctxt; HMAC_context *ctxt;
unsigned char * hkey; unsigned char *hkey;
unsigned char b; unsigned char b;
/* Create HMAC context. */ /* Create HMAC context. */
@ -101,7 +101,7 @@ Curl_HMAC_init(const HMAC_params * hashparams,
} }
int Curl_HMAC_update(HMAC_context * ctxt, int Curl_HMAC_update(HMAC_context * ctxt,
const unsigned char * data, const unsigned char *data,
unsigned int len) unsigned int len)
{ {
/* Update first hash calculation. */ /* Update first hash calculation. */
@ -110,7 +110,7 @@ int Curl_HMAC_update(HMAC_context * ctxt,
} }
int Curl_HMAC_final(HMAC_context * ctxt, unsigned char * result) int Curl_HMAC_final(HMAC_context *ctxt, unsigned char *result)
{ {
const HMAC_params * hashparams = ctxt->hmac_hash; const HMAC_params * hashparams = ctxt->hmac_hash;

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -143,7 +143,7 @@ int curl_dogetnameinfo(GETNAMEINFO_QUAL_ARG1 GETNAMEINFO_TYPE_ARG1 sa,
#endif #endif
/* IPv4 threadsafe resolve function used for synch and asynch builds */ /* IPv4 threadsafe resolve function used for synch and asynch builds */
Curl_addrinfo *Curl_ipv4_resolve_r(const char * hostname, int port); Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, int port);
CURLcode Curl_async_resolved(struct connectdata *conn, CURLcode Curl_async_resolved(struct connectdata *conn,
bool *protocol_connect); bool *protocol_connect);

View File

@ -68,7 +68,7 @@ unsigned int Curl_ipv6_scope(const struct sockaddr *sa)
#else #else
if(sa->sa_family == AF_INET6) { if(sa->sa_family == AF_INET6) {
const struct sockaddr_in6 * sa6 = (const struct sockaddr_in6 *)(void *) sa; const struct sockaddr_in6 * sa6 = (const struct sockaddr_in6 *)(void *) sa;
const unsigned char * b = sa6->sin6_addr.s6_addr; const unsigned char *b = sa6->sin6_addr.s6_addr;
unsigned short w = (unsigned short) ((b[0] << 8) | b[1]); unsigned short w = (unsigned short) ((b[0] << 8) | b[1]);
switch(w & 0xFFC0) { switch(w & 0xFFC0) {

View File

@ -393,7 +393,7 @@ static bool imap_endofresp(struct connectdata *conn, char *line, size_t len,
static void imap_get_message(char *buffer, char** outptr) static void imap_get_message(char *buffer, char** outptr)
{ {
size_t len = 0; size_t len = 0;
char* message = NULL; char *message = NULL;
/* Find the start of the message */ /* Find the start of the message */
for(message = buffer + 2; *message == ' ' || *message == '\t'; message++) for(message = buffer + 2; *message == ' ' || *message == '\t'; message++)

View File

@ -271,7 +271,7 @@ static CURLcode Curl_ldap(struct connectdata *conn, bool *done)
ldap_set_option(server, LDAP_OPT_SSL, LDAP_OPT_ON); ldap_set_option(server, LDAP_OPT_SSL, LDAP_OPT_ON);
#else #else
int ldap_option; int ldap_option;
char* ldap_ca = conn->ssl_config.CAfile; char *ldap_ca = conn->ssl_config.CAfile;
#if defined(CURL_HAS_NOVELL_LDAPSDK) #if defined(CURL_HAS_NOVELL_LDAPSDK)
rc = ldapssl_client_init(NULL, NULL); rc = ldapssl_client_init(NULL, NULL);
if(rc != LDAP_SUCCESS) { if(rc != LDAP_SUCCESS) {

View File

@ -45,7 +45,7 @@ static void MD5_Init(MD5_CTX * ctx)
} }
static void MD5_Update(MD5_CTX * ctx, static void MD5_Update(MD5_CTX * ctx,
const unsigned char * input, const unsigned char *input,
unsigned int inputLen) unsigned int inputLen)
{ {
md5_update(ctx, inputLen, input); md5_update(ctx, inputLen, input);
@ -71,7 +71,7 @@ static void MD5_Init(MD5_CTX * ctx)
} }
static void MD5_Update(MD5_CTX * ctx, static void MD5_Update(MD5_CTX * ctx,
const unsigned char * input, const unsigned char *input,
unsigned int inputLen) unsigned int inputLen)
{ {
gcry_md_write(*ctx, input, inputLen); gcry_md_write(*ctx, input, inputLen);

View File

@ -90,7 +90,7 @@ struct memdebug {
union { union {
curl_off_t o; curl_off_t o;
double d; double d;
void * p; void *p;
} mem[1]; } mem[1];
/* I'm hoping this is the thing with the strictest alignment /* I'm hoping this is the thing with the strictest alignment
* requirements. That also means we waste some space :-( */ * requirements. That also means we waste some space :-( */

View File

@ -290,10 +290,10 @@ static bool pop3_endofresp(struct connectdata *conn, char *line, size_t len,
* *
* Gets the authentication message from the response buffer. * Gets the authentication message from the response buffer.
*/ */
static void pop3_get_message(char *buffer, char** outptr) static void pop3_get_message(char *buffer, char **outptr)
{ {
size_t len = 0; size_t len = 0;
char* message = NULL; char *message = NULL;
/* Find the start of the message */ /* Find the start of the message */
for(message = buffer + 2; *message == ' ' || *message == '\t'; message++) for(message = buffer + 2; *message == ' ' || *message == '\t'; message++)

View File

@ -411,7 +411,7 @@ int Curl_sec_read_msg(struct connectdata *conn, char *buffer,
static int sec_set_protection_level(struct connectdata *conn) static int sec_set_protection_level(struct connectdata *conn)
{ {
int code; int code;
char* pbsz; char *pbsz;
static unsigned int buffer_size = 1 << 20; /* 1048576 */ static unsigned int buffer_size = 1 << 20; /* 1048576 */
enum protection_level level = conn->request_data_prot; enum protection_level level = conn->request_data_prot;

View File

@ -488,7 +488,7 @@ static CURLcode pausewrite(struct Curl_easy *data,
*/ */
CURLcode Curl_client_chop_write(struct connectdata *conn, CURLcode Curl_client_chop_write(struct connectdata *conn,
int type, int type,
char * ptr, char *ptr,
size_t len) size_t len)
{ {
struct Curl_easy *data = conn->data; struct Curl_easy *data = conn->data;

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -41,18 +41,18 @@ typedef unsigned long u_int32_t;
#include <qsoasync.h> #include <qsoasync.h>
#include <gssapi.h> #include <gssapi.h>
extern int Curl_getaddrinfo_a(const char * nodename, extern int Curl_getaddrinfo_a(const char *nodename,
const char * servname, const char *servname,
const struct addrinfo * hints, const struct addrinfo *hints,
struct addrinfo * * res); struct addrinfo **res);
#define getaddrinfo Curl_getaddrinfo_a #define getaddrinfo Curl_getaddrinfo_a
extern int Curl_getnameinfo_a(const struct sockaddr * sa, extern int Curl_getnameinfo_a(const struct sockaddr *sa,
curl_socklen_t salen, curl_socklen_t salen,
char * nodename, curl_socklen_t nodenamelen, char *nodename, curl_socklen_t nodenamelen,
char * servname, curl_socklen_t servnamelen, char *servname, curl_socklen_t servnamelen,
int flags); int flags);
#define getnameinfo Curl_getnameinfo_a #define getnameinfo Curl_getnameinfo_a
@ -79,7 +79,7 @@ extern int Curl_gsk_secure_soc_init(gsk_handle my_session_handle);
extern int Curl_gsk_attribute_set_buffer_a(gsk_handle my_gsk_handle, extern int Curl_gsk_attribute_set_buffer_a(gsk_handle my_gsk_handle,
GSK_BUF_ID bufID, GSK_BUF_ID bufID,
const char * buffer, const char *buffer,
int bufSize); int bufSize);
#define gsk_attribute_set_buffer Curl_gsk_attribute_set_buffer_a #define gsk_attribute_set_buffer Curl_gsk_attribute_set_buffer_a
@ -95,29 +95,29 @@ extern int Curl_gsk_attribute_set_numeric_value(gsk_handle my_gsk_handle,
extern int Curl_gsk_attribute_set_callback(gsk_handle my_gsk_handle, extern int Curl_gsk_attribute_set_callback(gsk_handle my_gsk_handle,
GSK_CALLBACK_ID callBackID, GSK_CALLBACK_ID callBackID,
void * callBackAreaPtr); void *callBackAreaPtr);
#define gsk_attribute_set_callback Curl_gsk_attribute_set_callback #define gsk_attribute_set_callback Curl_gsk_attribute_set_callback
extern int Curl_gsk_attribute_get_buffer_a(gsk_handle my_gsk_handle, extern int Curl_gsk_attribute_get_buffer_a(gsk_handle my_gsk_handle,
GSK_BUF_ID bufID, GSK_BUF_ID bufID,
const char * * buffer, const char **buffer,
int * bufSize); int *bufSize);
#define gsk_attribute_get_buffer Curl_gsk_attribute_get_buffer_a #define gsk_attribute_get_buffer Curl_gsk_attribute_get_buffer_a
extern int Curl_gsk_attribute_get_enum(gsk_handle my_gsk_handle, extern int Curl_gsk_attribute_get_enum(gsk_handle my_gsk_handle,
GSK_ENUM_ID enumID, GSK_ENUM_ID enumID,
GSK_ENUM_VALUE * enumValue); GSK_ENUM_VALUE *enumValue);
#define gsk_attribute_get_enum Curl_gsk_attribute_get_enum #define gsk_attribute_get_enum Curl_gsk_attribute_get_enum
extern int Curl_gsk_attribute_get_numeric_value(gsk_handle my_gsk_handle, extern int Curl_gsk_attribute_get_numeric_value(gsk_handle my_gsk_handle,
GSK_NUM_ID numID, GSK_NUM_ID numID,
int * numValue); int *numValue);
#define gsk_attribute_get_numeric_value Curl_gsk_attribute_get_numeric_value #define gsk_attribute_get_numeric_value Curl_gsk_attribute_get_numeric_value
extern int Curl_gsk_attribute_get_cert_info(gsk_handle my_gsk_handle, extern int Curl_gsk_attribute_get_cert_info(gsk_handle my_gsk_handle,
GSK_CERT_ID certID, GSK_CERT_ID certID,
const gsk_cert_data_elem * * certDataElem, const gsk_cert_data_elem **certDataElem,
int * certDataElementCount); int *certDataElementCount);
#define gsk_attribute_get_cert_info Curl_gsk_attribute_get_cert_info #define gsk_attribute_get_cert_info Curl_gsk_attribute_get_cert_info
extern int Curl_gsk_secure_soc_misc(gsk_handle my_session_handle, extern int Curl_gsk_secure_soc_misc(gsk_handle my_session_handle,
@ -125,13 +125,13 @@ extern int Curl_gsk_secure_soc_misc(gsk_handle my_session_handle,
#define gsk_secure_soc_misc Curl_gsk_secure_soc_misc #define gsk_secure_soc_misc Curl_gsk_secure_soc_misc
extern int Curl_gsk_secure_soc_read(gsk_handle my_session_handle, extern int Curl_gsk_secure_soc_read(gsk_handle my_session_handle,
char * readBuffer, char *readBuffer,
int readBufSize, int * amtRead); int readBufSize, int *amtRead);
#define gsk_secure_soc_read Curl_gsk_secure_soc_read #define gsk_secure_soc_read Curl_gsk_secure_soc_read
extern int Curl_gsk_secure_soc_write(gsk_handle my_session_handle, extern int Curl_gsk_secure_soc_write(gsk_handle my_session_handle,
char * writeBuffer, char *writeBuffer,
int writeBufSize, int * amtWritten); int writeBufSize, int *amtWritten);
#define gsk_secure_soc_write Curl_gsk_secure_soc_write #define gsk_secure_soc_write Curl_gsk_secure_soc_write
extern const char * Curl_gsk_strerror_a(int gsk_return_value); extern const char * Curl_gsk_strerror_a(int gsk_return_value);
@ -202,10 +202,10 @@ extern OM_uint32 Curl_gss_delete_sec_context_a(OM_uint32 * minor_status,
extern int Curl_os400_connect(int sd, struct sockaddr * destaddr, 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_bind(int sd, struct sockaddr * localaddr, int addrlen);
extern int Curl_os400_sendto(int sd, char * buffer, int buflen, int flags, 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, extern int Curl_os400_recvfrom(int sd, char *buffer, int buflen, int flags,
struct sockaddr * fromaddr, int * addrlen); struct sockaddr *fromaddr, int *addrlen);
#define connect Curl_os400_connect #define connect Curl_os400_connect
#define bind Curl_os400_bind #define bind Curl_os400_bind

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -41,7 +41,7 @@
# endif # endif
#endif #endif
#include <stdlib.h> #include <stdlib.h>
char * decc$getenv(const char * __name); char *decc$getenv(const char *__name);
#include <pwd.h> #include <pwd.h>
#include <string.h> #include <string.h>
@ -79,23 +79,24 @@
# if __INITIAL_POINTER_SIZE == 32 # if __INITIAL_POINTER_SIZE == 32
/* Translate the path, but only if the path is a VMS file specification */ /* Translate the path, but only if the path is a VMS file specification */
/* The translation is usually only needed for older versions of VMS */ /* The translation is usually only needed for older versions of VMS */
static char * vms_translate_path(const char * path) { static char *vms_translate_path(const char *path)
char * unix_path; {
char * test_str; char *unix_path;
char *test_str;
/* See if the result is in VMS format, if not, we are done */ /* See if the result is in VMS format, if not, we are done */
/* Assume that this is a PATH, not just some data */ /* Assume that this is a PATH, not just some data */
test_str = strpbrk(path, ":[<^"); test_str = strpbrk(path, ":[<^");
if(test_str == NULL) { if(test_str == NULL) {
return (char *)path; return (char *)path;
} }
unix_path = decc$translate_vms(path); unix_path = decc$translate_vms(path);
if((int)unix_path <= 0) { if((int)unix_path <= 0) {
/* We can not translate it, so return the original string */ /* We can not translate it, so return the original string */
return (char *)path; return (char *)path;
} }
} }
# else # else
/* VMS translate path is actually not needed on the current 64 bit */ /* VMS translate path is actually not needed on the current 64 bit */
@ -111,27 +112,27 @@ char * test_str;
# endif # endif
#endif #endif
static char * vms_getenv(const char * envvar) { static char *vms_getenv(const char *envvar)
{
char * result; char *result;
char * vms_path; char *vms_path;
/* first use the DECC getenv() function */
result = decc$getenv(envvar);
if(result == NULL) {
return result;
}
vms_path = result;
result = vms_translate_path(vms_path);
/* note that if you backport this to use VAX C RTL, that the VAX C RTL */
/* may do a malloc(2048) for each call to getenv(), so you will need */
/* to add a free(vms_path) */
/* Do not do a free() for DEC C RTL builds, which should be used for */
/* VMS 5.5-2 and later, even if using GCC */
/* first use the DECC getenv() function */
result = decc$getenv(envvar);
if(result == NULL) {
return result; return result;
}
vms_path = result;
result = vms_translate_path(vms_path);
/* note that if you backport this to use VAX C RTL, that the VAX C RTL */
/* may do a malloc(2048) for each call to getenv(), so you will need */
/* to add a free(vms_path) */
/* Do not do a free() for DEC C RTL builds, which should be used for */
/* VMS 5.5-2 and later, even if using GCC */
return result;
} }
@ -146,10 +147,10 @@ struct passwd * my_passwd;
# if __INITIAL_POINTER_SIZE # if __INITIAL_POINTER_SIZE
__char_ptr32 unix_path; __char_ptr32 unix_path;
# else # else
char * unix_path; char *unix_path;
# endif # endif
#else #else
char * unix_path; char *unix_path;
#endif #endif
my_passwd = decc_getpwuid(uid); my_passwd = decc_getpwuid(uid);

View File

@ -278,10 +278,10 @@ static bool smtp_endofresp(struct connectdata *conn, char *line, size_t len,
* *
* Gets the authentication message from the response buffer. * Gets the authentication message from the response buffer.
*/ */
static void smtp_get_message(char *buffer, char** outptr) static void smtp_get_message(char *buffer, char **outptr)
{ {
size_t len = 0; size_t len = 0;
char* message = NULL; char *message = NULL;
/* Find the start of the message */ /* Find the start of the message */
for(message = buffer + 4; *message == ' ' || *message == '\t'; message++) for(message = buffer + 4; *message == ' ' || *message == '\t'; message++)

View File

@ -46,7 +46,7 @@ static gss_ctx_id_t gss_context = GSS_C_NO_CONTEXT;
static int check_gss_err(struct Curl_easy *data, static int check_gss_err(struct Curl_easy *data,
OM_uint32 major_status, OM_uint32 major_status,
OM_uint32 minor_status, OM_uint32 minor_status,
const char* function) const char *function)
{ {
if(GSS_ERROR(major_status)) { if(GSS_ERROR(major_status)) {
OM_uint32 maj_stat, min_stat; OM_uint32 maj_stat, min_stat;

View File

@ -45,7 +45,7 @@
*/ */
static int check_sspi_err(struct connectdata *conn, static int check_sspi_err(struct connectdata *conn,
SECURITY_STATUS status, SECURITY_STATUS status,
const char* function) const char *function)
{ {
if(status != SEC_E_OK && if(status != SEC_E_OK &&
status != SEC_I_COMPLETE_AND_CONTINUE && status != SEC_I_COMPLETE_AND_CONTINUE &&

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -165,7 +165,7 @@ static int get_char(char c, int base)
value = c - 'a' + 10; value = c - 'a' + 10;
} }
#else #else
const char * cp; const char *cp;
int value; int value;
cp = memchr(valchars, c, 10 + 26 + 26); cp = memchr(valchars, c, 10 + 26 + 26);

View File

@ -1356,7 +1356,7 @@ static CURLcode tftp_do(struct connectdata *conn, bool *done)
static CURLcode tftp_setup_connection(struct connectdata * conn) static CURLcode tftp_setup_connection(struct connectdata * conn)
{ {
struct Curl_easy *data = conn->data; struct Curl_easy *data = conn->data;
char * type; char *type;
char command; char command;
conn->socktype = SOCK_DGRAM; /* UDP datagram based */ conn->socktype = SOCK_DGRAM; /* UDP datagram based */

View File

@ -1031,7 +1031,7 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
(data->set.postfieldsize > (curl_off_t)((size_t)-1)))) (data->set.postfieldsize > (curl_off_t)((size_t)-1))))
result = CURLE_OUT_OF_MEMORY; result = CURLE_OUT_OF_MEMORY;
else { else {
char * p; char *p;
(void) setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL); (void) setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL);
@ -4705,7 +4705,7 @@ void Curl_free_request_state(struct Curl_easy *data)
* Checks if the host is in the noproxy list. returns true if it matches * Checks if the host is in the noproxy list. returns true if it matches
* and therefore the proxy should NOT be used. * and therefore the proxy should NOT be used.
****************************************************************/ ****************************************************************/
static bool check_noproxy(const char* name, const char* no_proxy) static bool check_noproxy(const char *name, const char *no_proxy)
{ {
/* no_proxy=domain1.dom,host.domain2.dom /* no_proxy=domain1.dom,host.domain2.dom
* (a comma-separated list of hosts which should * (a comma-separated list of hosts which should
@ -4714,7 +4714,7 @@ static bool check_noproxy(const char* name, const char* no_proxy)
*/ */
size_t tok_start; size_t tok_start;
size_t tok_end; size_t tok_end;
const char* separator = ", "; const char *separator = ", ";
size_t no_proxy_len; size_t no_proxy_len;
size_t namelen; size_t namelen;
char *endptr; char *endptr;

View File

@ -468,7 +468,7 @@ struct ntlmdata {
#else #else
unsigned int flags; unsigned int flags;
unsigned char nonce[8]; unsigned char nonce[8];
void* target_info; /* TargetInfo received in the ntlm type-2 message */ void *target_info; /* TargetInfo received in the ntlm type-2 message */
unsigned int target_info_len; unsigned int target_info_len;
#endif #endif
}; };
@ -754,7 +754,7 @@ struct SingleRequest {
*/ */
struct Curl_handler { struct Curl_handler {
const char * scheme; /* URL scheme name. */ const char *scheme; /* URL scheme name. */
/* Complement to setup_connection_internals(). */ /* Complement to setup_connection_internals(). */
CURLcode (*setup_connection)(struct connectdata *); CURLcode (*setup_connection)(struct connectdata *);
@ -1054,7 +1054,7 @@ struct connectdata {
send on this pipeline */ send on this pipeline */
struct curl_llist *recv_pipe; /* List of handles waiting to read struct curl_llist *recv_pipe; /* List of handles waiting to read
their responses on this pipeline */ their responses on this pipeline */
char* master_buffer; /* The master buffer allocated on-demand; char *master_buffer; /* The master buffer allocated on-demand;
used for pipelining. */ used for pipelining. */
size_t read_pos; /* Current read position in the master buffer */ size_t read_pos; /* Current read position in the master buffer */
size_t buf_len; /* Length of the buffer?? */ size_t buf_len; /* Length of the buffer?? */
@ -1075,8 +1075,8 @@ struct connectdata {
/* used for communication with Samba's winbind daemon helper ntlm_auth */ /* used for communication with Samba's winbind daemon helper ntlm_auth */
curl_socket_t ntlm_auth_hlpr_socket; curl_socket_t ntlm_auth_hlpr_socket;
pid_t ntlm_auth_hlpr_pid; pid_t ntlm_auth_hlpr_pid;
char* challenge_header; char *challenge_header;
char* response_header; char *response_header;
#endif #endif
#endif #endif
@ -1572,10 +1572,10 @@ struct UserDefined {
curl_opensocket_callback fopensocket; /* function for checking/translating curl_opensocket_callback fopensocket; /* function for checking/translating
the address and opening the the address and opening the
socket */ socket */
void* opensocket_client; void *opensocket_client;
curl_closesocket_callback fclosesocket; /* function for closing the curl_closesocket_callback fclosesocket; /* function for closing the
socket */ socket */
void* closesocket_client; void *closesocket_client;
void *seek_client; /* pointer to pass to the seek callback */ void *seek_client; /* pointer to pass to the seek callback */
/* the 3 curl_conv_callback functions below are used on non-ASCII hosts */ /* the 3 curl_conv_callback functions below are used on non-ASCII hosts */

View File

@ -410,7 +410,7 @@ gtls_connect_step1(struct connectdata *conn,
requested in the priority string, so treat it specially requested in the priority string, so treat it specially
*/ */
#define GNUTLS_SRP "+SRP" #define GNUTLS_SRP "+SRP"
const char* prioritylist; const char *prioritylist;
const char *err = NULL; const char *err = NULL;
#endif #endif

View File

@ -455,7 +455,7 @@ mbed_connect_step2(struct connectdata *conn,
const mbedtls_x509_crt *peercert; const mbedtls_x509_crt *peercert;
#ifdef HAS_ALPN #ifdef HAS_ALPN
const char* next_protocol; const char *next_protocol;
#endif #endif
char errorbuf[128]; char errorbuf[128];

View File

@ -200,14 +200,14 @@ static const cipher_s cipherlist[] = {
#endif #endif
}; };
static const char* pem_library = "libnsspem.so"; static const char *pem_library = "libnsspem.so";
static SECMODModule* mod = NULL; static SECMODModule *mod = NULL;
/* NSPR I/O layer we use to detect blocking direction during SSL handshake */ /* NSPR I/O layer we use to detect blocking direction during SSL handshake */
static PRDescIdentity nspr_io_identity = PR_INVALID_IO_LAYER; static PRDescIdentity nspr_io_identity = PR_INVALID_IO_LAYER;
static PRIOMethods nspr_io_methods; static PRIOMethods nspr_io_methods;
static const char* nss_error_to_name(PRErrorCode code) static const char *nss_error_to_name(PRErrorCode code)
{ {
const char *name = PR_ErrorToName(code); const char *name = PR_ErrorToName(code);
if(name) if(name)
@ -337,7 +337,7 @@ static int is_file(const char *filename)
* should be later deallocated using free(). If the OOM failure occurs, we * should be later deallocated using free(). If the OOM failure occurs, we
* return NULL, too. * return NULL, too.
*/ */
static char* dup_nickname(struct Curl_easy *data, const char *str) static char *dup_nickname(struct Curl_easy *data, const char *str)
{ {
const char *n; const char *n;
@ -513,7 +513,7 @@ static CURLcode nss_cache_crl(SECItem *crl_der)
return CURLE_OK; return CURLE_OK;
} }
static CURLcode nss_load_crl(const char* crlfilename) static CURLcode nss_load_crl(const char *crlfilename)
{ {
PRFileDesc *infile; PRFileDesc *infile;
PRFileInfo info; PRFileInfo info;
@ -663,7 +663,7 @@ static CURLcode cert_stuff(struct connectdata *conn, int sockindex,
return CURLE_OK; return CURLE_OK;
} }
static char * nss_get_password(PK11SlotInfo * slot, PRBool retry, void *arg) static char *nss_get_password(PK11SlotInfo *slot, PRBool retry, void *arg)
{ {
(void)slot; /* unused */ (void)slot; /* unused */

View File

@ -2305,7 +2305,7 @@ static CURLcode ossl_connect_step2(struct connectdata *conn, int sockindex)
* negotiated * negotiated
*/ */
if(conn->bits.tls_enable_alpn) { if(conn->bits.tls_enable_alpn) {
const unsigned char* neg_protocol; const unsigned char *neg_protocol;
unsigned int len; unsigned int len;
SSL_get0_alpn_selected(connssl->handle, &neg_protocol, &len); SSL_get0_alpn_selected(connssl->handle, &neg_protocol, &len);
if(len != 0) { if(len != 0) {

View File

@ -361,7 +361,7 @@ polarssl_connect_step1(struct connectdata *conn,
#ifdef HAS_ALPN #ifdef HAS_ALPN
if(conn->bits.tls_enable_alpn) { if(conn->bits.tls_enable_alpn) {
static const char* protocols[3]; static const char *protocols[3];
int cur = 0; int cur = 0;
#ifdef USE_NGHTTP2 #ifdef USE_NGHTTP2

View File

@ -273,7 +273,7 @@ schannel_connect_step1(struct connectdata *conn, int sockindex)
if(connssl->use_alpn) { if(connssl->use_alpn) {
int cur = 0; int cur = 0;
int list_start_index = 0; int list_start_index = 0;
unsigned int* extension_len = NULL; unsigned int *extension_len = NULL;
unsigned short* list_len = NULL; unsigned short* list_len = NULL;
/* The first four bytes will be an unsigned int indicating number /* The first four bytes will be an unsigned int indicating number

View File

@ -81,13 +81,14 @@
(data->share->specifier & \ (data->share->specifier & \
(1<<CURL_LOCK_DATA_SSL_SESSION))) (1<<CURL_LOCK_DATA_SSL_SESSION)))
#define CLONE_STRING(var) if(source->var) { \ #define CLONE_STRING(var) \
dest->var = strdup(source->var); \ if(source->var) { \
if(!dest->var) \ dest->var = strdup(source->var); \
return FALSE; \ if(!dest->var) \
} \ return FALSE; \
else \ } \
dest->var = NULL; else \
dest->var = NULL;
bool bool
Curl_ssl_config_matches(struct ssl_primary_config* data, Curl_ssl_config_matches(struct ssl_primary_config* data,
@ -653,9 +654,9 @@ CURLcode Curl_ssl_push_certinfo_len(struct Curl_easy *data,
const char *value, const char *value,
size_t valuelen) size_t valuelen)
{ {
struct curl_certinfo * ci = &data->info.certs; struct curl_certinfo *ci = &data->info.certs;
char * output; char *output;
struct curl_slist * nl; struct curl_slist *nl;
CURLcode result = CURLE_OK; CURLcode result = CURLE_OK;
size_t labellen = strlen(label); size_t labellen = strlen(label);
size_t outlen = labellen + 1 + valuelen + 1; /* label:value\0 */ size_t outlen = labellen + 1 + valuelen + 1; /* label:value\0 */

View File

@ -98,12 +98,12 @@ int Curl_ssl_check_cxn(struct connectdata *conn);
/* Certificate information list handling. */ /* Certificate information list handling. */
void Curl_ssl_free_certinfo(struct Curl_easy *data); void Curl_ssl_free_certinfo(struct Curl_easy *data);
CURLcode Curl_ssl_init_certinfo(struct Curl_easy * data, int num); CURLcode Curl_ssl_init_certinfo(struct Curl_easy *data, int num);
CURLcode Curl_ssl_push_certinfo_len(struct Curl_easy * data, int certnum, CURLcode Curl_ssl_push_certinfo_len(struct Curl_easy *data, int certnum,
const char * label, const char * value, const char *label, const char *value,
size_t valuelen); size_t valuelen);
CURLcode Curl_ssl_push_certinfo(struct Curl_easy * data, int certnum, CURLcode Curl_ssl_push_certinfo(struct Curl_easy *data, int certnum,
const char * label, const char * value); const char *label, const char *value);
/* Functions to be used by SSL library adaptation functions */ /* Functions to be used by SSL library adaptation functions */

View File

@ -108,8 +108,8 @@ static const curl_OID OIDtable[] = {
*/ */
const char * Curl_getASN1Element(curl_asn1Element * elem, const char *Curl_getASN1Element(curl_asn1Element *elem,
const char * beg, const char * end) const char *beg, const char *end)
{ {
unsigned char b; unsigned char b;
unsigned long len; unsigned long len;
@ -173,9 +173,9 @@ const char * Curl_getASN1Element(curl_asn1Element * elem,
return elem->end; return elem->end;
} }
static const curl_OID * searchOID(const char * oid) static const curl_OID * searchOID(const char *oid)
{ {
const curl_OID * op; const curl_OID *op;
/* Search the null terminated OID or OID identifier in local table. /* Search the null terminated OID or OID identifier in local table.
Return the table entry pointer or NULL if not found. */ Return the table entry pointer or NULL if not found. */
@ -187,7 +187,7 @@ static const curl_OID * searchOID(const char * oid)
return (const curl_OID *) NULL; return (const curl_OID *) NULL;
} }
static const char * bool2str(const char * beg, const char * end) static const char *bool2str(const char *beg, const char *end)
{ {
/* Convert an ASN.1 Boolean value into its string representation. /* Convert an ASN.1 Boolean value into its string representation.
Return the dynamically allocated string, or NULL if source is not an Return the dynamically allocated string, or NULL if source is not an
@ -198,10 +198,10 @@ static const char * bool2str(const char * beg, const char * end)
return strdup(*beg? "TRUE": "FALSE"); return strdup(*beg? "TRUE": "FALSE");
} }
static const char * octet2str(const char * beg, const char * end) static const char *octet2str(const char *beg, const char *end)
{ {
size_t n = end - beg; size_t n = end - beg;
char * buf = NULL; char *buf = NULL;
/* Convert an ASN.1 octet string to a printable string. /* Convert an ASN.1 octet string to a printable string.
Return the dynamically allocated string, or NULL if an error occurs. */ Return the dynamically allocated string, or NULL if an error occurs. */
@ -215,7 +215,7 @@ static const char * octet2str(const char * beg, const char * end)
return buf; return buf;
} }
static const char * bit2str(const char * beg, const char * end) static const char *bit2str(const char *beg, const char *end)
{ {
/* Convert an ASN.1 bit string to a printable string. /* Convert an ASN.1 bit string to a printable string.
Return the dynamically allocated string, or NULL if an error occurs. */ Return the dynamically allocated string, or NULL if an error occurs. */
@ -225,7 +225,7 @@ static const char * bit2str(const char * beg, const char * end)
return octet2str(beg, end); return octet2str(beg, end);
} }
static const char * int2str(const char * beg, const char * end) static const char *int2str(const char *beg, const char *end)
{ {
long val = 0; long val = 0;
size_t n = end - beg; size_t n = end - beg;
@ -251,14 +251,14 @@ static const char * int2str(const char * beg, const char * end)
} }
static ssize_t static ssize_t
utf8asn1str(char * * to, int type, const char * from, const char * end) utf8asn1str(char **to, int type, const char *from, const char *end)
{ {
size_t inlength = end - from; size_t inlength = end - from;
int size = 1; int size = 1;
size_t outlength; size_t outlength;
int charsize; int charsize;
unsigned int wc; unsigned int wc;
char * buf; char *buf;
/* Perform a lazy conversion from an ASN.1 typed string to UTF8. Allocate the /* Perform a lazy conversion from an ASN.1 typed string to UTF8. Allocate the
destination buffer dynamically. The allocation size will normally be too destination buffer dynamically. The allocation size will normally be too
@ -342,9 +342,9 @@ utf8asn1str(char * * to, int type, const char * from, const char * end)
return outlength; return outlength;
} }
static const char * string2str(int type, const char * beg, const char * end) static const char *string2str(int type, const char *beg, const char *end)
{ {
char * buf; char *buf;
/* Convert an ASN.1 String into its UTF-8 string representation. /* Convert an ASN.1 String into its UTF-8 string representation.
Return the dynamically allocated string, or NULL if an error occurs. */ Return the dynamically allocated string, or NULL if an error occurs. */
@ -354,7 +354,7 @@ static const char * string2str(int type, const char * beg, const char * end)
return buf; return buf;
} }
static int encodeUint(char * buf, int n, unsigned int x) static int encodeUint(char *buf, int n, unsigned int x)
{ {
int i = 0; int i = 0;
unsigned int y = x / 10; unsigned int y = x / 10;
@ -374,7 +374,7 @@ static int encodeUint(char * buf, int n, unsigned int x)
return i; return i;
} }
static int encodeOID(char * buf, int n, const char * beg, const char * end) static int encodeOID(char *buf, int n, const char *beg, const char *end)
{ {
int i = 0; int i = 0;
unsigned int x; unsigned int x;
@ -413,9 +413,9 @@ static int encodeOID(char * buf, int n, const char * beg, const char * end)
return i; return i;
} }
static const char * OID2str(const char * beg, const char * end, bool symbolic) static const char *OID2str(const char *beg, const char *end, bool symbolic)
{ {
char * buf = (char *) NULL; char *buf = (char *) NULL;
const curl_OID * op; const curl_OID * op;
int n; int n;
@ -443,14 +443,14 @@ static const char * OID2str(const char * beg, const char * end, bool symbolic)
return buf; return buf;
} }
static const char * GTime2str(const char * beg, const char * end) static const char *GTime2str(const char *beg, const char *end)
{ {
const char * tzp; const char *tzp;
const char * fracp; const char *fracp;
char sec1, sec2; char sec1, sec2;
size_t fracl; size_t fracl;
size_t tzl; size_t tzl;
const char * sep = ""; const char *sep = "";
/* Convert an ASN.1 Generalized time to a printable string. /* Convert an ASN.1 Generalized time to a printable string.
Return the dynamically allocated string, or NULL if an error occurs. */ Return the dynamically allocated string, or NULL if an error occurs. */
@ -506,11 +506,11 @@ static const char * GTime2str(const char * beg, const char * end)
sep, tzl, tzp); sep, tzl, tzp);
} }
static const char * UTime2str(const char * beg, const char * end) static const char *UTime2str(const char *beg, const char *end)
{ {
const char * tzp; const char *tzp;
size_t tzl; size_t tzl;
const char * sec; const char *sec;
/* Convert an ASN.1 UTC time to a printable string. /* Convert an ASN.1 UTC time to a printable string.
Return the dynamically allocated string, or NULL if an error occurs. */ Return the dynamically allocated string, or NULL if an error occurs. */
@ -545,7 +545,7 @@ static const char * UTime2str(const char * beg, const char * end)
tzl, tzp); tzl, tzp);
} }
const char * Curl_ASN1tostr(curl_asn1Element * elem, int type) const char *Curl_ASN1tostr(curl_asn1Element *elem, int type)
{ {
/* Convert an ASN.1 element to a printable string. /* Convert an ASN.1 element to a printable string.
Return the dynamically allocated string, or NULL if an error occurs. */ Return the dynamically allocated string, or NULL if an error occurs. */
@ -588,17 +588,17 @@ const char * Curl_ASN1tostr(curl_asn1Element * elem, int type)
return (const char *) NULL; /* Unsupported. */ return (const char *) NULL; /* Unsupported. */
} }
static ssize_t encodeDN(char * buf, size_t n, curl_asn1Element * dn) static ssize_t encodeDN(char *buf, size_t n, curl_asn1Element *dn)
{ {
curl_asn1Element rdn; curl_asn1Element rdn;
curl_asn1Element atv; curl_asn1Element atv;
curl_asn1Element oid; curl_asn1Element oid;
curl_asn1Element value; curl_asn1Element value;
size_t l = 0; size_t l = 0;
const char * p1; const char *p1;
const char * p2; const char *p2;
const char * p3; const char *p3;
const char * str; const char *str;
/* ASCII encode distinguished name at `dn' into the `n'-byte buffer at `buf'. /* ASCII encode distinguished name at `dn' into the `n'-byte buffer at `buf'.
Return the total string length, even if larger than `n'. */ Return the total string length, even if larger than `n'. */
@ -654,9 +654,9 @@ static ssize_t encodeDN(char * buf, size_t n, curl_asn1Element * dn)
return l; return l;
} }
const char * Curl_DNtostr(curl_asn1Element * dn) const char *Curl_DNtostr(curl_asn1Element *dn)
{ {
char * buf = (char *) NULL; char *buf = (char *) NULL;
ssize_t n = encodeDN(buf, 0, dn); ssize_t n = encodeDN(buf, 0, dn);
/* Convert an ASN.1 distinguished name into a printable string. /* Convert an ASN.1 distinguished name into a printable string.
@ -676,12 +676,12 @@ const char * Curl_DNtostr(curl_asn1Element * dn)
* X509 parser. * X509 parser.
*/ */
int Curl_parseX509(curl_X509certificate * cert, int Curl_parseX509(curl_X509certificate *cert,
const char * beg, const char * end) const char *beg, const char *end)
{ {
curl_asn1Element elem; curl_asn1Element elem;
curl_asn1Element tbsCertificate; curl_asn1Element tbsCertificate;
const char * ccp; const char *ccp;
static const char defaultVersion = 0; /* v1. */ static const char defaultVersion = 0; /* v1. */
/* ASN.1 parse an X509 certificate into structure subfields. /* ASN.1 parse an X509 certificate into structure subfields.
@ -760,7 +760,7 @@ int Curl_parseX509(curl_X509certificate * cert,
return 0; return 0;
} }
static size_t copySubstring(char * to, const char * from) static size_t copySubstring(char *to, const char *from)
{ {
size_t i; size_t i;
@ -777,8 +777,8 @@ static size_t copySubstring(char * to, const char * from)
return i; return i;
} }
static const char * dumpAlgo(curl_asn1Element * param, static const char *dumpAlgo(curl_asn1Element *param,
const char * beg, const char * end) const char *beg, const char *end)
{ {
curl_asn1Element oid; curl_asn1Element oid;
@ -793,10 +793,10 @@ static const char * dumpAlgo(curl_asn1Element * param,
return OID2str(oid.beg, oid.end, TRUE); return OID2str(oid.beg, oid.end, TRUE);
} }
static void do_pubkey_field(struct Curl_easy * data, int certnum, static void do_pubkey_field(struct Curl_easy *data, int certnum,
const char * label, curl_asn1Element * elem) const char *label, curl_asn1Element *elem)
{ {
const char * output; const char *output;
/* Generate a certificate information record for the public key. */ /* Generate a certificate information record for the public key. */
@ -810,14 +810,14 @@ static void do_pubkey_field(struct Curl_easy * data, int certnum,
} }
} }
static void do_pubkey(struct Curl_easy * data, int certnum, static void do_pubkey(struct Curl_easy *data, int certnum,
const char * algo, curl_asn1Element * param, const char *algo, curl_asn1Element *param,
curl_asn1Element * pubkey) curl_asn1Element *pubkey)
{ {
curl_asn1Element elem; curl_asn1Element elem;
curl_asn1Element pk; curl_asn1Element pk;
const char * p; const char *p;
const char * q; const char *q;
unsigned long len; unsigned long len;
unsigned int i; unsigned int i;
@ -874,18 +874,18 @@ static void do_pubkey(struct Curl_easy * data, int certnum,
#endif #endif
} }
CURLcode Curl_extract_certinfo(struct connectdata * conn, CURLcode Curl_extract_certinfo(struct connectdata *conn,
int certnum, int certnum,
const char * beg, const char *beg,
const char * end) const char *end)
{ {
curl_X509certificate cert; curl_X509certificate cert;
struct Curl_easy * data = conn->data; struct Curl_easy *data = conn->data;
curl_asn1Element param; curl_asn1Element param;
const char * ccp; const char *ccp;
char * cp1; char *cp1;
size_t cl1; size_t cl1;
char * cp2; char *cp2;
CURLcode result; CURLcode result;
unsigned long version; unsigned long version;
size_t i; size_t i;
@ -1039,12 +1039,12 @@ CURLcode Curl_extract_certinfo(struct connectdata * conn,
#if defined(USE_GSKIT) #if defined(USE_GSKIT)
static const char * checkOID(const char * beg, const char * end, static const char *checkOID(const char *beg, const char *end,
const char * oid) const char *oid)
{ {
curl_asn1Element e; curl_asn1Element e;
const char * ccp; const char *ccp;
const char * p; const char *p;
bool matched; bool matched;
/* Check if first ASN.1 element at `beg' is the given OID. /* Check if first ASN.1 element at `beg' is the given OID.
@ -1063,18 +1063,18 @@ static const char * checkOID(const char * beg, const char * end,
return matched? ccp: (const char *) NULL; return matched? ccp: (const char *) NULL;
} }
CURLcode Curl_verifyhost(struct connectdata * conn, CURLcode Curl_verifyhost(struct connectdata *conn,
const char * beg, const char * end) const char *beg, const char *end)
{ {
struct Curl_easy * data = conn->data; struct Curl_easy *data = conn->data;
curl_X509certificate cert; curl_X509certificate cert;
curl_asn1Element dn; curl_asn1Element dn;
curl_asn1Element elem; curl_asn1Element elem;
curl_asn1Element ext; curl_asn1Element ext;
curl_asn1Element name; curl_asn1Element name;
const char * p; const char *p;
const char * q; const char *q;
char * dnsname; char *dnsname;
int matched = -1; int matched = -1;
size_t addrlen = (size_t) -1; size_t addrlen = (size_t) -1;
ssize_t len; ssize_t len;

View File

@ -120,16 +120,15 @@ typedef struct {
* Prototypes. * Prototypes.
*/ */
const char * Curl_getASN1Element(curl_asn1Element * elem, const char *Curl_getASN1Element(curl_asn1Element *elem,
const char * beg, const char * end); const char *beg, const char *end);
const char * Curl_ASN1tostr(curl_asn1Element * elem, int type); const char *Curl_ASN1tostr(curl_asn1Element *elem, int type);
const char * Curl_DNtostr(curl_asn1Element * dn); const char *Curl_DNtostr(curl_asn1Element *dn);
int Curl_parseX509(curl_X509certificate * cert, int Curl_parseX509(curl_X509certificate *cert,
const char * beg, const char * end); const char *beg, const char *end);
CURLcode Curl_extract_certinfo(struct connectdata * conn, int certnum, CURLcode Curl_extract_certinfo(struct connectdata *conn, int certnum,
const char * beg, const char * end); const char *beg, const char *end);
CURLcode Curl_verifyhost(struct connectdata * conn, CURLcode Curl_verifyhost(struct connectdata *conn,
const char * beg, const char * end); const char *beg, const char *end);
#endif /* USE_GSKIT or USE_NSS or USE_GNUTLS or USE_CYASSL or USE_SCHANNEL */ #endif /* USE_GSKIT or USE_NSS or USE_GNUTLS or USE_CYASSL or USE_SCHANNEL */
#endif /* HEADER_CURL_X509ASN1_H */ #endif /* HEADER_CURL_X509ASN1_H */

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -30,7 +30,7 @@
/* /*
* Returning NULL will abort the continued operation! * Returning NULL will abort the continued operation!
*/ */
char* getpass_r(const char *prompt, char* buffer, size_t buflen); char *getpass_r(const char *prompt, char *buffer, size_t buflen);
#endif #endif
#endif /* HEADER_CURL_TOOL_GETPASS_H */ #endif /* HEADER_CURL_TOOL_GETPASS_H */

View File

@ -143,8 +143,8 @@ static bool is_fatal_error(CURLcode code)
* and CD/DVD images should be either a STREAM_LF format or a fixed format. * and CD/DVD images should be either a STREAM_LF format or a fixed format.
* *
*/ */
static curl_off_t vms_realfilesize(const char * name, static curl_off_t vms_realfilesize(const char *name,
const struct_stat * stat_buf) const struct_stat *stat_buf)
{ {
char buffer[8192]; char buffer[8192];
curl_off_t count; curl_off_t count;
@ -174,8 +174,8 @@ static curl_off_t vms_realfilesize(const char * name,
* if not to call a routine to get the correct size. * if not to call a routine to get the correct size.
* *
*/ */
static curl_off_t VmsSpecialSize(const char * name, static curl_off_t VmsSpecialSize(const char *name,
const struct_stat * stat_buf) const struct_stat *stat_buf)
{ {
switch(stat_buf->st_fab_rfm) { switch(stat_buf->st_fab_rfm) {
case FAB$C_VAR: case FAB$C_VAR:

View File

@ -421,7 +421,7 @@ static CURLcode glob_parse(URLGlob *glob, char *pattern,
return res; return res;
} }
CURLcode glob_url(URLGlob** glob, char* url, unsigned long *urlnum, CURLcode glob_url(URLGlob **glob, char *url, unsigned long *urlnum,
FILE *error) FILE *error)
{ {
/* /*

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -33,7 +33,7 @@
static const struct static const struct
{ {
const char * name; const char *name;
CURLINFO id; CURLINFO id;
enum { enum {
writeenv_NONE, writeenv_NONE,
@ -59,7 +59,7 @@ static const struct
{NULL, 0, writeenv_NONE} {NULL, 0, writeenv_NONE}
}; };
static void internalSetEnv(const char * name, char * value) static void internalSetEnv(const char *name, char *value)
{ {
/* Add your OS-specific code here. */ /* Add your OS-specific code here. */
#ifdef __riscos__ #ifdef __riscos__

View File

@ -29,8 +29,8 @@
int test(char *URL) int test(char *URL)
{ {
CURL* curls = NULL; CURL *curls = NULL;
CURLM* multi = NULL; CURLM *multi = NULL;
int still_running; int still_running;
int i = TEST_ERR_FAILURE; int i = TEST_ERR_FAILURE;
int res = 0; int res = 0;

View File

@ -41,8 +41,8 @@
int test(char *URL) int test(char *URL)
{ {
CURL* easy = NULL; CURL *easy = NULL;
CURLM* multi = NULL; CURLM *multi = NULL;
int still_running; int still_running;
int res = 0; int res = 0;

View File

@ -68,7 +68,7 @@ int test(char *URL)
CURLM *mcurl = NULL; CURLM *mcurl = NULL;
int still_running = 1; int still_running = 1;
struct timeval mp_start; struct timeval mp_start;
struct curl_slist* rcpt_list = NULL; struct curl_slist *rcpt_list = NULL;
curl_global_init(CURL_GLOBAL_DEFAULT); curl_global_init(CURL_GLOBAL_DEFAULT);

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -26,7 +26,7 @@
int test(char *URL) int test(char *URL)
{ {
long unmet; long unmet;
CURL* curl = NULL; CURL *curl = NULL;
int res = 0; int res = 0;
global_init(CURL_GLOBAL_ALL); global_init(CURL_GLOBAL_ALL);

View File

@ -113,7 +113,7 @@ test_cleanup:
int test(char *URL) int test(char *URL)
{ {
CURLM* multi = NULL; CURLM *multi = NULL;
int res = 0; int res = 0;
char *address = libtest_arg2; char *address = libtest_arg2;
char *port = libtest_arg3; char *port = libtest_arg3;

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -29,8 +29,8 @@
int test(char *URL) int test(char *URL)
{ {
CURL* curls = NULL; CURL *curls = NULL;
CURLM* multi = NULL; CURLM *multi = NULL;
int still_running; int still_running;
int i = -1; int i = -1;
int res = 0; int res = 0;

View File

@ -48,7 +48,7 @@
CURL *eh[NUM_HANDLES]; CURL *eh[NUM_HANDLES];
static int init(int num, CURLM *cm, const char* url, const char* userpwd, static int init(int num, CURLM *cm, const char *url, const char *userpwd,
struct curl_slist *headers) struct curl_slist *headers)
{ {
int res = 0; int res = 0;
@ -99,7 +99,7 @@ init_failed:
return res; /* failure */ return res; /* failure */
} }
static int loop(int num, CURLM *cm, const char* url, const char* userpwd, static int loop(int num, CURLM *cm, const char *url, const char *userpwd,
struct curl_slist *headers) struct curl_slist *headers)
{ {
CURLMsg *msg; CURLMsg *msg;

View File

@ -147,7 +147,7 @@ static size_t write_callback(void *ptr, size_t size, size_t nmemb,
} }
static curlioerr ioctl_callback(CURL * handle, int cmd, void *clientp) static curlioerr ioctl_callback(CURL *handle, int cmd, void *clientp)
{ {
(void)clientp; (void)clientp;
if(cmd == CURLIOCMD_RESTARTREAD) { if(cmd == CURLIOCMD_RESTARTREAD) {

View File

@ -145,10 +145,10 @@ static int curlTimerCallback(CURLM *multi, long timeout_ms, void *userp)
/** /**
* Check for curl completion. * Check for curl completion.
*/ */
static int checkForCompletion(CURLM* curl, int* success) static int checkForCompletion(CURLM *curl, int *success)
{ {
int numMessages; int numMessages;
CURLMsg* message; CURLMsg *message;
int result = 0; int result = 0;
*success = 0; *success = 0;
while((message = curl_multi_info_read(curl, &numMessages)) != NULL) { while((message = curl_multi_info_read(curl, &numMessages)) != NULL) {

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2011, 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -33,8 +33,8 @@
int test(char *URL) int test(char *URL)
{ {
int stillRunning; int stillRunning;
CURLM* multiHandle = NULL; CURLM *multiHandle = NULL;
CURL* curl = NULL; CURL *curl = NULL;
int res = 0; int res = 0;
global_init(CURL_GLOBAL_ALL); global_init(CURL_GLOBAL_ALL);

View File

@ -32,7 +32,7 @@ static CURLcode send_request(CURL *curl, const char *url, int seq,
{ {
CURLcode res; CURLcode res;
size_t len = strlen(url) + 4 + 1; size_t len = strlen(url) + 4 + 1;
char* full_url = malloc(len); char *full_url = malloc(len);
if(!full_url) { if(!full_url) {
fprintf(stderr, "Not enough memory for full url\n"); fprintf(stderr, "Not enough memory for full url\n");
return CURLE_OUT_OF_MEMORY; return CURLE_OUT_OF_MEMORY;

View File

@ -37,7 +37,7 @@ static CURL *easy[MAX_EASY_HANDLES];
static curl_socket_t sockets[MAX_EASY_HANDLES]; static curl_socket_t sockets[MAX_EASY_HANDLES];
static int res = 0; static int res = 0;
static size_t callback(char* ptr, size_t size, size_t nmemb, void* data) static size_t callback(char *ptr, size_t size, size_t nmemb, void *data)
{ {
ssize_t idx = ((CURL **) data) - easy; ssize_t idx = ((CURL **) data) - easy;
curl_socket_t sock; curl_socket_t sock;
@ -104,7 +104,7 @@ int test(char *url)
int num_handles = 0; int num_handles = 0;
enum HandleState state = ReadyForNewHandle; enum HandleState state = ReadyForNewHandle;
size_t urllen = strlen(url) + 4 + 1; size_t urllen = strlen(url) + 4 + 1;
char* full_url = malloc(urllen); char *full_url = malloc(urllen);
start_test_timing(); start_test_timing();

View File

@ -2231,9 +2231,9 @@ int main(int argc, char *argv[])
/* Clear out closed sockets */ /* Clear out closed sockets */
for(socket_idx = num_sockets - 1; socket_idx >= 1; --socket_idx) { for(socket_idx = num_sockets - 1; socket_idx >= 1; --socket_idx) {
if(CURL_SOCKET_BAD == all_sockets[socket_idx]) { if(CURL_SOCKET_BAD == all_sockets[socket_idx]) {
char* dst = (char *) (all_sockets + socket_idx); char *dst = (char *) (all_sockets + socket_idx);
char* src = (char *) (all_sockets + socket_idx + 1); char *src = (char *) (all_sockets + socket_idx + 1);
char* end = (char *) (all_sockets + num_sockets); char *end = (char *) (all_sockets + num_sockets);
memmove(dst, src, end - src); memmove(dst, src, end - src);
num_sockets -= 1; num_sockets -= 1;
} }

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -42,8 +42,8 @@ static size_t print_httppost_callback(void *arg, const char *buf, size_t len)
UNITTEST_START UNITTEST_START
int rc; int rc;
struct curl_httppost* post = NULL; struct curl_httppost *post = NULL;
struct curl_httppost* last = NULL; struct curl_httppost *last = NULL;
size_t total_size = 0; size_t total_size = 0;
char buffer[] = "test buffer"; char buffer[] = "test buffer";