]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
checksrc: move open braces to comply with function declaration style
authorDaniel Stenberg <daniel@haxx.se>
Wed, 23 Nov 2016 07:49:04 +0000 (08:49 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 24 Nov 2016 22:58:22 +0000 (23:58 +0100)
13 files changed:
docs/examples/ghiper.c
lib/curl_gethostname.c
lib/formdata.c
lib/http2.c
lib/security.c
lib/setup-vms.h
lib/vtls/darwinssl.c
lib/vtls/gtls.c
lib/vtls/nss.c
lib/vtls/vtls.c
tests/libtest/lib571.c
tests/unit/unit1303.c
tests/unit/unit1604.c

index ce5b147a9804a13508aa2f48d377717489cdf175..c0fbd8246575cbb01de1bb88ee4ab059336fafc9 100644 (file)
@@ -94,7 +94,8 @@ typedef struct _SockInfo {
 } SockInfo;
 
 /* Die if we get a bad CURLMcode somewhere */
-static void mcode_or_die(const char *where, CURLMcode code) {
+static void mcode_or_die(const char *where, CURLMcode code)
+{
   if(CURLM_OK != code) {
     const char *s;
     switch (code) {
index a4fe3c47d4e5472cf54c4f355f716fbc285cff17..8337c72e81f3cd49a4aec1d447dffc1a564a3ccc 100644 (file)
@@ -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 */
index ed520f5ad1a481b4a8975ac8c5d41245a73b7817..2aef5faf13d6407fb7743621e54d48f723ebe378 100644 (file)
@@ -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;
 
index de37fd1670f91e653b669732d2e98b661a39ab4c..2ef17314024eb6f12ed3675add15cb95ea87b3b5 100644 (file)
@@ -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)
index 350cfa745f15d464f5268c044ca514ce3afe49e2..4a8f44433fa3dd039239e375ce1e1e9fe59f543c 100644 (file)
@@ -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';
index ae6c63bf303866e420837286b0763a4cf51a4873..6c454aee68233abf85a1ee1c2853c6ba33311b31 100644 (file)
@@ -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
index 16e104c89051faae1152aedc0a20f576dfedf272..0602cdbda2c24709ffe3a4492cf333f95d42839e 100644 (file)
@@ -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;
index c2aca111b164155c4b9ce3da7d63ad745ba1f0fd..5249dd49d333074ab7ba645ae036da346eda3e58 100644 (file)
@@ -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);
 }
 
index 461694fc565c6999c2d06af9007f119bd0f48a4d..91b8e05ccf90c27929c8360ca71d046b26df1465 100644 (file)
@@ -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
index 02418934db03b9aeb55983854d8d2d17f1af7207..e8fd3cf434fd8b6f18cea2ed18c1c7d39536a15f 100644 (file)
@@ -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
index ad6c366b4958beb2c08cff047ba713bcab378aca..32648ad125321123934cd3b577e9bf84165785ff 100644 (file)
@@ -50,7 +50,8 @@ static const char *RTP_DATA = "$_1234\n\0asdf";
 
 static int rtp_packet_count = 0;
 
-static size_t rtp_write(void *ptr, size_t size, size_t nmemb, void *stream) {
+static size_t rtp_write(void *ptr, size_t size, size_t nmemb, void *stream)
+{
   char *data = (char *)ptr;
   int channel = RTP_PKT_CHANNEL(data);
   int message_size;
index a4bd598260fb7cf7f9f5874c4b4941c75df7cbb9..c39e147aa3058c043ec41b320b4f56b051d66cbb 100644 (file)
@@ -69,12 +69,12 @@ struct timetest {
 };
 
 UNITTEST_START
+{
+  struct timeval now;
+  long timeout;
+  unsigned int i;
 
-struct timeval now;
-long timeout;
-unsigned int i;
-
-const struct timetest run[] = {
+  const struct timetest run[] = {
   /* both timeouts set, not connecting */
   {BASE + 4, 0,      10000, 8000, FALSE, 6000, "6 seconds should be left"},
   {BASE + 4, 990000, 10000, 8000, FALSE, 5010, "5010 ms should be left"},
@@ -126,21 +126,20 @@ const struct timetest run[] = {
   /* both timeouts set, connecting, connect timeout the longer one */
   {BASE + 4, 0,      10000, 12000, TRUE, 6000, "6 seconds should be left"},
 
-};
-
-/* this is the pretended start time of the transfer */
-data->progress.t_startsingle.tv_sec = BASE;
-data->progress.t_startsingle.tv_usec = 0;
-data->progress.t_startop.tv_sec = BASE;
-data->progress.t_startop.tv_usec = 0;
-
-for(i=0; i < sizeof(run)/sizeof(run[0]); i++) {
-  NOW(run[i].now_s, run[i].now_us);
-  TIMEOUTS(run[i].timeout_ms, run[i].connecttimeout_ms);
-  timeout =  Curl_timeleft(data, &now, run[i].connecting);
-  if(timeout != run[i].result)
-    fail(run[i].comment);
+  };
+
+  /* this is the pretended start time of the transfer */
+  data->progress.t_startsingle.tv_sec = BASE;
+  data->progress.t_startsingle.tv_usec = 0;
+  data->progress.t_startop.tv_sec = BASE;
+  data->progress.t_startop.tv_usec = 0;
+
+  for(i=0; i < sizeof(run)/sizeof(run[0]); i++) {
+    NOW(run[i].now_s, run[i].now_us);
+    TIMEOUTS(run[i].timeout_ms, run[i].connecttimeout_ms);
+    timeout =  Curl_timeleft(data, &now, run[i].connecting);
+    if(timeout != run[i].result)
+      fail(run[i].comment);
+  }
 }
-
-
 UNITTEST_STOP
index 242be0005a212a22cc5189a0b50e264b89f799df..5f1ea95184f4a1a6e4925049511194fb78b58d42 100644 (file)
@@ -42,7 +42,8 @@ static void unit_stop(void)
 
 #if defined(MSDOS) || defined(WIN32)
 
-static char *getflagstr(int flags) {
+static char *getflagstr(int flags)
+{
   char *buf = malloc(256);
   fail_unless(buf, "out of memory");
   snprintf(buf, 256, "%s,%s,%s,%s",
@@ -53,7 +54,8 @@ static char *getflagstr(int flags) {
   return buf;
 }
 
-static char *getcurlcodestr(int cc) {
+static char *getcurlcodestr(int cc)
+{
   char *buf = malloc(256);
   fail_unless(buf, "out of memory");
   snprintf(buf, 256, "%s (%d)",