1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 07:38: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);
}
static CURLcode sslctx_function(CURL * curl, void * sslctx, void * parm)
static CURLcode sslctx_function(CURL *curl, void *sslctx, void *parm)
{
X509_STORE * store;
X509 * cert=NULL;
BIO * bio;
char * mypem = /* www.cacert.org */
X509_STORE *store;
X509 *cert=NULL;
BIO *bio;
char *mypem = /* www.cacert.org */
"-----BEGIN CERTIFICATE-----\n"\
"MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290\n"\
"IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB\n"\
@ -107,7 +107,7 @@ static CURLcode sslctx_function(CURL * curl, void * sslctx, void * parm)
int main(void)
{
CURL * ch;
CURL *ch;
CURLcode rv;
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 */
typedef struct sslctxparm_st {
unsigned char * p12file;
const char * pst;
PKCS12 * p12;
EVP_PKEY * pkey;
X509 * usercert;
unsigned char *p12file;
const char *pst;
PKCS12 *p12;
EVP_PKEY *pkey;
X509 *usercert;
STACK_OF(X509) * ca;
CURL * curl;
BIO * errorbio;
CURL *curl;
BIO *errorbio;
int accesstype;
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");
if((ok= X509_verify_cert(ctx)) && ctx->cert) {
unsigned char * accessinfo;
unsigned char *accessinfo;
if(p->verbose > 1)
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)
*/
static CURLcode sslctxfun(CURL * curl, void * sslctx, void * parm)
static CURLcode sslctxfun(CURL *curl, void *sslctx, void *parm)
{
sslctxparm * p = (sslctxparm *) parm;
SSL_CTX * ctx = (SSL_CTX *) sslctx;
sslctxparm *p = (sslctxparm *) parm;
SSL_CTX *ctx = (SSL_CTX *) sslctx;
if(!SSL_CTX_use_certificate(ctx, p->usercert)) {
BIO_printf(p->errorbio, "SSL_CTX_use_certificate problem\n");
@ -270,24 +270,24 @@ int main(int argc, char **argv)
BIO* in=NULL;
BIO* out=NULL;
char * outfile = NULL;
char * infile = NULL;
char *outfile = NULL;
char *infile = NULL;
int tabLength=100;
char *binaryptr;
char* mimetype;
char* mimetypeaccept=NULL;
char* contenttype;
const char** pp;
unsigned char* hostporturl = NULL;
BIO * p12bio;
char *mimetype;
char *mimetypeaccept=NULL;
char *contenttype;
const char **pp;
unsigned char *hostporturl = NULL;
BIO *p12bio;
char **args = argv + 1;
unsigned char * serverurl;
unsigned char *serverurl;
sslctxparm p;
char *response;
CURLcode res;
struct curl_slist * headers=NULL;
struct curl_slist *headers=NULL;
int badarg=0;
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_feof(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);
/* we use a global one for convenience */

View File

@ -36,8 +36,8 @@
/* The MinGW headers are missing a few Win32 function definitions,
you shouldn't need this if you use VC++ */
#if defined(__MINGW32__) && !defined(__MINGW64__)
int __cdecl _snscanf(const char * input, size_t length,
const char * format, ...);
int __cdecl _snscanf(const char *input, size_t length,
const char *format, ...);
#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)
{
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. */
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)
MUTEX_LOCK(mutex_buf[n]);

View File

@ -143,7 +143,7 @@ struct curl_httppost {
char *buffer; /* pointer to allocated buffer contents */
long bufferlength; /* length of buffer field */
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
file, this link should link to following
files */
@ -270,7 +270,7 @@ struct curl_fileinfo {
unsigned int flags;
/* used internally */
char * b_data;
char *b_data;
size_t b_size;
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
* 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_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()

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
* 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_WARNING(_curl_easy_setopt_err_string,
"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_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_easy_setopt expects a FILE* argument for this option")
_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_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_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_easy_setopt expects a CURLSH* argument for this option")
_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_easy_getinfo expects a pointer to long for this info")
_CURL_WARNING(_curl_easy_getinfo_err_double,
"curl_easy_getinfo expects a pointer to double for this info")
_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 */

View File

@ -155,8 +155,8 @@ struct thread_sync_data {
curl_mutex_t * mtx;
int done;
char * hostname; /* hostname to resolve, Curl_async.hostname
duplicate */
char *hostname; /* hostname to resolve, Curl_async.hostname
duplicate */
int port;
int sock_error;
Curl_addrinfo *res;
@ -200,7 +200,7 @@ void destroy_thread_sync_data(struct thread_sync_data * tsd)
/* Initialize resolver thread synchronization data */
static
int init_thread_sync_data(struct thread_data * td,
const char * hostname,
const char *hostname,
int port,
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 */
static bool getaddressinfo(struct sockaddr* sa, char* addr,
long* port)
static bool getaddressinfo(struct sockaddr *sa, char *addr,
long *port)
{
unsigned short us_port;
struct sockaddr_in* si = NULL;
@ -843,7 +843,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
if(result) {
/* no more addresses to try */
const char* hostname;
const char *hostname;
/* if the first address family runs out of addresses to try before
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
* 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 uri_path_len;
char* uri_path = NULL;
char* pos;
char *uri_path = NULL;
char *pos;
bool ret = FALSE;
/* 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
* 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
int err;
char* dot;
char *dot;
#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
* you should have received as part of this distribution. The terms
@ -24,11 +24,11 @@
#ifndef CURL_DISABLE_CRYPTO_AUTH
typedef void (* HMAC_hinit_func)(void * context);
typedef void (* HMAC_hupdate_func)(void * context,
const unsigned char * data,
typedef void (* HMAC_hinit_func)(void *context);
typedef void (* HMAC_hupdate_func)(void *context,
const unsigned char *data,
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. */
@ -46,21 +46,21 @@ typedef struct {
/* HMAC computation context. */
typedef struct {
const HMAC_params * hmac_hash; /* Hash function definition. */
void * hmac_hashctxt1; /* Hash function context 1. */
void * hmac_hashctxt2; /* Hash function context 2. */
const HMAC_params *hmac_hash; /* Hash function definition. */
void *hmac_hashctxt1; /* Hash function context 1. */
void *hmac_hashctxt2; /* Hash function context 2. */
} HMAC_context;
/* Prototypes. */
HMAC_context * Curl_HMAC_init(const HMAC_params * hashparams,
const unsigned char * key,
HMAC_context * Curl_HMAC_init(const HMAC_params *hashparams,
const unsigned char *key,
unsigned int keylen);
int Curl_HMAC_update(HMAC_context * context,
const unsigned char * data,
int Curl_HMAC_update(HMAC_context *context,
const unsigned char *data,
unsigned int len);
int Curl_HMAC_final(HMAC_context * context, unsigned char * result);
int Curl_HMAC_final(HMAC_context *context, unsigned char *result);
#endif

View File

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

View File

@ -467,8 +467,8 @@
# ifdef __minix
/* 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 struct tm * gmtime_r(const time_t * const timep, struct tm *tmp);
extern char *strtok_r(char *s, const char *delim, char **last);
extern struct tm *gmtime_r(const time_t * const timep, struct tm *tmp);
# endif
# define DIR_CHAR "/"

View File

@ -313,7 +313,7 @@ static CURLcode file_upload(struct connectdata *conn)
curl_off_t bytecount = 0;
struct timeval now = Curl_tvnow();
struct_stat file_stat;
const char* buf2;
const char *buf2;
/*
* 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 *contenttype,
long flags,
struct curl_slist* contentHeader,
struct curl_slist *contentHeader,
char *showfilename, char *userp,
struct curl_httppost *parent_post,
struct curl_httppost **httppost,
@ -548,9 +548,9 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
{
/* this "cast increases required alignment of target type" but
we consider it OK anyway */
struct curl_slist* list = array_state?
(struct curl_slist*)(void*)array_value:
va_arg(params, struct curl_slist*);
struct curl_slist *list = array_state?
(struct curl_slist *)(void *)array_value:
va_arg(params, struct curl_slist *);
if(current_form->contentheader)
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.
*
*/
curl_off_t VmsRealFileSize(const char * name,
const struct_stat * stat_buf)
curl_off_t VmsRealFileSize(const char *name,
const struct_stat *stat_buf)
{
char buffer[8192];
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.
*
*/
static curl_off_t VmsSpecialSize(const char * name,
const struct_stat * stat_buf)
static curl_off_t VmsSpecialSize(const char *name,
const struct_stat *stat_buf)
{
switch(stat_buf->st_fab_rfm) {
case FAB$C_VAR:
@ -1167,7 +1167,7 @@ CURLcode Curl_getformdata(struct Curl_easy *data,
curl_off_t size = 0; /* support potentially ENORMOUS formposts */
char *boundary;
char *fileboundary = NULL;
struct curl_slist* curList;
struct curl_slist *curList;
*finalform = NULL; /* default form is empty */

View File

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

View File

@ -143,7 +143,7 @@ struct ftp_conn {
ftpstate state_saved; /* transfer type saved to be reloaded after
data connection is established */
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
LIST parsing was done and wc_statemach set
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;
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
* you should have received as part of this distribution. The terms
@ -29,16 +29,16 @@
#include "llist.h"
/* Hash function prototype */
typedef size_t (*hash_function) (void* key,
typedef size_t (*hash_function) (void *key,
size_t key_length,
size_t slots_num);
/*
Comparator function prototype. Compares two keys.
*/
typedef size_t (*comp_function) (void* key1,
typedef size_t (*comp_function) (void *key1,
size_t key1_len,
void*key2,
void *key2,
size_t key2_len);
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);
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 (*cb)(void *user, void *ptr));
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_with_criterium(struct curl_hash *h, void *user,
int (*comp)(void *, void *));
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_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 key2_len);
void Curl_hash_start_iterate(struct curl_hash *hash,
struct curl_hash_iterator *iter);
struct curl_hash_element *

View File

@ -49,12 +49,12 @@ static const unsigned char hmac_opad = 0x5C;
HMAC_context *
Curl_HMAC_init(const HMAC_params * hashparams,
const unsigned char * key,
const unsigned char *key,
unsigned int keylen)
{
size_t i;
HMAC_context * ctxt;
unsigned char * hkey;
HMAC_context *ctxt;
unsigned char *hkey;
unsigned char b;
/* Create HMAC context. */
@ -101,7 +101,7 @@ Curl_HMAC_init(const HMAC_params * hashparams,
}
int Curl_HMAC_update(HMAC_context * ctxt,
const unsigned char * data,
const unsigned char *data,
unsigned int len)
{
/* 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;

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
* 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
/* 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,
bool *protocol_connect);

View File

@ -68,7 +68,7 @@ unsigned int Curl_ipv6_scope(const struct sockaddr *sa)
#else
if(sa->sa_family == AF_INET6) {
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]);
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)
{
size_t len = 0;
char* message = NULL;
char *message = NULL;
/* Find the start of the 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);
#else
int ldap_option;
char* ldap_ca = conn->ssl_config.CAfile;
char *ldap_ca = conn->ssl_config.CAfile;
#if defined(CURL_HAS_NOVELL_LDAPSDK)
rc = ldapssl_client_init(NULL, NULL);
if(rc != LDAP_SUCCESS) {

View File

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

View File

@ -90,7 +90,7 @@ struct memdebug {
union {
curl_off_t o;
double d;
void * p;
void *p;
} mem[1];
/* I'm hoping this is the thing with the strictest alignment
* 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.
*/
static void pop3_get_message(char *buffer, char** outptr)
static void pop3_get_message(char *buffer, char **outptr)
{
size_t len = 0;
char* message = NULL;
char *message = NULL;
/* Find the start of the 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)
{
int code;
char* pbsz;
char *pbsz;
static unsigned int buffer_size = 1 << 20; /* 1048576 */
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,
int type,
char * ptr,
char *ptr,
size_t len)
{
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
* 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 <gssapi.h>
extern int Curl_getaddrinfo_a(const char * nodename,
const char * servname,
const struct addrinfo * hints,
struct addrinfo * * res);
extern int Curl_getaddrinfo_a(const char *nodename,
const char *servname,
const struct addrinfo *hints,
struct addrinfo **res);
#define getaddrinfo Curl_getaddrinfo_a
extern int Curl_getnameinfo_a(const struct sockaddr * sa,
curl_socklen_t salen,
char * nodename, curl_socklen_t nodenamelen,
char * servname, curl_socklen_t servnamelen,
int flags);
extern int Curl_getnameinfo_a(const struct sockaddr *sa,
curl_socklen_t salen,
char *nodename, curl_socklen_t nodenamelen,
char *servname, curl_socklen_t servnamelen,
int flags);
#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,
GSK_BUF_ID bufID,
const char * buffer,
const char *buffer,
int bufSize);
#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,
GSK_CALLBACK_ID callBackID,
void * callBackAreaPtr);
void *callBackAreaPtr);
#define gsk_attribute_set_callback Curl_gsk_attribute_set_callback
extern int Curl_gsk_attribute_get_buffer_a(gsk_handle my_gsk_handle,
GSK_BUF_ID bufID,
const char * * buffer,
int * bufSize);
const char **buffer,
int *bufSize);
#define gsk_attribute_get_buffer Curl_gsk_attribute_get_buffer_a
extern int Curl_gsk_attribute_get_enum(gsk_handle my_gsk_handle,
GSK_ENUM_ID enumID,
GSK_ENUM_VALUE * enumValue);
GSK_ENUM_VALUE *enumValue);
#define gsk_attribute_get_enum Curl_gsk_attribute_get_enum
extern int Curl_gsk_attribute_get_numeric_value(gsk_handle my_gsk_handle,
GSK_NUM_ID numID,
int * numValue);
int *numValue);
#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,
GSK_CERT_ID certID,
const gsk_cert_data_elem * * certDataElem,
int * certDataElementCount);
const gsk_cert_data_elem **certDataElem,
int *certDataElementCount);
#define gsk_attribute_get_cert_info Curl_gsk_attribute_get_cert_info
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
extern int Curl_gsk_secure_soc_read(gsk_handle my_session_handle,
char * readBuffer,
int readBufSize, int * amtRead);
char *readBuffer,
int readBufSize, int *amtRead);
#define gsk_secure_soc_read Curl_gsk_secure_soc_read
extern int Curl_gsk_secure_soc_write(gsk_handle my_session_handle,
char * writeBuffer,
int writeBufSize, int * amtWritten);
char *writeBuffer,
int writeBufSize, int *amtWritten);
#define gsk_secure_soc_write Curl_gsk_secure_soc_write
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_bind(int sd, struct sockaddr * localaddr, int addrlen);
extern int Curl_os400_sendto(int sd, char * buffer, int buflen, int flags,
struct sockaddr * dstaddr, int addrlen);
extern int Curl_os400_recvfrom(int sd, char * buffer, int buflen, int flags,
struct sockaddr * fromaddr, int * addrlen);
extern int Curl_os400_sendto(int sd, char *buffer, int buflen, int flags,
struct sockaddr * dstaddr, int addrlen);
extern int Curl_os400_recvfrom(int sd, char *buffer, int buflen, int flags,
struct sockaddr *fromaddr, int *addrlen);
#define connect Curl_os400_connect
#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
* you should have received as part of this distribution. The terms
@ -41,7 +41,7 @@
# endif
#endif
#include <stdlib.h>
char * decc$getenv(const char * __name);
char *decc$getenv(const char *__name);
#include <pwd.h>
#include <string.h>
@ -79,23 +79,24 @@
# if __INITIAL_POINTER_SIZE == 32
/* Translate the path, but only if the path is a VMS file specification */
/* The translation is usually only needed for older versions of VMS */
static char * vms_translate_path(const char * path) {
char * unix_path;
char * test_str;
static char *vms_translate_path(const char *path)
{
char *unix_path;
char *test_str;
/* See if the result is in VMS format, if not, we are done */
/* Assume that this is a PATH, not just some data */
test_str = strpbrk(path, ":[<^");
if(test_str == NULL) {
return (char *)path;
}
/* See if the result is in VMS format, if not, we are done */
/* Assume that this is a PATH, not just some data */
test_str = strpbrk(path, ":[<^");
if(test_str == NULL) {
return (char *)path;
}
unix_path = decc$translate_vms(path);
unix_path = decc$translate_vms(path);
if((int)unix_path <= 0) {
/* We can not translate it, so return the original string */
return (char *)path;
}
if((int)unix_path <= 0) {
/* We can not translate it, so return the original string */
return (char *)path;
}
}
# else
/* VMS translate path is actually not needed on the current 64 bit */
@ -111,27 +112,27 @@ char * test_str;
# endif
#endif
static char * vms_getenv(const char * envvar) {
char * result;
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 */
static char *vms_getenv(const char *envvar)
{
char *result;
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 */
return result;
}
@ -146,10 +147,10 @@ struct passwd * my_passwd;
# if __INITIAL_POINTER_SIZE
__char_ptr32 unix_path;
# else
char * unix_path;
char *unix_path;
# endif
#else
char * unix_path;
char *unix_path;
#endif
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.
*/
static void smtp_get_message(char *buffer, char** outptr)
static void smtp_get_message(char *buffer, char **outptr)
{
size_t len = 0;
char* message = NULL;
char *message = NULL;
/* Find the start of the 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,
OM_uint32 major_status,
OM_uint32 minor_status,
const char* function)
const char *function)
{
if(GSS_ERROR(major_status)) {
OM_uint32 maj_stat, min_stat;

View File

@ -45,7 +45,7 @@
*/
static int check_sspi_err(struct connectdata *conn,
SECURITY_STATUS status,
const char* function)
const char *function)
{
if(status != SEC_E_OK &&
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
* 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;
}
#else
const char * cp;
const char *cp;
int value;
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)
{
struct Curl_easy *data = conn->data;
char * type;
char *type;
char command;
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))))
result = CURLE_OUT_OF_MEMORY;
else {
char * p;
char *p;
(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
* 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
* (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_end;
const char* separator = ", ";
const char *separator = ", ";
size_t no_proxy_len;
size_t namelen;
char *endptr;

View File

@ -468,7 +468,7 @@ struct ntlmdata {
#else
unsigned int flags;
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;
#endif
};
@ -754,7 +754,7 @@ struct SingleRequest {
*/
struct Curl_handler {
const char * scheme; /* URL scheme name. */
const char *scheme; /* URL scheme name. */
/* Complement to setup_connection_internals(). */
CURLcode (*setup_connection)(struct connectdata *);
@ -1054,7 +1054,7 @@ struct connectdata {
send on this pipeline */
struct curl_llist *recv_pipe; /* List of handles waiting to read
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. */
size_t read_pos; /* Current read position in the master 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 */
curl_socket_t ntlm_auth_hlpr_socket;
pid_t ntlm_auth_hlpr_pid;
char* challenge_header;
char* response_header;
char *challenge_header;
char *response_header;
#endif
#endif
@ -1572,10 +1572,10 @@ struct UserDefined {
curl_opensocket_callback fopensocket; /* function for checking/translating
the address and opening the
socket */
void* opensocket_client;
void *opensocket_client;
curl_closesocket_callback fclosesocket; /* function for closing the
socket */
void* closesocket_client;
void *closesocket_client;
void *seek_client; /* pointer to pass to the seek callback */
/* 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
*/
#define GNUTLS_SRP "+SRP"
const char* prioritylist;
const char *prioritylist;
const char *err = NULL;
#endif

View File

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

View File

@ -200,14 +200,14 @@ static const cipher_s cipherlist[] = {
#endif
};
static const char* pem_library = "libnsspem.so";
static SECMODModule* mod = NULL;
static const char *pem_library = "libnsspem.so";
static SECMODModule *mod = NULL;
/* NSPR I/O layer we use to detect blocking direction during SSL handshake */
static PRDescIdentity nspr_io_identity = PR_INVALID_IO_LAYER;
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);
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
* 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;
@ -513,7 +513,7 @@ static CURLcode nss_cache_crl(SECItem *crl_der)
return CURLE_OK;
}
static CURLcode nss_load_crl(const char* crlfilename)
static CURLcode nss_load_crl(const char *crlfilename)
{
PRFileDesc *infile;
PRFileInfo info;
@ -663,7 +663,7 @@ static CURLcode cert_stuff(struct connectdata *conn, int sockindex,
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 */

View File

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

View File

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

View File

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

View File

@ -81,13 +81,14 @@
(data->share->specifier & \
(1<<CURL_LOCK_DATA_SSL_SESSION)))
#define CLONE_STRING(var) if(source->var) { \
dest->var = strdup(source->var); \
if(!dest->var) \
return FALSE; \
} \
else \
dest->var = NULL;
#define CLONE_STRING(var) \
if(source->var) { \
dest->var = strdup(source->var); \
if(!dest->var) \
return FALSE; \
} \
else \
dest->var = NULL;
bool
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,
size_t valuelen)
{
struct curl_certinfo * ci = &data->info.certs;
char * output;
struct curl_slist * nl;
struct curl_certinfo *ci = &data->info.certs;
char *output;
struct curl_slist *nl;
CURLcode result = CURLE_OK;
size_t labellen = strlen(label);
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. */
void Curl_ssl_free_certinfo(struct Curl_easy *data);
CURLcode Curl_ssl_init_certinfo(struct Curl_easy * data, int num);
CURLcode Curl_ssl_push_certinfo_len(struct Curl_easy * data, int certnum,
const char * label, const char * value,
CURLcode Curl_ssl_init_certinfo(struct Curl_easy *data, int num);
CURLcode Curl_ssl_push_certinfo_len(struct Curl_easy *data, int certnum,
const char *label, const char *value,
size_t valuelen);
CURLcode Curl_ssl_push_certinfo(struct Curl_easy * data, int certnum,
const char * label, const char * value);
CURLcode Curl_ssl_push_certinfo(struct Curl_easy *data, int certnum,
const char *label, const char *value);
/* 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 * beg, const char * end)
const char *Curl_getASN1Element(curl_asn1Element *elem,
const char *beg, const char *end)
{
unsigned char b;
unsigned long len;
@ -173,9 +173,9 @@ const char * Curl_getASN1Element(curl_asn1Element * elem,
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.
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;
}
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.
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");
}
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;
char * buf = NULL;
char *buf = NULL;
/* Convert an ASN.1 octet string to a printable string.
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;
}
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.
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);
}
static const char * int2str(const char * beg, const char * end)
static const char *int2str(const char *beg, const char *end)
{
long val = 0;
size_t n = end - beg;
@ -251,14 +251,14 @@ static const char * int2str(const char * beg, const char * end)
}
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;
int size = 1;
size_t outlength;
int charsize;
unsigned int wc;
char * buf;
char *buf;
/* Perform a lazy conversion from an ASN.1 typed string to UTF8. Allocate the
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;
}
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.
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;
}
static int encodeUint(char * buf, int n, unsigned int x)
static int encodeUint(char *buf, int n, unsigned int x)
{
int i = 0;
unsigned int y = x / 10;
@ -374,7 +374,7 @@ static int encodeUint(char * buf, int n, unsigned int x)
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;
unsigned int x;
@ -413,9 +413,9 @@ static int encodeOID(char * buf, int n, const char * beg, const char * end)
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;
int n;
@ -443,14 +443,14 @@ static const char * OID2str(const char * beg, const char * end, bool symbolic)
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 * fracp;
const char *tzp;
const char *fracp;
char sec1, sec2;
size_t fracl;
size_t tzl;
const char * sep = "";
const char *sep = "";
/* Convert an ASN.1 Generalized time to a printable string.
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);
}
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;
const char * sec;
const char *sec;
/* Convert an ASN.1 UTC time to a printable string.
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);
}
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.
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. */
}
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 atv;
curl_asn1Element oid;
curl_asn1Element value;
size_t l = 0;
const char * p1;
const char * p2;
const char * p3;
const char * str;
const char *p1;
const char *p2;
const char *p3;
const char *str;
/* ASCII encode distinguished name at `dn' into the `n'-byte buffer at `buf'.
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;
}
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);
/* Convert an ASN.1 distinguished name into a printable string.
@ -676,12 +676,12 @@ const char * Curl_DNtostr(curl_asn1Element * dn)
* X509 parser.
*/
int Curl_parseX509(curl_X509certificate * cert,
const char * beg, const char * end)
int Curl_parseX509(curl_X509certificate *cert,
const char *beg, const char *end)
{
curl_asn1Element elem;
curl_asn1Element tbsCertificate;
const char * ccp;
const char *ccp;
static const char defaultVersion = 0; /* v1. */
/* ASN.1 parse an X509 certificate into structure subfields.
@ -760,7 +760,7 @@ int Curl_parseX509(curl_X509certificate * cert,
return 0;
}
static size_t copySubstring(char * to, const char * from)
static size_t copySubstring(char *to, const char *from)
{
size_t i;
@ -777,8 +777,8 @@ static size_t copySubstring(char * to, const char * from)
return i;
}
static const char * dumpAlgo(curl_asn1Element * param,
const char * beg, const char * end)
static const char *dumpAlgo(curl_asn1Element *param,
const char *beg, const char *end)
{
curl_asn1Element oid;
@ -793,10 +793,10 @@ static const char * dumpAlgo(curl_asn1Element * param,
return OID2str(oid.beg, oid.end, TRUE);
}
static void do_pubkey_field(struct Curl_easy * data, int certnum,
const char * label, curl_asn1Element * elem)
static void do_pubkey_field(struct Curl_easy *data, int certnum,
const char *label, curl_asn1Element *elem)
{
const char * output;
const char *output;
/* 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,
const char * algo, curl_asn1Element * param,
curl_asn1Element * pubkey)
static void do_pubkey(struct Curl_easy *data, int certnum,
const char *algo, curl_asn1Element *param,
curl_asn1Element *pubkey)
{
curl_asn1Element elem;
curl_asn1Element pk;
const char * p;
const char * q;
const char *p;
const char *q;
unsigned long len;
unsigned int i;
@ -874,18 +874,18 @@ static void do_pubkey(struct Curl_easy * data, int certnum,
#endif
}
CURLcode Curl_extract_certinfo(struct connectdata * conn,
CURLcode Curl_extract_certinfo(struct connectdata *conn,
int certnum,
const char * beg,
const char * end)
const char *beg,
const char *end)
{
curl_X509certificate cert;
struct Curl_easy * data = conn->data;
struct Curl_easy *data = conn->data;
curl_asn1Element param;
const char * ccp;
char * cp1;
const char *ccp;
char *cp1;
size_t cl1;
char * cp2;
char *cp2;
CURLcode result;
unsigned long version;
size_t i;
@ -1039,12 +1039,12 @@ CURLcode Curl_extract_certinfo(struct connectdata * conn,
#if defined(USE_GSKIT)
static const char * checkOID(const char * beg, const char * end,
const char * oid)
static const char *checkOID(const char *beg, const char *end,
const char *oid)
{
curl_asn1Element e;
const char * ccp;
const char * p;
const char *ccp;
const char *p;
bool matched;
/* 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;
}
CURLcode Curl_verifyhost(struct connectdata * conn,
const char * beg, const char * end)
CURLcode Curl_verifyhost(struct connectdata *conn,
const char *beg, const char *end)
{
struct Curl_easy * data = conn->data;
struct Curl_easy *data = conn->data;
curl_X509certificate cert;
curl_asn1Element dn;
curl_asn1Element elem;
curl_asn1Element ext;
curl_asn1Element name;
const char * p;
const char * q;
char * dnsname;
const char *p;
const char *q;
char *dnsname;
int matched = -1;
size_t addrlen = (size_t) -1;
ssize_t len;

View File

@ -120,16 +120,15 @@ typedef struct {
* Prototypes.
*/
const char * Curl_getASN1Element(curl_asn1Element * elem,
const char * beg, const char * end);
const char * Curl_ASN1tostr(curl_asn1Element * elem, int type);
const char * Curl_DNtostr(curl_asn1Element * dn);
int Curl_parseX509(curl_X509certificate * cert,
const char * beg, const char * end);
CURLcode Curl_extract_certinfo(struct connectdata * conn, int certnum,
const char * beg, const char * end);
CURLcode Curl_verifyhost(struct connectdata * conn,
const char * beg, const char * end);
const char *Curl_getASN1Element(curl_asn1Element *elem,
const char *beg, const char *end);
const char *Curl_ASN1tostr(curl_asn1Element *elem, int type);
const char *Curl_DNtostr(curl_asn1Element *dn);
int Curl_parseX509(curl_X509certificate *cert,
const char *beg, const char *end);
CURLcode Curl_extract_certinfo(struct connectdata *conn, int certnum,
const char *beg, const char *end);
CURLcode Curl_verifyhost(struct connectdata *conn,
const char *beg, const char *end);
#endif /* USE_GSKIT or USE_NSS or USE_GNUTLS or USE_CYASSL or USE_SCHANNEL */
#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
* you should have received as part of this distribution. The terms
@ -30,7 +30,7 @@
/*
* 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 /* 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.
*
*/
static curl_off_t vms_realfilesize(const char * name,
const struct_stat * stat_buf)
static curl_off_t vms_realfilesize(const char *name,
const struct_stat *stat_buf)
{
char buffer[8192];
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.
*
*/
static curl_off_t VmsSpecialSize(const char * name,
const struct_stat * stat_buf)
static curl_off_t VmsSpecialSize(const char *name,
const struct_stat *stat_buf)
{
switch(stat_buf->st_fab_rfm) {
case FAB$C_VAR:

View File

@ -421,7 +421,7 @@ static CURLcode glob_parse(URLGlob *glob, char *pattern,
return res;
}
CURLcode glob_url(URLGlob** glob, char* url, unsigned long *urlnum,
CURLcode glob_url(URLGlob **glob, char *url, unsigned long *urlnum,
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
* you should have received as part of this distribution. The terms
@ -33,7 +33,7 @@
static const struct
{
const char * name;
const char *name;
CURLINFO id;
enum {
writeenv_NONE,
@ -59,7 +59,7 @@ static const struct
{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. */
#ifdef __riscos__

View File

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

View File

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

View File

@ -68,7 +68,7 @@ int test(char *URL)
CURLM *mcurl = NULL;
int still_running = 1;
struct timeval mp_start;
struct curl_slist* rcpt_list = NULL;
struct curl_slist *rcpt_list = NULL;
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
* you should have received as part of this distribution. The terms
@ -26,7 +26,7 @@
int test(char *URL)
{
long unmet;
CURL* curl = NULL;
CURL *curl = NULL;
int res = 0;
global_init(CURL_GLOBAL_ALL);

View File

@ -113,7 +113,7 @@ test_cleanup:
int test(char *URL)
{
CURLM* multi = NULL;
CURLM *multi = NULL;
int res = 0;
char *address = libtest_arg2;
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
* you should have received as part of this distribution. The terms
@ -29,8 +29,8 @@
int test(char *URL)
{
CURL* curls = NULL;
CURLM* multi = NULL;
CURL *curls = NULL;
CURLM *multi = NULL;
int still_running;
int i = -1;
int res = 0;

View File

@ -48,7 +48,7 @@
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)
{
int res = 0;
@ -99,7 +99,7 @@ init_failed:
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)
{
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;
if(cmd == CURLIOCMD_RESTARTREAD) {

View File

@ -145,10 +145,10 @@ static int curlTimerCallback(CURLM *multi, long timeout_ms, void *userp)
/**
* Check for curl completion.
*/
static int checkForCompletion(CURLM* curl, int* success)
static int checkForCompletion(CURLM *curl, int *success)
{
int numMessages;
CURLMsg* message;
CURLMsg *message;
int result = 0;
*success = 0;
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
* you should have received as part of this distribution. The terms
@ -33,8 +33,8 @@
int test(char *URL)
{
int stillRunning;
CURLM* multiHandle = NULL;
CURL* curl = NULL;
CURLM *multiHandle = NULL;
CURL *curl = NULL;
int res = 0;
global_init(CURL_GLOBAL_ALL);

View File

@ -32,7 +32,7 @@ static CURLcode send_request(CURL *curl, const char *url, int seq,
{
CURLcode res;
size_t len = strlen(url) + 4 + 1;
char* full_url = malloc(len);
char *full_url = malloc(len);
if(!full_url) {
fprintf(stderr, "Not enough memory for full url\n");
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 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;
curl_socket_t sock;
@ -104,7 +104,7 @@ int test(char *url)
int num_handles = 0;
enum HandleState state = ReadyForNewHandle;
size_t urllen = strlen(url) + 4 + 1;
char* full_url = malloc(urllen);
char *full_url = malloc(urllen);
start_test_timing();

View File

@ -2231,9 +2231,9 @@ int main(int argc, char *argv[])
/* Clear out closed sockets */
for(socket_idx = num_sockets - 1; socket_idx >= 1; --socket_idx) {
if(CURL_SOCKET_BAD == all_sockets[socket_idx]) {
char* dst = (char *) (all_sockets + socket_idx);
char* src = (char *) (all_sockets + socket_idx + 1);
char* end = (char *) (all_sockets + num_sockets);
char *dst = (char *) (all_sockets + socket_idx);
char *src = (char *) (all_sockets + socket_idx + 1);
char *end = (char *) (all_sockets + num_sockets);
memmove(dst, src, end - src);
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
* 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
int rc;
struct curl_httppost* post = NULL;
struct curl_httppost* last = NULL;
struct curl_httppost *post = NULL;
struct curl_httppost *last = NULL;
size_t total_size = 0;
char buffer[] = "test buffer";