aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-11-23 08:49:04 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-11-24 23:58:22 +0100
commit6832c1d4b2a9eb97a36bb6565c84a8eef451a39c (patch)
treedad19839fa62edb783545b6387ec3fba151dd813 /lib
parent80e7cfeb87c18a7552933ff43a96bd1b709eec22 (diff)
checksrc: move open braces to comply with function declaration style
Diffstat (limited to 'lib')
-rw-r--r--lib/curl_gethostname.c4
-rw-r--r--lib/formdata.c3
-rw-r--r--lib/http2.c6
-rw-r--r--lib/security.c3
-rw-r--r--lib/setup-vms.h66
-rw-r--r--lib/vtls/darwinssl.c9
-rw-r--r--lib/vtls/gtls.c3
-rw-r--r--lib/vtls/nss.c3
-rw-r--r--lib/vtls/vtls.c7
9 files changed, 57 insertions, 47 deletions
diff --git a/lib/curl_gethostname.c b/lib/curl_gethostname.c
index a4fe3c47d..8337c72e8 100644
--- a/lib/curl_gethostname.c
+++ b/lib/curl_gethostname.c
@@ -48,8 +48,8 @@
* For libcurl static library release builds no overriding takes place.
*/
-int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) {
-
+int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen)
+{
#ifndef HAVE_GETHOSTNAME
/* Allow compilation and return failure when unavailable */
diff --git a/lib/formdata.c b/lib/formdata.c
index ed520f5ad..2aef5faf1 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -1427,7 +1427,8 @@ int Curl_FormInit(struct Form *form, struct FormData *formdata)
*
*/
# define fopen_read vmsfopenread
-static FILE * vmsfopenread(const char *file, const char *mode) {
+static FILE * vmsfopenread(const char *file, const char *mode)
+{
struct_stat statbuf;
int result;
diff --git a/lib/http2.c b/lib/http2.c
index de37fd167..2ef173140 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -225,7 +225,8 @@ int Curl_http2_ver(char *p, size_t len)
https://tools.ietf.org/html/rfc7540#page-77
nghttp2_error_code enums are identical.
*/
-const char *Curl_http2_strerror(uint32_t err) {
+const char *Curl_http2_strerror(uint32_t err)
+{
#ifndef NGHTTP2_HAS_HTTP2_STRERROR
const char *str[] = {
"NO_ERROR", /* 0x0 */
@@ -1578,7 +1579,8 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
* Parse the tokens as separated by comma and surrounded by whitespace.
* Returns TRUE if found or FALSE if not.
*/
-static bool contains_trailers(const char *p, size_t len) {
+static bool contains_trailers(const char *p, size_t len)
+{
const char *end = p + len;
for(;;) {
for(; p != end && (*p == ' ' || *p == '\t'); ++p)
diff --git a/lib/security.c b/lib/security.c
index 350cfa745..4a8f44433 100644
--- a/lib/security.c
+++ b/lib/security.c
@@ -88,7 +88,8 @@ name_to_level(const char *name)
/* Convert a protocol |level| to its char representation.
We take an int to catch programming mistakes. */
-static char level_to_char(int level) {
+static char level_to_char(int level)
+{
switch(level) {
case PROT_CLEAR:
return 'C';
diff --git a/lib/setup-vms.h b/lib/setup-vms.h
index ae6c63bf3..6c454aee6 100644
--- a/lib/setup-vms.h
+++ b/lib/setup-vms.h
@@ -138,48 +138,48 @@ static char *vms_getenv(const char *envvar)
static struct passwd vms_passwd_cache;
-static struct passwd * vms_getpwuid(uid_t uid) {
-
-struct passwd * my_passwd;
+static struct passwd * vms_getpwuid(uid_t uid)
+{
+ struct passwd * my_passwd;
/* Hack needed to support 64 bit builds, decc_getpwnam is 32 bit only */
#ifdef __DECC
# if __INITIAL_POINTER_SIZE
-__char_ptr32 unix_path;
+ __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);
- if(my_passwd == NULL) {
- return my_passwd;
- }
-
- unix_path = vms_translate_path(my_passwd->pw_dir);
-
- if((long)unix_path <= 0) {
- /* We can not translate it, so return the original string */
- return my_passwd;
- }
-
- /* If no changes needed just return it */
- if(unix_path == my_passwd->pw_dir) {
- return my_passwd;
- }
-
- /* Need to copy the structure returned */
- /* Since curl is only using pw_dir, no need to fix up *
- /* the pw_shell when running under Bash */
- vms_passwd_cache.pw_name = my_passwd->pw_name;
- vms_passwd_cache.pw_uid = my_passwd->pw_uid;
- vms_passwd_cache.pw_gid = my_passwd->pw_uid;
- vms_passwd_cache.pw_dir = unix_path;
- vms_passwd_cache.pw_shell = my_passwd->pw_shell;
-
- return &vms_passwd_cache;
+ my_passwd = decc_getpwuid(uid);
+ if(my_passwd == NULL) {
+ return my_passwd;
+ }
+
+ unix_path = vms_translate_path(my_passwd->pw_dir);
+
+ if((long)unix_path <= 0) {
+ /* We can not translate it, so return the original string */
+ return my_passwd;
+ }
+
+ /* If no changes needed just return it */
+ if(unix_path == my_passwd->pw_dir) {
+ return my_passwd;
+ }
+
+ /* Need to copy the structure returned */
+ /* Since curl is only using pw_dir, no need to fix up */
+ /* the pw_shell when running under Bash */
+ vms_passwd_cache.pw_name = my_passwd->pw_name;
+ vms_passwd_cache.pw_uid = my_passwd->pw_uid;
+ vms_passwd_cache.pw_gid = my_passwd->pw_uid;
+ vms_passwd_cache.pw_dir = unix_path;
+ vms_passwd_cache.pw_shell = my_passwd->pw_shell;
+
+ return &vms_passwd_cache;
}
#ifdef __DECC
diff --git a/lib/vtls/darwinssl.c b/lib/vtls/darwinssl.c
index 16e104c89..0602cdbda 100644
--- a/lib/vtls/darwinssl.c
+++ b/lib/vtls/darwinssl.c
@@ -219,7 +219,8 @@ static OSStatus SocketWrite(SSLConnectionRef connection,
return ortn;
}
-CF_INLINE const char *SSLCipherNameForNumber(SSLCipherSuite cipher) {
+CF_INLINE const char *SSLCipherNameForNumber(SSLCipherSuite cipher)
+{
switch (cipher) {
/* SSL version 3.0 */
case SSL_RSA_WITH_NULL_MD5:
@@ -364,7 +365,8 @@ CF_INLINE const char *SSLCipherNameForNumber(SSLCipherSuite cipher) {
return "SSL_NULL_WITH_NULL_NULL";
}
-CF_INLINE const char *TLSCipherNameForNumber(SSLCipherSuite cipher) {
+CF_INLINE const char *TLSCipherNameForNumber(SSLCipherSuite cipher)
+{
switch(cipher) {
/* TLS 1.0 with AES (RFC 3268) */
case TLS_RSA_WITH_AES_128_CBC_SHA:
@@ -2449,7 +2451,8 @@ void Curl_darwinssl_md5sum(unsigned char *tmp, /* input */
(void)CC_MD5(tmp, (CC_LONG)tmplen, md5sum);
}
-bool Curl_darwinssl_false_start(void) {
+bool Curl_darwinssl_false_start(void)
+{
#if CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7
if(SSLSetSessionOption != NULL)
return TRUE;
diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c
index c2aca111b..5249dd49d 100644
--- a/lib/vtls/gtls.c
+++ b/lib/vtls/gtls.c
@@ -261,7 +261,8 @@ out:
return loaded_file;
}
-static void unload_file(gnutls_datum_t data) {
+static void unload_file(gnutls_datum_t data)
+{
free(data.data);
}
diff --git a/lib/vtls/nss.c b/lib/vtls/nss.c
index 461694fc5..91b8e05cc 100644
--- a/lib/vtls/nss.c
+++ b/lib/vtls/nss.c
@@ -2181,7 +2181,8 @@ bool Curl_nss_cert_status_request(void)
#endif
}
-bool Curl_nss_false_start(void) {
+bool Curl_nss_false_start(void)
+{
#if NSSVERNUM >= 0x030f04 /* 3.15.4 */
return TRUE;
#else
diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c
index 02418934d..e8fd3cf43 100644
--- a/lib/vtls/vtls.c
+++ b/lib/vtls/vtls.c
@@ -182,12 +182,13 @@ static bool ssl_prefs_check(struct Curl_easy *data)
}
static CURLcode
-ssl_connect_init_proxy(struct connectdata *conn, int sockindex) {
+ssl_connect_init_proxy(struct connectdata *conn, int sockindex)
+{
DEBUGASSERT(conn->bits.proxy_ssl_connected[sockindex]);
if(ssl_connection_complete == conn->ssl[sockindex].state &&
!conn->proxy_ssl[sockindex].use) {
-#if defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_NSS) || \
- defined(USE_GSKIT)
+#if defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_NSS) || \
+ defined(USE_GSKIT)
conn->proxy_ssl[sockindex] = conn->ssl[sockindex];
memset(&conn->ssl[sockindex], 0, sizeof(conn->ssl[sockindex]));
#else