Skip to content

Commit 6832c1d

Browse files
committed
checksrc: move open braces to comply with function declaration style
1 parent 80e7cfe commit 6832c1d

File tree

13 files changed

+85
-72
lines changed

13 files changed

+85
-72
lines changed

docs/examples/ghiper.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ typedef struct _SockInfo {
9494
} SockInfo;
9595

9696
/* Die if we get a bad CURLMcode somewhere */
97-
static void mcode_or_die(const char *where, CURLMcode code) {
97+
static void mcode_or_die(const char *where, CURLMcode code)
98+
{
9899
if(CURLM_OK != code) {
99100
const char *s;
100101
switch (code) {

lib/curl_gethostname.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
* For libcurl static library release builds no overriding takes place.
4949
*/
5050

51-
int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) {
52-
51+
int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen)
52+
{
5353
#ifndef HAVE_GETHOSTNAME
5454

5555
/* Allow compilation and return failure when unavailable */

lib/formdata.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,8 @@ int Curl_FormInit(struct Form *form, struct FormData *formdata)
14271427
*
14281428
*/
14291429
# define fopen_read vmsfopenread
1430-
static FILE * vmsfopenread(const char *file, const char *mode) {
1430+
static FILE * vmsfopenread(const char *file, const char *mode)
1431+
{
14311432
struct_stat statbuf;
14321433
int result;
14331434

lib/http2.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ int Curl_http2_ver(char *p, size_t len)
225225
https://tools.ietf.org/html/rfc7540#page-77
226226
nghttp2_error_code enums are identical.
227227
*/
228-
const char *Curl_http2_strerror(uint32_t err) {
228+
const char *Curl_http2_strerror(uint32_t err)
229+
{
229230
#ifndef NGHTTP2_HAS_HTTP2_STRERROR
230231
const char *str[] = {
231232
"NO_ERROR", /* 0x0 */
@@ -1578,7 +1579,8 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
15781579
* Parse the tokens as separated by comma and surrounded by whitespace.
15791580
* Returns TRUE if found or FALSE if not.
15801581
*/
1581-
static bool contains_trailers(const char *p, size_t len) {
1582+
static bool contains_trailers(const char *p, size_t len)
1583+
{
15821584
const char *end = p + len;
15831585
for(;;) {
15841586
for(; p != end && (*p == ' ' || *p == '\t'); ++p)

lib/security.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ name_to_level(const char *name)
8888

8989
/* Convert a protocol |level| to its char representation.
9090
We take an int to catch programming mistakes. */
91-
static char level_to_char(int level) {
91+
static char level_to_char(int level)
92+
{
9293
switch(level) {
9394
case PROT_CLEAR:
9495
return 'C';

lib/setup-vms.h

+33-33
Original file line numberDiff line numberDiff line change
@@ -138,48 +138,48 @@ static char *vms_getenv(const char *envvar)
138138

139139
static struct passwd vms_passwd_cache;
140140

141-
static struct passwd * vms_getpwuid(uid_t uid) {
142-
143-
struct passwd * my_passwd;
141+
static struct passwd * vms_getpwuid(uid_t uid)
142+
{
143+
struct passwd * my_passwd;
144144

145145
/* Hack needed to support 64 bit builds, decc_getpwnam is 32 bit only */
146146
#ifdef __DECC
147147
# if __INITIAL_POINTER_SIZE
148-
__char_ptr32 unix_path;
148+
__char_ptr32 unix_path;
149149
# else
150-
char *unix_path;
150+
char *unix_path;
151151
# endif
152152
#else
153-
char *unix_path;
153+
char *unix_path;
154154
#endif
155155

156-
my_passwd = decc_getpwuid(uid);
157-
if(my_passwd == NULL) {
158-
return my_passwd;
159-
}
160-
161-
unix_path = vms_translate_path(my_passwd->pw_dir);
162-
163-
if((long)unix_path <= 0) {
164-
/* We can not translate it, so return the original string */
165-
return my_passwd;
166-
}
167-
168-
/* If no changes needed just return it */
169-
if(unix_path == my_passwd->pw_dir) {
170-
return my_passwd;
171-
}
172-
173-
/* Need to copy the structure returned */
174-
/* Since curl is only using pw_dir, no need to fix up *
175-
/* the pw_shell when running under Bash */
176-
vms_passwd_cache.pw_name = my_passwd->pw_name;
177-
vms_passwd_cache.pw_uid = my_passwd->pw_uid;
178-
vms_passwd_cache.pw_gid = my_passwd->pw_uid;
179-
vms_passwd_cache.pw_dir = unix_path;
180-
vms_passwd_cache.pw_shell = my_passwd->pw_shell;
181-
182-
return &vms_passwd_cache;
156+
my_passwd = decc_getpwuid(uid);
157+
if(my_passwd == NULL) {
158+
return my_passwd;
159+
}
160+
161+
unix_path = vms_translate_path(my_passwd->pw_dir);
162+
163+
if((long)unix_path <= 0) {
164+
/* We can not translate it, so return the original string */
165+
return my_passwd;
166+
}
167+
168+
/* If no changes needed just return it */
169+
if(unix_path == my_passwd->pw_dir) {
170+
return my_passwd;
171+
}
172+
173+
/* Need to copy the structure returned */
174+
/* Since curl is only using pw_dir, no need to fix up */
175+
/* the pw_shell when running under Bash */
176+
vms_passwd_cache.pw_name = my_passwd->pw_name;
177+
vms_passwd_cache.pw_uid = my_passwd->pw_uid;
178+
vms_passwd_cache.pw_gid = my_passwd->pw_uid;
179+
vms_passwd_cache.pw_dir = unix_path;
180+
vms_passwd_cache.pw_shell = my_passwd->pw_shell;
181+
182+
return &vms_passwd_cache;
183183
}
184184

185185
#ifdef __DECC

lib/vtls/darwinssl.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ static OSStatus SocketWrite(SSLConnectionRef connection,
219219
return ortn;
220220
}
221221

222-
CF_INLINE const char *SSLCipherNameForNumber(SSLCipherSuite cipher) {
222+
CF_INLINE const char *SSLCipherNameForNumber(SSLCipherSuite cipher)
223+
{
223224
switch (cipher) {
224225
/* SSL version 3.0 */
225226
case SSL_RSA_WITH_NULL_MD5:
@@ -364,7 +365,8 @@ CF_INLINE const char *SSLCipherNameForNumber(SSLCipherSuite cipher) {
364365
return "SSL_NULL_WITH_NULL_NULL";
365366
}
366367

367-
CF_INLINE const char *TLSCipherNameForNumber(SSLCipherSuite cipher) {
368+
CF_INLINE const char *TLSCipherNameForNumber(SSLCipherSuite cipher)
369+
{
368370
switch(cipher) {
369371
/* TLS 1.0 with AES (RFC 3268) */
370372
case TLS_RSA_WITH_AES_128_CBC_SHA:
@@ -2449,7 +2451,8 @@ void Curl_darwinssl_md5sum(unsigned char *tmp, /* input */
24492451
(void)CC_MD5(tmp, (CC_LONG)tmplen, md5sum);
24502452
}
24512453

2452-
bool Curl_darwinssl_false_start(void) {
2454+
bool Curl_darwinssl_false_start(void)
2455+
{
24532456
#if CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7
24542457
if(SSLSetSessionOption != NULL)
24552458
return TRUE;

lib/vtls/gtls.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ static gnutls_datum_t load_file (const char *file)
261261
return loaded_file;
262262
}
263263

264-
static void unload_file(gnutls_datum_t data) {
264+
static void unload_file(gnutls_datum_t data)
265+
{
265266
free(data.data);
266267
}
267268

lib/vtls/nss.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -2181,7 +2181,8 @@ bool Curl_nss_cert_status_request(void)
21812181
#endif
21822182
}
21832183

2184-
bool Curl_nss_false_start(void) {
2184+
bool Curl_nss_false_start(void)
2185+
{
21852186
#if NSSVERNUM >= 0x030f04 /* 3.15.4 */
21862187
return TRUE;
21872188
#else

lib/vtls/vtls.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,13 @@ static bool ssl_prefs_check(struct Curl_easy *data)
182182
}
183183

184184
static CURLcode
185-
ssl_connect_init_proxy(struct connectdata *conn, int sockindex) {
185+
ssl_connect_init_proxy(struct connectdata *conn, int sockindex)
186+
{
186187
DEBUGASSERT(conn->bits.proxy_ssl_connected[sockindex]);
187188
if(ssl_connection_complete == conn->ssl[sockindex].state &&
188189
!conn->proxy_ssl[sockindex].use) {
189-
#if defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_NSS) || \
190-
defined(USE_GSKIT)
190+
#if defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_NSS) || \
191+
defined(USE_GSKIT)
191192
conn->proxy_ssl[sockindex] = conn->ssl[sockindex];
192193
memset(&conn->ssl[sockindex], 0, sizeof(conn->ssl[sockindex]));
193194
#else

tests/libtest/lib571.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ static const char *RTP_DATA = "$_1234\n\0asdf";
5050

5151
static int rtp_packet_count = 0;
5252

53-
static size_t rtp_write(void *ptr, size_t size, size_t nmemb, void *stream) {
53+
static size_t rtp_write(void *ptr, size_t size, size_t nmemb, void *stream)
54+
{
5455
char *data = (char *)ptr;
5556
int channel = RTP_PKT_CHANNEL(data);
5657
int message_size;

tests/unit/unit1303.c

+20-21
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ struct timetest {
6969
};
7070

7171
UNITTEST_START
72+
{
73+
struct timeval now;
74+
long timeout;
75+
unsigned int i;
7276

73-
struct timeval now;
74-
long timeout;
75-
unsigned int i;
76-
77-
const struct timetest run[] = {
77+
const struct timetest run[] = {
7878
/* both timeouts set, not connecting */
7979
{BASE + 4, 0, 10000, 8000, FALSE, 6000, "6 seconds should be left"},
8080
{BASE + 4, 990000, 10000, 8000, FALSE, 5010, "5010 ms should be left"},
@@ -126,21 +126,20 @@ const struct timetest run[] = {
126126
/* both timeouts set, connecting, connect timeout the longer one */
127127
{BASE + 4, 0, 10000, 12000, TRUE, 6000, "6 seconds should be left"},
128128

129-
};
130-
131-
/* this is the pretended start time of the transfer */
132-
data->progress.t_startsingle.tv_sec = BASE;
133-
data->progress.t_startsingle.tv_usec = 0;
134-
data->progress.t_startop.tv_sec = BASE;
135-
data->progress.t_startop.tv_usec = 0;
136-
137-
for(i=0; i < sizeof(run)/sizeof(run[0]); i++) {
138-
NOW(run[i].now_s, run[i].now_us);
139-
TIMEOUTS(run[i].timeout_ms, run[i].connecttimeout_ms);
140-
timeout = Curl_timeleft(data, &now, run[i].connecting);
141-
if(timeout != run[i].result)
142-
fail(run[i].comment);
129+
};
130+
131+
/* this is the pretended start time of the transfer */
132+
data->progress.t_startsingle.tv_sec = BASE;
133+
data->progress.t_startsingle.tv_usec = 0;
134+
data->progress.t_startop.tv_sec = BASE;
135+
data->progress.t_startop.tv_usec = 0;
136+
137+
for(i=0; i < sizeof(run)/sizeof(run[0]); i++) {
138+
NOW(run[i].now_s, run[i].now_us);
139+
TIMEOUTS(run[i].timeout_ms, run[i].connecttimeout_ms);
140+
timeout = Curl_timeleft(data, &now, run[i].connecting);
141+
if(timeout != run[i].result)
142+
fail(run[i].comment);
143+
}
143144
}
144-
145-
146145
UNITTEST_STOP

tests/unit/unit1604.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ static void unit_stop(void)
4242

4343
#if defined(MSDOS) || defined(WIN32)
4444

45-
static char *getflagstr(int flags) {
45+
static char *getflagstr(int flags)
46+
{
4647
char *buf = malloc(256);
4748
fail_unless(buf, "out of memory");
4849
snprintf(buf, 256, "%s,%s,%s,%s",
@@ -53,7 +54,8 @@ static char *getflagstr(int flags) {
5354
return buf;
5455
}
5556

56-
static char *getcurlcodestr(int cc) {
57+
static char *getcurlcodestr(int cc)
58+
{
5759
char *buf = malloc(256);
5860
fail_unless(buf, "out of memory");
5961
snprintf(buf, 256, "%s (%d)",

0 commit comments

Comments
 (0)