mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 07:38:49 -05:00
checksrc: white space edits to comply to stricter checksrc
This commit is contained in:
parent
ec0a5c96ac
commit
8657c268e1
@ -86,7 +86,7 @@ static const char *urls[] = {
|
||||
};
|
||||
|
||||
#define MAX 10 /* number of simultaneous transfers */
|
||||
#define CNT sizeof(urls)/sizeof(char*) /* total number of transfers to do */
|
||||
#define CNT sizeof(urls)/sizeof(char *) /* total number of transfers to do */
|
||||
|
||||
static size_t cb(char *d, size_t n, size_t l, void *p)
|
||||
{
|
||||
|
@ -147,13 +147,13 @@ int main(int argc, char **argv)
|
||||
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
||||
|
||||
/* which file to upload */
|
||||
curl_easy_setopt(curl, CURLOPT_READDATA, (void*)&hd);
|
||||
curl_easy_setopt(curl, CURLOPT_READDATA, (void *)&hd);
|
||||
|
||||
/* set the ioctl function */
|
||||
curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, my_ioctl);
|
||||
|
||||
/* pass the file descriptor to the ioctl callback as well */
|
||||
curl_easy_setopt(curl, CURLOPT_IOCTLDATA, (void*)&hd);
|
||||
curl_easy_setopt(curl, CURLOPT_IOCTLDATA, (void *)&hd);
|
||||
|
||||
/* enable "uploading" (which means PUT when doing HTTP) */
|
||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
|
||||
|
@ -86,7 +86,7 @@ typedef struct _GlobalInfo
|
||||
struct ev_timer timer_event;
|
||||
CURLM *multi;
|
||||
int still_running;
|
||||
FILE* input;
|
||||
FILE *input;
|
||||
} GlobalInfo;
|
||||
|
||||
|
||||
@ -243,7 +243,8 @@ static void remsock(SockInfo *f, GlobalInfo *g)
|
||||
|
||||
|
||||
/* Assign information to a SockInfo structure */
|
||||
static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g)
|
||||
static void setsock(SockInfo *f, curl_socket_t s, CURL *e, int act,
|
||||
GlobalInfo *g)
|
||||
{
|
||||
printf("%s \n", __PRETTY_FUNCTION__);
|
||||
|
||||
|
@ -206,7 +206,8 @@ static void remsock(SockInfo *f)
|
||||
}
|
||||
|
||||
/* Assign information to a SockInfo structure */
|
||||
static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g)
|
||||
static void setsock(SockInfo *f, curl_socket_t s, CURL *e, int act,
|
||||
GlobalInfo *g)
|
||||
{
|
||||
GIOCondition kind =
|
||||
(act&CURL_POLL_IN?G_IO_IN:0)|(act&CURL_POLL_OUT?G_IO_OUT:0);
|
||||
|
@ -82,7 +82,7 @@ typedef struct _GlobalInfo
|
||||
struct event *timer_event;
|
||||
CURLM *multi;
|
||||
int still_running;
|
||||
FILE* input;
|
||||
FILE *input;
|
||||
} GlobalInfo;
|
||||
|
||||
|
||||
@ -230,7 +230,8 @@ static void remsock(SockInfo *f)
|
||||
|
||||
|
||||
/* Assign information to a SockInfo structure */
|
||||
static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g)
|
||||
static void setsock(SockInfo *f, curl_socket_t s, CURL *e, int act,
|
||||
GlobalInfo *g)
|
||||
{
|
||||
int kind =
|
||||
(act&CURL_POLL_IN?EV_READ:0)|(act&CURL_POLL_OUT?EV_WRITE:0)|EV_PERSIST;
|
||||
|
@ -182,7 +182,7 @@ _CURL_WARNING(_curl_easy_setopt_err_error_buffer,
|
||||
"curl_easy_setopt expects a "
|
||||
"char buffer of CURL_ERROR_SIZE as argument for this option")
|
||||
_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_easy_setopt expects a 'void *' or 'char *' argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_httpost,
|
||||
@ -364,7 +364,7 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
|
||||
/* XXX: should evaluate to true iff expr is a pointer */
|
||||
#define _curl_is_any_ptr(expr) \
|
||||
(sizeof(expr) == sizeof(void*))
|
||||
(sizeof(expr) == sizeof(void *))
|
||||
|
||||
/* evaluates to true if expr is NULL */
|
||||
/* XXX: must not evaluate expr, so this check is not accurate */
|
||||
@ -456,12 +456,12 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
_curl_callback_compatible((expr), _curl_read_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback6))
|
||||
typedef size_t (_curl_read_callback1)(char *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void*);
|
||||
typedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE*);
|
||||
typedef size_t (_curl_read_callback4)(void *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void*);
|
||||
typedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE*);
|
||||
typedef size_t (_curl_read_callback1)(char *, size_t, size_t, void *);
|
||||
typedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void *);
|
||||
typedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE *);
|
||||
typedef size_t (_curl_read_callback4)(void *, size_t, size_t, void *);
|
||||
typedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void *);
|
||||
typedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_write_callback or "similar" */
|
||||
#define _curl_is_write_cb(expr) \
|
||||
@ -474,14 +474,14 @@ typedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE*);
|
||||
_curl_callback_compatible((expr), _curl_write_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback6))
|
||||
typedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void *);
|
||||
typedef size_t (_curl_write_callback2)(const char *, size_t, size_t,
|
||||
const void*);
|
||||
typedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE*);
|
||||
typedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void*);
|
||||
const void *);
|
||||
typedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE *);
|
||||
typedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void *);
|
||||
typedef size_t (_curl_write_callback5)(const void *, size_t, size_t,
|
||||
const void*);
|
||||
typedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE*);
|
||||
const void *);
|
||||
typedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */
|
||||
#define _curl_is_ioctl_cb(expr) \
|
||||
@ -491,10 +491,10 @@ typedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE*);
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback4))
|
||||
typedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void*);
|
||||
typedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void*);
|
||||
typedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void*);
|
||||
typedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void*);
|
||||
typedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void *);
|
||||
typedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void *);
|
||||
typedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void *);
|
||||
typedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_sockopt_callback or "similar" */
|
||||
#define _curl_is_sockopt_cb(expr) \
|
||||
|
@ -382,7 +382,7 @@ static bool init_resolve_thread (struct connectdata *conn,
|
||||
struct thread_data *td = calloc(1, sizeof(struct thread_data));
|
||||
int err = RESOLVER_ENOMEM;
|
||||
|
||||
conn->async.os_specific = (void*) td;
|
||||
conn->async.os_specific = (void *)td;
|
||||
if(!td)
|
||||
goto err_exit;
|
||||
|
||||
|
@ -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
|
||||
@ -676,7 +676,7 @@
|
||||
/*#define RANDOM_FILE "/dev/urandom"*/
|
||||
|
||||
#define RECV_TYPE_ARG1 int
|
||||
#define RECV_TYPE_ARG2 void*
|
||||
#define RECV_TYPE_ARG2 void *
|
||||
#define RECV_TYPE_ARG3 size_t
|
||||
#define RECV_TYPE_ARG4 int
|
||||
#define RECV_TYPE_RETV ssize_t
|
||||
@ -692,7 +692,7 @@
|
||||
|
||||
#define SEND_TYPE_ARG1 int
|
||||
#define SEND_QUAL_ARG2 const
|
||||
#define SEND_TYPE_ARG2 void*
|
||||
#define SEND_TYPE_ARG2 void *
|
||||
#define SEND_TYPE_ARG3 size_t
|
||||
#define SEND_TYPE_ARG4 int
|
||||
#define SEND_TYPE_RETV ssize_t
|
||||
|
@ -610,17 +610,17 @@ static bool getaddressinfo(struct sockaddr *sa, char *addr,
|
||||
long *port)
|
||||
{
|
||||
unsigned short us_port;
|
||||
struct sockaddr_in* si = NULL;
|
||||
struct sockaddr_in *si = NULL;
|
||||
#ifdef ENABLE_IPV6
|
||||
struct sockaddr_in6* si6 = NULL;
|
||||
struct sockaddr_in6 *si6 = NULL;
|
||||
#endif
|
||||
#if defined(HAVE_SYS_UN_H) && defined(AF_UNIX)
|
||||
struct sockaddr_un* su = NULL;
|
||||
struct sockaddr_un *su = NULL;
|
||||
#endif
|
||||
|
||||
switch (sa->sa_family) {
|
||||
case AF_INET:
|
||||
si = (struct sockaddr_in*)(void*) sa;
|
||||
si = (struct sockaddr_in *)(void *) sa;
|
||||
if(Curl_inet_ntop(sa->sa_family, &si->sin_addr,
|
||||
addr, MAX_IPADR_LEN)) {
|
||||
us_port = ntohs(si->sin_port);
|
||||
@ -630,7 +630,7 @@ static bool getaddressinfo(struct sockaddr *sa, char *addr,
|
||||
break;
|
||||
#ifdef ENABLE_IPV6
|
||||
case AF_INET6:
|
||||
si6 = (struct sockaddr_in6*)(void*) sa;
|
||||
si6 = (struct sockaddr_in6 *)(void *) sa;
|
||||
if(Curl_inet_ntop(sa->sa_family, &si6->sin6_addr,
|
||||
addr, MAX_IPADR_LEN)) {
|
||||
us_port = ntohs(si6->sin6_port);
|
||||
|
@ -94,7 +94,7 @@ static size_t display_gss_error(OM_uint32 status, int type,
|
||||
if(GSS_LOG_BUFFER_LEN > len + status_string.length + 3) {
|
||||
len += snprintf(buf + len, GSS_LOG_BUFFER_LEN - len,
|
||||
"%.*s. ", (int)status_string.length,
|
||||
(char*)status_string.value);
|
||||
(char *)status_string.value);
|
||||
}
|
||||
gss_release_buffer(&min_stat, &status_string);
|
||||
} while(!GSS_ERROR(maj_stat) && msg_ctx != 0);
|
||||
|
@ -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
|
||||
@ -30,8 +30,8 @@ struct Curl_sec_client_mech {
|
||||
void (*end)(void *);
|
||||
int (*check_prot)(void *, int);
|
||||
int (*overhead)(void *, int, int);
|
||||
int (*encode)(void *, const void*, int, int, void**);
|
||||
int (*decode)(void *, void*, int, int, struct connectdata *);
|
||||
int (*encode)(void *, const void *, int, int, void **);
|
||||
int (*decode)(void *, void *, int, int, struct connectdata *);
|
||||
};
|
||||
|
||||
#define AUTH_OK 0
|
||||
|
@ -59,7 +59,7 @@ static void *curl_thread_create_thunk(void *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
curl_thread_t Curl_thread_create(unsigned int (*func) (void*), void *arg)
|
||||
curl_thread_t Curl_thread_create(unsigned int (*func) (void *), void *arg)
|
||||
{
|
||||
curl_thread_t t = malloc(sizeof(pthread_t));
|
||||
struct curl_actual_call *ac = malloc(sizeof(struct curl_actual_call));
|
||||
@ -100,7 +100,7 @@ int Curl_thread_join(curl_thread_t *hnd)
|
||||
|
||||
#elif defined(USE_THREADS_WIN32)
|
||||
|
||||
curl_thread_t Curl_thread_create(unsigned int (CURL_STDCALL *func) (void*),
|
||||
curl_thread_t Curl_thread_create(unsigned int (CURL_STDCALL *func) (void *),
|
||||
void *arg)
|
||||
{
|
||||
#ifdef _WIN32_WCE
|
||||
|
@ -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
|
||||
@ -50,7 +50,7 @@
|
||||
|
||||
#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32)
|
||||
|
||||
curl_thread_t Curl_thread_create(unsigned int (CURL_STDCALL *func) (void*),
|
||||
curl_thread_t Curl_thread_create(unsigned int (CURL_STDCALL *func) (void *),
|
||||
void *arg);
|
||||
|
||||
void Curl_thread_destroy(curl_thread_t hnd);
|
||||
|
@ -291,7 +291,7 @@ Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname,
|
||||
* gethostbyname() is the preferred one.
|
||||
*/
|
||||
else {
|
||||
h = gethostbyname((void*)hostname);
|
||||
h = gethostbyname((void *)hostname);
|
||||
#endif /* HAVE_GETADDRINFO_THREADSAFE || HAVE_GETHOSTBYNAME_R */
|
||||
}
|
||||
|
||||
|
@ -1653,7 +1653,7 @@ static ssize_t http2_send(struct connectdata *conn, int sockindex,
|
||||
size_t nheader;
|
||||
size_t i;
|
||||
size_t authority_idx;
|
||||
char *hdbuf = (char*)mem;
|
||||
char *hdbuf = (char *)mem;
|
||||
char *end, *line_end;
|
||||
nghttp2_data_provider data_prd;
|
||||
int32_t stream_id;
|
||||
|
@ -107,7 +107,7 @@ static CURLcode imap_perform_authenticate(struct connectdata *conn,
|
||||
const char *initresp);
|
||||
static CURLcode imap_continue_authenticate(struct connectdata *conn,
|
||||
const char *resp);
|
||||
static void imap_get_message(char *buffer, char** outptr);
|
||||
static void imap_get_message(char *buffer, char **outptr);
|
||||
|
||||
/*
|
||||
* IMAP protocol handler.
|
||||
@ -390,7 +390,7 @@ static bool imap_endofresp(struct connectdata *conn, char *line, size_t len,
|
||||
*
|
||||
* Gets the authentication message from the response buffer.
|
||||
*/
|
||||
static void imap_get_message(char *buffer, char** outptr)
|
||||
static void imap_get_message(char *buffer, char **outptr)
|
||||
{
|
||||
size_t len = 0;
|
||||
char *message = NULL;
|
||||
|
@ -184,10 +184,10 @@ char *Curl_inet_ntop(int af, const void *src, char *buf, size_t size)
|
||||
{
|
||||
switch (af) {
|
||||
case AF_INET:
|
||||
return inet_ntop4((const unsigned char*)src, buf, size);
|
||||
return inet_ntop4((const unsigned char *)src, buf, size);
|
||||
#ifdef ENABLE_IPV6
|
||||
case AF_INET6:
|
||||
return inet_ntop6((const unsigned char*)src, buf, size);
|
||||
return inet_ntop6((const unsigned char *)src, buf, size);
|
||||
#endif
|
||||
default:
|
||||
SET_ERRNO(EAFNOSUPPORT);
|
||||
|
@ -121,7 +121,7 @@ krb5_encode(void *app_data, const void *from, int length, int level, void **to)
|
||||
/* NOTE that the cast is safe, neither of the krb5, gnu gss and heimdal
|
||||
* libraries modify the input buffer in gss_seal()
|
||||
*/
|
||||
dec.value = (void*)from;
|
||||
dec.value = (void *)from;
|
||||
dec.length = length;
|
||||
maj = gss_seal(&min, *context,
|
||||
level == PROT_PRIVATE,
|
||||
|
@ -5,7 +5,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
|
||||
@ -117,7 +117,7 @@ CURLcode Curl_convert_to_network(struct Curl_easy *data,
|
||||
/* call iconv */
|
||||
input_ptr = output_ptr = buffer;
|
||||
in_bytes = out_bytes = length;
|
||||
rc = iconv(data->outbound_cd, (const char**)&input_ptr, &in_bytes,
|
||||
rc = iconv(data->outbound_cd, (const char **)&input_ptr, &in_bytes,
|
||||
&output_ptr, &out_bytes);
|
||||
if((rc == ICONV_ERROR) || (in_bytes != 0)) {
|
||||
error = ERRNO;
|
||||
|
@ -104,7 +104,7 @@ static CURLcode pop3_parse_custom_request(struct connectdata *conn);
|
||||
static CURLcode pop3_perform_auth(struct connectdata *conn, const char *mech,
|
||||
const char *initresp);
|
||||
static CURLcode pop3_continue_auth(struct connectdata *conn, const char *resp);
|
||||
static void pop3_get_message(char *buffer, char** outptr);
|
||||
static void pop3_get_message(char *buffer, char **outptr);
|
||||
|
||||
/*
|
||||
* POP3 protocol handler.
|
||||
@ -1572,7 +1572,7 @@ CURLcode Curl_pop3_write(struct connectdata *conn, char *str, size_t nread)
|
||||
if(prev) {
|
||||
/* If the partial match was the CRLF and dot then only write the CRLF
|
||||
as the server would have inserted the dot */
|
||||
result = Curl_client_write(conn, CLIENTWRITE_BODY, (char*)POP3_EOB,
|
||||
result = Curl_client_write(conn, CLIENTWRITE_BODY, (char *)POP3_EOB,
|
||||
strip_dot ? prev - 1 : prev);
|
||||
|
||||
if(result)
|
||||
|
@ -222,7 +222,7 @@ buffer_read(struct krb5buffer *buf, void *data, size_t len)
|
||||
{
|
||||
if(buf->size - buf->index < len)
|
||||
len = buf->size - buf->index;
|
||||
memcpy(data, (char*)buf->data + buf->index, len);
|
||||
memcpy(data, (char *)buf->data + buf->index, len);
|
||||
buf->index += len;
|
||||
return len;
|
||||
}
|
||||
@ -291,7 +291,7 @@ static void do_sec_send(struct connectdata *conn, curl_socket_t fd,
|
||||
prot_level = conn->command_prot;
|
||||
}
|
||||
bytes = conn->mech->encode(conn->app_data, from, length, prot_level,
|
||||
(void**)&buffer);
|
||||
(void **)&buffer);
|
||||
if(!buffer || bytes <= 0)
|
||||
return; /* error */
|
||||
|
||||
|
@ -103,7 +103,7 @@ static CURLcode smtp_parse_custom_request(struct connectdata *conn);
|
||||
static CURLcode smtp_perform_auth(struct connectdata *conn, const char *mech,
|
||||
const char *initresp);
|
||||
static CURLcode smtp_continue_auth(struct connectdata *conn, const char *resp);
|
||||
static void smtp_get_message(char *buffer, char** outptr);
|
||||
static void smtp_get_message(char *buffer, char **outptr);
|
||||
|
||||
/*
|
||||
* SMTP protocol handler.
|
||||
|
23
lib/socks.c
23
lib/socks.c
@ -179,11 +179,11 @@ CURLcode Curl_SOCKS4(const char *proxy_name,
|
||||
if(hp->ai_family == AF_INET) {
|
||||
struct sockaddr_in *saddr_in;
|
||||
|
||||
saddr_in = (struct sockaddr_in*)(void*)hp->ai_addr;
|
||||
socksreq[4] = ((unsigned char*)&saddr_in->sin_addr.s_addr)[0];
|
||||
socksreq[5] = ((unsigned char*)&saddr_in->sin_addr.s_addr)[1];
|
||||
socksreq[6] = ((unsigned char*)&saddr_in->sin_addr.s_addr)[2];
|
||||
socksreq[7] = ((unsigned char*)&saddr_in->sin_addr.s_addr)[3];
|
||||
saddr_in = (struct sockaddr_in *)(void *)hp->ai_addr;
|
||||
socksreq[4] = ((unsigned char *)&saddr_in->sin_addr.s_addr)[0];
|
||||
socksreq[5] = ((unsigned char *)&saddr_in->sin_addr.s_addr)[1];
|
||||
socksreq[6] = ((unsigned char *)&saddr_in->sin_addr.s_addr)[2];
|
||||
socksreq[7] = ((unsigned char *)&saddr_in->sin_addr.s_addr)[3];
|
||||
|
||||
infof(data, "SOCKS4 connect to IPv4 %s (locally resolved)\n", buf);
|
||||
}
|
||||
@ -224,7 +224,7 @@ CURLcode Curl_SOCKS4(const char *proxy_name,
|
||||
ssize_t written;
|
||||
ssize_t hostnamelen = 0;
|
||||
int packetsize = 9 +
|
||||
(int)strlen((char*)socksreq + 8); /* size including NUL */
|
||||
(int)strlen((char *)socksreq + 8); /* size including NUL */
|
||||
|
||||
/* If SOCKS4a, set special invalid IP address 0.0.0.x */
|
||||
if(protocol4a) {
|
||||
@ -235,7 +235,7 @@ CURLcode Curl_SOCKS4(const char *proxy_name,
|
||||
/* If still enough room in buffer, also append hostname */
|
||||
hostnamelen = (ssize_t)strlen(hostname) + 1; /* length including NUL */
|
||||
if(packetsize + hostnamelen <= SOCKS4REQLEN)
|
||||
strcpy((char*)socksreq + packetsize, hostname);
|
||||
strcpy((char *)socksreq + packetsize, hostname);
|
||||
else
|
||||
hostnamelen = 0; /* Flag: hostname did not fit in buffer */
|
||||
}
|
||||
@ -615,9 +615,9 @@ CURLcode Curl_SOCKS5(const char *proxy_name,
|
||||
struct sockaddr_in *saddr_in;
|
||||
socksreq[len++] = 1; /* ATYP: IPv4 = 1 */
|
||||
|
||||
saddr_in = (struct sockaddr_in*)(void*)hp->ai_addr;
|
||||
saddr_in = (struct sockaddr_in *)(void *)hp->ai_addr;
|
||||
for(i = 0; i < 4; i++) {
|
||||
socksreq[len++] = ((unsigned char*)&saddr_in->sin_addr.s_addr)[i];
|
||||
socksreq[len++] = ((unsigned char *)&saddr_in->sin_addr.s_addr)[i];
|
||||
}
|
||||
|
||||
infof(data, "SOCKS5 connect to IPv4 %s (locally resolved)\n", buf);
|
||||
@ -627,9 +627,10 @@ CURLcode Curl_SOCKS5(const char *proxy_name,
|
||||
struct sockaddr_in6 *saddr_in6;
|
||||
socksreq[len++] = 4; /* ATYP: IPv6 = 4 */
|
||||
|
||||
saddr_in6 = (struct sockaddr_in6*)(void*)hp->ai_addr;
|
||||
saddr_in6 = (struct sockaddr_in6 *)(void *)hp->ai_addr;
|
||||
for(i = 0; i < 16; i++) {
|
||||
socksreq[len++] = ((unsigned char*)&saddr_in6->sin6_addr.s6_addr)[i];
|
||||
socksreq[len++] =
|
||||
((unsigned char *)&saddr_in6->sin6_addr.s6_addr)[i];
|
||||
}
|
||||
|
||||
infof(data, "SOCKS5 connect to IPv6 %s (locally resolved)\n", buf);
|
||||
|
@ -65,7 +65,7 @@ static int check_gss_err(struct Curl_easy *data,
|
||||
&msg_ctx, &status_string);
|
||||
if(maj_stat == GSS_S_COMPLETE) {
|
||||
if(sizeof(buf) > len + status_string.length + 1) {
|
||||
strcpy(buf+len, (char*) status_string.value);
|
||||
strcpy(buf+len, (char *) status_string.value);
|
||||
len += status_string.length;
|
||||
}
|
||||
gss_release_buffer(&min_stat, &status_string);
|
||||
@ -86,7 +86,7 @@ static int check_gss_err(struct Curl_easy *data,
|
||||
&msg_ctx, &status_string);
|
||||
if(maj_stat == GSS_S_COMPLETE) {
|
||||
if(sizeof(buf) > len + status_string.length)
|
||||
strcpy(buf+len, (char*) status_string.value);
|
||||
strcpy(buf+len, (char *) status_string.value);
|
||||
gss_release_buffer(&min_stat, &status_string);
|
||||
break;
|
||||
}
|
||||
|
@ -1004,7 +1004,7 @@ static void sendsuboption(struct connectdata *conn, int option)
|
||||
ssize_t bytes_written;
|
||||
int err;
|
||||
unsigned short x, y;
|
||||
unsigned char*uc1, *uc2;
|
||||
unsigned char *uc1, *uc2;
|
||||
|
||||
struct Curl_easy *data = conn->data;
|
||||
struct TELNET *tn = (struct TELNET *)data->req.protop;
|
||||
@ -1020,8 +1020,8 @@ static void sendsuboption(struct connectdata *conn, int option)
|
||||
/* Window size must be sent according to the 'network order' */
|
||||
x=htons(tn->subopt_wsx);
|
||||
y=htons(tn->subopt_wsy);
|
||||
uc1 = (unsigned char*)&x;
|
||||
uc2 = (unsigned char*)&y;
|
||||
uc1 = (unsigned char *)&x;
|
||||
uc2 = (unsigned char *)&y;
|
||||
CURL_SB_ACCUM(tn, uc1[0]);
|
||||
CURL_SB_ACCUM(tn, uc1[1]);
|
||||
CURL_SB_ACCUM(tn, uc2[0]);
|
||||
|
@ -3964,7 +3964,7 @@ CURLcode Curl_protocol_connect(struct connectdata *conn,
|
||||
*/
|
||||
static bool is_ASCII_name(const char *hostname)
|
||||
{
|
||||
const unsigned char *ch = (const unsigned char*)hostname;
|
||||
const unsigned char *ch = (const unsigned char *)hostname;
|
||||
|
||||
while(*ch) {
|
||||
if(*ch++ & 0x80)
|
||||
|
@ -60,7 +60,7 @@
|
||||
what ultimately goes over the network.
|
||||
*/
|
||||
#define CURL_OUTPUT_DIGEST_CONV(a, b) \
|
||||
result = Curl_convert_to_network(a, (char *)b, strlen((const char*)b)); \
|
||||
result = Curl_convert_to_network(a, (char *)b, strlen((const char *)b)); \
|
||||
if(result) { \
|
||||
free(b); \
|
||||
return result; \
|
||||
|
@ -414,7 +414,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
/* Populate our identity domain */
|
||||
if(Curl_override_sspi_http_realm((const char*) digest->input_token,
|
||||
if(Curl_override_sspi_http_realm((const char *) digest->input_token,
|
||||
&identity))
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
|
@ -264,7 +264,7 @@ CURLcode Curl_auth_create_spnego_message(struct Curl_easy *data,
|
||||
|
||||
/* Base64 encode the already generated response */
|
||||
result = Curl_base64_encode(data,
|
||||
(const char*) nego->output_token,
|
||||
(const char *) nego->output_token,
|
||||
nego->output_token_length,
|
||||
outptr, outlen);
|
||||
|
||||
|
@ -197,7 +197,7 @@ static OSStatus SocketWrite(SSLConnectionRef connection,
|
||||
|
||||
do {
|
||||
length = write(sock,
|
||||
(char*)dataPtr + bytesSent,
|
||||
(char *)dataPtr + bytesSent,
|
||||
dataLen - bytesSent);
|
||||
} while((length > 0) &&
|
||||
( (bytesSent += length) < dataLen) );
|
||||
|
@ -68,7 +68,7 @@
|
||||
#define GNUTLS_POINTER_TO_INT_CAST(p) ((int) (long) (p))
|
||||
#endif
|
||||
#ifndef GNUTLS_INT_TO_POINTER_CAST
|
||||
#define GNUTLS_INT_TO_POINTER_CAST(i) ((void*) (long) (i))
|
||||
#define GNUTLS_INT_TO_POINTER_CAST(i) ((void *) (long) (i))
|
||||
#endif
|
||||
|
||||
/* Enable GnuTLS debugging by defining GTLSDEBUG */
|
||||
|
@ -539,7 +539,7 @@ static CURLcode nss_load_crl(const char *crlfilename)
|
||||
goto fail;
|
||||
|
||||
/* place a trailing zero right after the visible data */
|
||||
body = (char*)filedata.data;
|
||||
body = (char *)filedata.data;
|
||||
body[--filedata.len] = '\0';
|
||||
|
||||
body = strstr(body, "-----BEGIN");
|
||||
|
@ -295,7 +295,7 @@ static int ssl_ui_reader(UI *ui, UI_STRING *uis)
|
||||
switch(UI_get_string_type(uis)) {
|
||||
case UIT_PROMPT:
|
||||
case UIT_VERIFY:
|
||||
password = (const char*)UI_get0_user_data(ui);
|
||||
password = (const char *)UI_get0_user_data(ui);
|
||||
if(password && (UI_get_input_flags(uis) & UI_INPUT_FLAG_DEFAULT_PWD)) {
|
||||
UI_set_result(ui, uis, password);
|
||||
return 1;
|
||||
@ -1567,7 +1567,7 @@ static void ssl_tls_trace(int direction, int ssl_ver, int content_type,
|
||||
else
|
||||
tls_rt_name = "";
|
||||
|
||||
msg_type = *(char*)buf;
|
||||
msg_type = *(char *)buf;
|
||||
msg_name = ssl_msg_type(ssl_ver, msg_type);
|
||||
|
||||
txt_len = snprintf(ssl_buf, sizeof(ssl_buf), "%s (%s), %s, %s (%d):\n",
|
||||
|
@ -278,12 +278,12 @@ schannel_connect_step1(struct connectdata *conn, int sockindex)
|
||||
|
||||
/* The first four bytes will be an unsigned int indicating number
|
||||
of bytes of data in the rest of the the buffer. */
|
||||
extension_len = (unsigned int*)(&alpn_buffer[cur]);
|
||||
extension_len = (unsigned int *)(&alpn_buffer[cur]);
|
||||
cur += sizeof(unsigned int);
|
||||
|
||||
/* The next four bytes are an indicator that this buffer will contain
|
||||
ALPN data, as opposed to NPN, for example. */
|
||||
*(unsigned int*)&alpn_buffer[cur] =
|
||||
*(unsigned int *)&alpn_buffer[cur] =
|
||||
SecApplicationProtocolNegotiationExt_ALPN;
|
||||
cur += sizeof(unsigned int);
|
||||
|
||||
|
@ -47,7 +47,7 @@ size_t tool_header_cb(void *ptr, size_t size, size_t nmemb, void *userdata)
|
||||
struct OutStruct *heads = hdrcbdata->heads;
|
||||
const char *str = ptr;
|
||||
const size_t cb = size * nmemb;
|
||||
const char *end = (char*)ptr + cb;
|
||||
const char *end = (char *)ptr + cb;
|
||||
char *url = NULL;
|
||||
|
||||
/*
|
||||
|
@ -5,7 +5,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
|
||||
@ -615,7 +615,7 @@ SANITIZEcode rename_if_reserved_dos_device_name(char **const sanitized,
|
||||
char **__crt0_glob_function(char *arg)
|
||||
{
|
||||
(void)arg;
|
||||
return (char**)0;
|
||||
return (char **)0;
|
||||
}
|
||||
|
||||
#endif /* MSDOS && (__DJGPP__ || __GO32__) */
|
||||
|
@ -44,7 +44,7 @@ static CURLcode glob_fixed(URLGlob *glob, char *fixed, size_t len)
|
||||
pat->content.Set.ptr_s = 0;
|
||||
pat->globindex = -1;
|
||||
|
||||
pat->content.Set.elements = malloc(sizeof(char*));
|
||||
pat->content.Set.elements = malloc(sizeof(char *));
|
||||
|
||||
if(!pat->content.Set.elements)
|
||||
return GLOBERROR("out of memory", 0, CURLE_OUT_OF_MEMORY);
|
||||
@ -118,14 +118,14 @@ static CURLcode glob_set(URLGlob *glob, char **patternp,
|
||||
*buf = '\0';
|
||||
if(pat->content.Set.elements) {
|
||||
char **new_arr = realloc(pat->content.Set.elements,
|
||||
(pat->content.Set.size + 1) * sizeof(char*));
|
||||
(pat->content.Set.size + 1) * sizeof(char *));
|
||||
if(!new_arr)
|
||||
return GLOBERROR("out of memory", 0, CURLE_OUT_OF_MEMORY);
|
||||
|
||||
pat->content.Set.elements = new_arr;
|
||||
}
|
||||
else
|
||||
pat->content.Set.elements = malloc(sizeof(char*));
|
||||
pat->content.Set.elements = malloc(sizeof(char *));
|
||||
|
||||
if(!pat->content.Set.elements)
|
||||
return GLOBERROR("out of memory", 0, CURLE_OUT_OF_MEMORY);
|
||||
|
@ -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
|
||||
@ -68,9 +68,9 @@ typedef struct {
|
||||
size_t pos; /* column position of error or 0 */
|
||||
} URLGlob;
|
||||
|
||||
CURLcode glob_url(URLGlob**, char*, unsigned long *, FILE *);
|
||||
CURLcode glob_url(URLGlob**, char *, unsigned long *, FILE *);
|
||||
CURLcode glob_next_url(char **, URLGlob *);
|
||||
CURLcode glob_match_url(char **, char*, URLGlob *);
|
||||
CURLcode glob_match_url(char **, char *, URLGlob *);
|
||||
void glob_cleanup(URLGlob* glob);
|
||||
|
||||
#endif /* HEADER_CURL_TOOL_URLGLOB_H */
|
||||
|
@ -43,7 +43,7 @@ int test(char *URL)
|
||||
|
||||
asize = (int)sizeof(a);
|
||||
|
||||
s = curl_easy_escape(easy, (char*)a, asize);
|
||||
s = curl_easy_escape(easy, (char *)a, asize);
|
||||
|
||||
if(s)
|
||||
printf("%s\n", s);
|
||||
|
@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, 2016, 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
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983 Regents of the University of California.
|
||||
* Copyright (c) 1983, 2016 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -1040,10 +1040,10 @@ static int do_tftp(struct testcase *test, struct tftphdr *tp, ssize_t size)
|
||||
#ifdef USE_WINSOCK
|
||||
recvtimeout = sizeof(recvtimeoutbak);
|
||||
getsockopt(peer, SOL_SOCKET, SO_RCVTIMEO,
|
||||
(char*)&recvtimeoutbak, (int*)&recvtimeout);
|
||||
(char *)&recvtimeoutbak, (int *)&recvtimeout);
|
||||
recvtimeout = TIMEOUT*1000;
|
||||
setsockopt(peer, SOL_SOCKET, SO_RCVTIMEO,
|
||||
(const char*)&recvtimeout, sizeof(recvtimeout));
|
||||
(const char *)&recvtimeout, sizeof(recvtimeout));
|
||||
#endif
|
||||
|
||||
if(tp->th_opcode == opcode_WRQ)
|
||||
@ -1054,7 +1054,7 @@ static int do_tftp(struct testcase *test, struct tftphdr *tp, ssize_t size)
|
||||
#ifdef USE_WINSOCK
|
||||
recvtimeout = recvtimeoutbak;
|
||||
setsockopt(peer, SOL_SOCKET, SO_RCVTIMEO,
|
||||
(const char*)&recvtimeout, sizeof(recvtimeout));
|
||||
(const char *)&recvtimeout, sizeof(recvtimeout));
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
@ -48,7 +48,7 @@ static void unit_stop(void)
|
||||
UNITTEST_START
|
||||
int result;
|
||||
|
||||
static const char* const filename1 = "log/netrc1304";
|
||||
static const char * const filename1 = "log/netrc1304";
|
||||
memcpy(filename, filename1, strlen(filename1));
|
||||
|
||||
/*
|
||||
|
@ -32,7 +32,7 @@ static struct curl_hash hash_static;
|
||||
|
||||
static void mydtor(void *p)
|
||||
{
|
||||
int *ptr = (int*)p;
|
||||
int *ptr = (int *)p;
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user