code style: use spaces around pluses

This commit is contained in:
Daniel Stenberg 2017-09-09 23:55:08 +02:00
parent ca86006deb
commit e5743f08e7
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
104 changed files with 386 additions and 366 deletions

View file

@ -118,7 +118,7 @@ static void memory_tracking_init(void)
/* returns a hexdump in a static memory area */
char *hexdump(const unsigned char *buffer, size_t len)
{
static char dump[200*3+1];
static char dump[200 * 3 + 1];
char *p = dump;
size_t i;
if(len > 200)

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2017, 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
@ -78,7 +78,7 @@ int test(char *URL)
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
abort_on_test_timeout();

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2017, 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
@ -99,7 +99,7 @@ int test(char *URL)
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
abort_on_test_timeout();

View file

@ -112,7 +112,7 @@ int test(char *URL)
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
select_test(maxfd+1, &rd, &wr, &exc, &interval);
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
abort_on_test_timeout();
}

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2017, 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
@ -118,7 +118,7 @@ int test(char *URL)
case of (maxfd == -1), we call select(0, ...), which is basically equal
to sleep. */
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
rc = select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
if(tutil_tvdiff(tutil_tvnow(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) {
fprintf(stderr, "ABORTING TEST, since it seems "

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2017, 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
@ -87,7 +87,7 @@ static int do_one_request(CURLM *m, char *URL, char *resolve)
timeout.tv_usec = 0;
multi_fdset(m, &fdread, &fdwrite, &fdexcep, &maxfd);
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
abort_on_test_timeout();
multi_perform(m, &still_running);

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2017, 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
@ -115,7 +115,7 @@ int test(char *URL)
else {
/* Note that on some platforms 'timeout' may be modified by select().
If you need access to the original value save a copy beforehand. */
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
rc = select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
}
switch(rc) {

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 2013 - 2016, Linus Nielsen Feltzing, <linus@haxx.se>
* Copyright (C) 2013 - 2017, Linus Nielsen Feltzing, <linus@haxx.se>
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -229,7 +229,7 @@ int test(char *URL)
interval.tv_sec = 0;
interval.tv_usec = 1000;
select_test(maxfd+1, &rd, &wr, &exc, &interval);
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
abort_on_test_timeout();
}

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2011, 2017, 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
@ -73,7 +73,7 @@ int test(char *URL)
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
abort_on_test_timeout();
}

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2012, 2017, 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
@ -83,7 +83,7 @@ int test(char *URL)
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
select_test(maxfd+1, &rd, &wr, &exc, &interval);
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
abort_on_test_timeout();
}

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2017, 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
@ -95,7 +95,7 @@ int test(char *URL)
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
select_test(maxfd+1, &rd, &wr, &exc, &interval);
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
abort_on_test_timeout();
}

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2017, 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
@ -70,7 +70,7 @@ int test(char *URL)
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
abort_on_test_timeout();

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2017, 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
@ -132,7 +132,7 @@ int test(char *URL)
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
select_test(maxfd+1, &rd, &wr, &exc, &interval);
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
abort_on_test_timeout();
}

View file

@ -133,7 +133,7 @@ int test(char *URL)
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
select_test(maxfd+1, &rd, &wr, &exc, &interval);
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
abort_on_test_timeout();
}

View file

@ -101,7 +101,7 @@ int test(char *URL)
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
select_test(maxfd+1, &rd, &wr, &exc, &interval);
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
abort_on_test_timeout();
}

View file

@ -95,7 +95,7 @@ int test(char *URL)
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
select_test(maxfd+1, &rd, &wr, &exc, &interval);
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
abort_on_test_timeout();
}

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2011, 2017, 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
@ -63,7 +63,7 @@ static int perform(CURLM *multi)
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
res_select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &interval);
res_select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &interval);
if(res)
return res;

View file

@ -152,7 +152,7 @@ static int loop(int num, CURLM *cm, const char *url, const char *userpwd,
T.tv_usec = 0;
}
res_select_test(M+1, &R, &W, &E, &T);
res_select_test(M + 1, &R, &W, &E, &T);
if(res)
return res;
}

View file

@ -48,30 +48,32 @@ void dump(const char *text,
fprintf(stream, "%s, %d bytes (0x%x)\n", text, (int)size, (int)size);
for(i = 0; i<size; i+= width) {
for(i = 0; i<size; i += width) {
fprintf(stream, "%04x: ", (int)i);
if(!nohex) {
/* hex not disabled, show it */
for(c = 0; c < width; c++)
if(i+c < size)
fprintf(stream, "%02x ", ptr[i+c]);
if(i + c < size)
fprintf(stream, "%02x ", ptr[i + c]);
else
fputs(" ", stream);
}
for(c = 0; (c < width) && (i+c < size); c++) {
for(c = 0; (c < width) && (i + c < size); c++) {
/* check for 0D0A; if found, skip past and start a new line of output */
if(nohex && (i+c+1 < size) && ptr[i+c] == 0x0D && ptr[i+c+1] == 0x0A) {
i+=(c+2-width);
if(nohex && (i + c + 1 < size) && ptr[i + c] == 0x0D &&
ptr[i + c + 1] == 0x0A) {
i += (c + 2 - width);
break;
}
fprintf(stream, "%c",
(ptr[i+c] >= 0x20) && (ptr[i+c]<0x80)?ptr[i+c]:'.');
(ptr[i + c] >= 0x20) && (ptr[i + c]<0x80)? ptr[i + c] : '.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
if(nohex && (i+c+2 < size) && ptr[i+c+1] == 0x0D && ptr[i+c+2] == 0x0A) {
i+=(c+3-width);
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
ptr[i + c + 2] == 0x0A) {
i += (c + 3 - width);
break;
}
}

View file

@ -141,7 +141,7 @@ int test(char *URL)
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
abort_on_test_timeout();
}

View file

@ -1546,6 +1546,7 @@ static int test_weird_arguments(void)
}
/* DBL_MAX value from Linux */
/* !checksrc! disable PLUSNOSPACE 1 */
#define MAXIMIZE -1.7976931348623157081452E+308
static int test_float_formatting(void)

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2011, 2017, 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
@ -91,7 +91,7 @@ int test(char *URL)
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
abort_on_test_timeout();

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2013, 2017, 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
@ -76,7 +76,7 @@ int test(char *URL)
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
select_test(maxfd+1, &rd, &wr, &exc, &interval);
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
abort_on_test_timeout();
}

View file

@ -70,7 +70,7 @@ static size_t rtp_write(void *ptr, size_t size, size_t nmemb, void *stream)
}
data += 4;
for(i = 0; i < message_size; i+= RTP_DATA_SIZE) {
for(i = 0; i < message_size; i += RTP_DATA_SIZE) {
if(message_size - i > RTP_DATA_SIZE) {
if(memcmp(RTP_DATA, data + i, RTP_DATA_SIZE) != 0) {
printf("RTP PAYLOAD CORRUPTED [%s]\n", data + i);

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2017, 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
@ -88,7 +88,7 @@ int test(char *URL)
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
abort_on_test_timeout();
}

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2011, 2017, 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
@ -93,7 +93,7 @@ int test(char *URL)
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
abort_on_test_timeout();

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2012, 2017, 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
@ -123,7 +123,7 @@ int test(char *URL)
interval.tv_usec = 100000L; /* 100 ms */
}
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &interval);
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &interval);
abort_on_test_timeout();
}

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2017, 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
@ -120,11 +120,11 @@ int test(char *URL)
interval.tv_usec = (itimeout%1000)*1000;
}
else {
interval.tv_sec = TEST_HANG_TIMEOUT/1000+1;
interval.tv_sec = TEST_HANG_TIMEOUT/1000 + 1;
interval.tv_usec = 0;
}
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &interval);
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &interval);
abort_on_test_timeout();
}

View file

@ -196,7 +196,7 @@ int test(char *url)
interval.tv_usec = (itimeout%1000)*1000;
}
else {
interval.tv_sec = TEST_HANG_TIMEOUT/1000+1;
interval.tv_sec = TEST_HANG_TIMEOUT/1000 + 1;
interval.tv_usec = 0;
/* if there's no timeout and we get here on the last handle, we may
@ -207,7 +207,7 @@ int test(char *url)
}
}
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &interval);
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &interval);
abort_on_test_timeout();
}

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2017, 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
@ -53,25 +53,27 @@ void libtest_debug_dump(const char *timebuf, const char *text, FILE *stream,
if(!nohex) {
/* hex not disabled, show it */
for(c = 0; c < width; c++)
if(i+c < size)
fprintf(stream, "%02x ", ptr[i+c]);
if(i + c < size)
fprintf(stream, "%02x ", ptr[i + c]);
else
fputs(" ", stream);
}
for(c = 0; (c < width) && (i+c < size); c++) {
for(c = 0; (c < width) && (i + c < size); c++) {
/* check for 0D0A; if found, skip past and start a new line of output */
if(nohex &&
(i+c+1 < size) && (ptr[i+c] == 0x0D) && (ptr[i+c+1] == 0x0A)) {
i += (c+2-width);
(i + c + 1 < size) && (ptr[i + c] == 0x0D) &&
(ptr[i + c + 1] == 0x0A)) {
i += (c + 2 - width);
break;
}
fprintf(stream, "%c", ((ptr[i+c] >= 0x20) && (ptr[i+c] < 0x80)) ?
ptr[i+c] : '.');
fprintf(stream, "%c", ((ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80)) ?
ptr[i + c] : '.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
if(nohex &&
(i+c+2 < size) && (ptr[i+c+1] == 0x0D) && (ptr[i+c+2] == 0x0A)) {
i += (c+3-width);
(i + c + 2 < size) && (ptr[i + c + 1] == 0x0D) &&
(ptr[i + c + 2] == 0x0A)) {
i += (c + 3 - width);
break;
}
}