diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-09-09 23:09:06 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-09-11 09:29:50 +0200 |
commit | 6b84438d9a9220fb75cbaae9d6fe6c3edb6d425e (patch) | |
tree | 109c29611f5bd2dbedab015b45524e8ffe6e1057 /tests | |
parent | e155f38d1eaa89cc8ce2a6536b74be2954506bb0 (diff) |
code style: use spaces around equals signs
Diffstat (limited to 'tests')
54 files changed, 227 insertions, 226 deletions
diff --git a/tests/libtest/first.c b/tests/libtest/first.c index 72140e314..706d853ca 100644 --- a/tests/libtest/first.c +++ b/tests/libtest/first.c @@ -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 @@ -72,8 +72,8 @@ void wait_ms(int ms) select_wrapper(0, NULL, NULL, NULL, &t); } -char *libtest_arg2=NULL; -char *libtest_arg3=NULL; +char *libtest_arg2 = NULL; +char *libtest_arg3 = NULL; int test_argc; char **test_argv; @@ -123,7 +123,7 @@ char *hexdump(const unsigned char *buffer, size_t len) size_t i; if(len > 200) return NULL; - for(i=0; i<len; i++, p += 3) + for(i = 0; i<len; i++, p += 3) snprintf(p, 4, "%02x ", buffer[i]); return dump; } @@ -162,10 +162,10 @@ int main(int argc, char **argv) test_argv = argv; if(argc>2) - libtest_arg2=argv[2]; + libtest_arg2 = argv[2]; if(argc>3) - libtest_arg3=argv[3]; + libtest_arg3 = argv[3]; URL = argv[1]; /* provide this to the rest */ diff --git a/tests/libtest/lib1506.c b/tests/libtest/lib1506.c index 47fc335ce..687437636 100644 --- a/tests/libtest/lib1506.c +++ b/tests/libtest/lib1506.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2013, 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 @@ -45,7 +45,7 @@ int test(char *URL) (void)URL; /* Create fake DNS entries for serverX.example.com for all handles */ - for(i=0; i < NUM_HANDLES; i++) { + for(i = 0; i < NUM_HANDLES; i++) { snprintf(dnsentry, sizeof(dnsentry), "server%d.example.com:%s:%s", i + 1, port, address); printf("%s\n", dnsentry); @@ -66,7 +66,7 @@ int test(char *URL) multi_setopt(m, CURLMOPT_MAXCONNECTS, 3L); /* get NUM_HANDLES easy handles */ - for(i=0; i < NUM_HANDLES; i++) { + for(i = 0; i < NUM_HANDLES; i++) { /* get an easy handle */ easy_init(curl[i]); /* specify target */ @@ -85,7 +85,7 @@ int test(char *URL) fprintf(stderr, "Start at URL 0\n"); - for(i=0; i < NUM_HANDLES; i++) { + for(i = 0; i < NUM_HANDLES; i++) { /* add handle to multi */ multi_add_handle(m, curl[i]); @@ -123,7 +123,7 @@ test_cleanup: /* proper cleanup sequence - type PB */ - for(i=0; i < NUM_HANDLES; i++) { + for(i = 0; i < NUM_HANDLES; i++) { curl_multi_remove_handle(m, curl[i]); curl_easy_cleanup(curl[i]); } diff --git a/tests/libtest/lib1510.c b/tests/libtest/lib1510.c index 25e9fed31..d72749b24 100644 --- a/tests/libtest/lib1510.c +++ b/tests/libtest/lib1510.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2013, 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 @@ -43,7 +43,7 @@ int test(char *URL) (void)URL; /* Create fake DNS entries for serverX.example.com for all handles */ - for(i=0; i < NUM_URLS; i++) { + for(i = 0; i < NUM_URLS; i++) { snprintf(dnsentry, sizeof(dnsentry), "server%d.example.com:%s:%s", i + 1, port, address); printf("%s\n", dnsentry); @@ -72,7 +72,7 @@ int test(char *URL) easy_setopt(curl, CURLOPT_MAXCONNECTS, 3L); /* get NUM_HANDLES easy handles */ - for(i=0; i < NUM_URLS; i++) { + for(i = 0; i < NUM_URLS; i++) { /* specify target */ snprintf(target_url, sizeof(target_url), "http://server%d.example.com:%s/path/1510%04i", diff --git a/tests/libtest/lib1512.c b/tests/libtest/lib1512.c index f4091b45a..5e794b293 100644 --- a/tests/libtest/lib1512.c +++ b/tests/libtest/lib1512.c @@ -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 @@ -55,7 +55,7 @@ int test(char *URL) slist = curl_slist_append(slist, dnsentry); /* get NUM_HANDLES easy handles */ - for(i=0; i < NUM_HANDLES; i++) { + for(i = 0; i < NUM_HANDLES; i++) { /* get an easy handle */ easy_init(curl[i]); /* specify target */ @@ -76,7 +76,7 @@ int test(char *URL) easy_setopt(curl[0], CURLOPT_RESOLVE, slist); /* run NUM_HANDLES transfers */ - for(i=0; (i < NUM_HANDLES) && !res; i++) + for(i = 0; (i < NUM_HANDLES) && !res; i++) res = curl_easy_perform(curl[i]); test_cleanup: diff --git a/tests/libtest/lib1513.c b/tests/libtest/lib1513.c index d0123f1f6..932ca7208 100644 --- a/tests/libtest/lib1513.c +++ b/tests/libtest/lib1513.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2015, 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 @@ -48,7 +48,7 @@ static int progressKiller(void *arg, int test(char *URL) { CURL *curl; - int res=0; + int res = 0; global_init(CURL_GLOBAL_ALL); diff --git a/tests/libtest/lib1517.c b/tests/libtest/lib1517.c index e270ed74d..ea622b046 100644 --- a/tests/libtest/lib1517.c +++ b/tests/libtest/lib1517.c @@ -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 @@ -54,7 +54,7 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp) int test(char *URL) { CURL *curl; - CURLcode res=CURLE_OK; + CURLcode res = CURLE_OK; struct WriteThis pooh; diff --git a/tests/libtest/lib1538.c b/tests/libtest/lib1538.c index e4e16f203..91481e88d 100644 --- a/tests/libtest/lib1538.c +++ b/tests/libtest/lib1538.c @@ -37,13 +37,14 @@ int test(char *URL) curl_easy_strerror(-INT_MAX); curl_multi_strerror(-INT_MAX); curl_share_strerror(-INT_MAX); - for(easyret=CURLE_OK; easyret <= CURL_LAST; easyret++) { + for(easyret = CURLE_OK; easyret <= CURL_LAST; easyret++) { printf("e%d: %s\n", (int)easyret, curl_easy_strerror(easyret)); } - for(multiret=CURLM_CALL_MULTI_PERFORM; multiret <= CURLM_LAST; multiret++) { + for(multiret = CURLM_CALL_MULTI_PERFORM; multiret <= CURLM_LAST; + multiret++) { printf("m%d: %s\n", (int)multiret, curl_multi_strerror(multiret)); } - for(shareret=CURLSHE_OK; shareret <= CURLSHE_LAST; shareret++) { + for(shareret = CURLSHE_OK; shareret <= CURLSHE_LAST; shareret++) { printf("s%d: %s\n", (int)shareret, curl_share_strerror(shareret)); } diff --git a/tests/libtest/lib500.c b/tests/libtest/lib500.c index d17b24b20..677ab73a7 100644 --- a/tests/libtest/lib500.c +++ b/tests/libtest/lib500.c @@ -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 @@ -61,7 +61,7 @@ int test(char *URL) { CURLcode res; CURL *curl; - char *ipstr=NULL; + char *ipstr = NULL; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); diff --git a/tests/libtest/lib505.c b/tests/libtest/lib505.c index ad5d214c6..cc7463bde 100644 --- a/tests/libtest/lib505.c +++ b/tests/libtest/lib505.c @@ -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 @@ -43,7 +43,7 @@ int test(char *URL) struct_stat file_info; struct curl_slist *hl; - struct curl_slist *headerlist=NULL; + struct curl_slist *headerlist = NULL; const char *buf_1 = "RNFR 505"; const char *buf_2 = "RNTO 505-forreal"; diff --git a/tests/libtest/lib506.c b/tests/libtest/lib506.c index d26252b6f..1b522be64 100644 --- a/tests/libtest/lib506.c +++ b/tests/libtest/lib506.c @@ -131,7 +131,7 @@ static void *fire(void *ptr) struct curl_slist *headers; struct Tdata *tdata = (struct Tdata*)ptr; CURL *curl; - int i=0; + int i = 0; curl = curl_easy_init(); if(!curl) { @@ -261,7 +261,7 @@ int test(char *URL) res = 0; /* start treads */ - for(i=1; i<=THREADS; i++) { + for(i = 1; i <= THREADS; i++) { /* set thread data */ tdata.url = suburl(URL, i); /* must be curl_free()d */ @@ -349,7 +349,7 @@ int test(char *URL) /* try to free share, expect to fail because share is in use*/ printf("try SHARE_CLEANUP...\n"); scode = curl_share_cleanup(share); - if(scode==CURLSHE_OK) { + if(scode == CURLSHE_OK) { fprintf(stderr, "curl_share_cleanup succeed but error expected\n"); share = NULL; } @@ -368,7 +368,7 @@ test_cleanup: /* free share */ printf("SHARE_CLEANUP\n"); scode = curl_share_cleanup(share); - if(scode!=CURLSHE_OK) + if(scode != CURLSHE_OK) fprintf(stderr, "curl_share_cleanup failed, code errno %d\n", (int)scode); diff --git a/tests/libtest/lib508.c b/tests/libtest/lib508.c index 1f6c6838a..30705e46a 100644 --- a/tests/libtest/lib508.c +++ b/tests/libtest/lib508.c @@ -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 @@ -50,7 +50,7 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp) int test(char *URL) { CURL *curl; - CURLcode res=CURLE_OK; + CURLcode res = CURLE_OK; struct WriteThis pooh; diff --git a/tests/libtest/lib510.c b/tests/libtest/lib510.c index 4c290f1ef..4d568df44 100644 --- a/tests/libtest/lib510.c +++ b/tests/libtest/lib510.c @@ -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 @@ -62,7 +62,7 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp) int test(char *URL) { CURL *curl; - CURLcode res=CURLE_OK; + CURLcode res = CURLE_OK; struct curl_slist *slist = NULL; struct WriteThis pooh; pooh.counter = 0; diff --git a/tests/libtest/lib513.c b/tests/libtest/lib513.c index 7c34bc4db..c6a98cca2 100644 --- a/tests/libtest/lib513.c +++ b/tests/libtest/lib513.c @@ -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 @@ -35,7 +35,7 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp) int test(char *URL) { CURL *curl; - CURLcode res=CURLE_OK; + CURLcode res = CURLE_OK; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); diff --git a/tests/libtest/lib514.c b/tests/libtest/lib514.c index 7b33d52f9..702058b19 100644 --- a/tests/libtest/lib514.c +++ b/tests/libtest/lib514.c @@ -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 @@ -26,7 +26,7 @@ int test(char *URL) { CURL *curl; - CURLcode res=CURLE_OK; + CURLcode res = CURLE_OK; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); diff --git a/tests/libtest/lib515.c b/tests/libtest/lib515.c index 6fb178720..9f29d43c9 100644 --- a/tests/libtest/lib515.c +++ b/tests/libtest/lib515.c @@ -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 @@ -26,7 +26,7 @@ int test(char *URL) { CURL *curl; - CURLcode res=CURLE_OK; + CURLcode res = CURLE_OK; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); diff --git a/tests/libtest/lib516.c b/tests/libtest/lib516.c index 00c54c450..6d83e218c 100644 --- a/tests/libtest/lib516.c +++ b/tests/libtest/lib516.c @@ -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 @@ -26,7 +26,7 @@ int test(char *URL) { CURL *curl; - CURLcode res=CURLE_OK; + CURLcode res = CURLE_OK; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); diff --git a/tests/libtest/lib517.c b/tests/libtest/lib517.c index 22162ff1e..af7b2aa7a 100644 --- a/tests/libtest/lib517.c +++ b/tests/libtest/lib517.c @@ -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 @@ -131,7 +131,7 @@ int test(char *URL) (void)URL; /* not used */ - for(i=0; dates[i]; i++) { + for(i = 0; dates[i]; i++) { printf("%d: %s => %ld\n", i, dates[i], (long)curl_getdate(dates[i], NULL)); } diff --git a/tests/libtest/lib526.c b/tests/libtest/lib526.c index 522cd7422..5e41cc0a1 100644 --- a/tests/libtest/lib526.c +++ b/tests/libtest/lib526.c @@ -59,7 +59,7 @@ int test(char *URL) int current = 0; int i; - for(i=0; i < NUM_HANDLES; i++) + for(i = 0; i < NUM_HANDLES; i++) curl[i] = NULL; start_test_timing(); @@ -67,7 +67,7 @@ int test(char *URL) global_init(CURL_GLOBAL_ALL); /* get NUM_HANDLES easy handles */ - for(i=0; i < NUM_HANDLES; i++) { + for(i = 0; i < NUM_HANDLES; i++) { easy_init(curl[i]); /* specify target */ easy_setopt(curl[i], CURLOPT_URL, URL); @@ -145,7 +145,7 @@ test_cleanup: /* test 526 and 528 */ /* proper cleanup sequence - type PB */ - for(i=0; i < NUM_HANDLES; i++) { + for(i = 0; i < NUM_HANDLES; i++) { curl_multi_remove_handle(m, curl[i]); curl_easy_cleanup(curl[i]); } @@ -162,7 +162,7 @@ test_cleanup: will be leaked, let's use undocumented cleanup sequence - type UB */ if(res) - for(i=0; i < NUM_HANDLES; i++) + for(i = 0; i < NUM_HANDLES; i++) curl_easy_cleanup(curl[i]); curl_multi_cleanup(m); @@ -173,7 +173,7 @@ test_cleanup: /* test 532 */ /* undocumented cleanup sequence - type UB */ - for(i=0; i < NUM_HANDLES; i++) + for(i = 0; i < NUM_HANDLES; i++) curl_easy_cleanup(curl[i]); curl_multi_cleanup(m); curl_global_cleanup(); diff --git a/tests/libtest/lib530.c b/tests/libtest/lib530.c index 82bfab36c..e7726fbc3 100644 --- a/tests/libtest/lib530.c +++ b/tests/libtest/lib530.c @@ -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 @@ -39,7 +39,7 @@ int test(char *URL) char target_url[256]; int handles_added = 0; - for(i=0; i < NUM_HANDLES; i++) + for(i = 0; i < NUM_HANDLES; i++) curl[i] = NULL; start_test_timing(); @@ -49,7 +49,7 @@ int test(char *URL) multi_init(m); /* get NUM_HANDLES easy handles */ - for(i=0; i < NUM_HANDLES; i++) { + for(i = 0; i < NUM_HANDLES; i++) { /* get an easy handle */ easy_init(curl[i]); /* specify target */ @@ -110,7 +110,7 @@ test_cleanup: /* proper cleanup sequence - type PB */ - for(i=0; i < NUM_HANDLES; i++) { + for(i = 0; i < NUM_HANDLES; i++) { curl_multi_remove_handle(m, curl[i]); curl_easy_cleanup(curl[i]); } diff --git a/tests/libtest/lib533.c b/tests/libtest/lib533.c index 706b269fe..ceb71bf7b 100644 --- a/tests/libtest/lib533.c +++ b/tests/libtest/lib533.c @@ -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 @@ -37,7 +37,7 @@ int test(char *URL) CURL *curl = NULL; int running; CURLM *m = NULL; - int current=0; + int current = 0; start_test_timing(); diff --git a/tests/libtest/lib540.c b/tests/libtest/lib540.c index ac862092f..61f635f69 100644 --- a/tests/libtest/lib540.c +++ b/tests/libtest/lib540.c @@ -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 @@ -165,7 +165,7 @@ static int loop(int num, CURLM *cm, const char *url, const char *userpwd, curl_easy_strerror(msg->data.result)); curl_multi_remove_handle(cm, e); curl_easy_cleanup(e); - for(i=0; i < NUM_HANDLES; i++) { + for(i = 0; i < NUM_HANDLES; i++) { if(eh[i] == e) { eh[i] = NULL; break; @@ -192,7 +192,7 @@ int test(char *URL) int res = 0; int i; - for(i=0; i < NUM_HANDLES; i++) + for(i = 0; i < NUM_HANDLES; i++) eh[i] = NULL; start_test_timing(); @@ -234,7 +234,7 @@ test_cleanup: /* proper cleanup sequence - type PB */ - for(i=0; i < NUM_HANDLES; i++) { + for(i = 0; i < NUM_HANDLES; i++) { curl_multi_remove_handle(cm, eh[i]); curl_easy_cleanup(eh[i]); } diff --git a/tests/libtest/lib544.c b/tests/libtest/lib544.c index 28eacdaf6..1f832d2a6 100644 --- a/tests/libtest/lib544.c +++ b/tests/libtest/lib544.c @@ -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 @@ -40,7 +40,7 @@ static char teststring[] = int test(char *URL) { CURL *curl; - CURLcode res=CURLE_OK; + CURLcode res = CURLE_OK; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); diff --git a/tests/libtest/lib547.c b/tests/libtest/lib547.c index ce967c085..3db4890de 100644 --- a/tests/libtest/lib547.c +++ b/tests/libtest/lib547.c @@ -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 @@ -82,7 +82,7 @@ int test(char *URL) CURLcode res; CURL *curl; #ifndef LIB548 - int counter=0; + int counter = 0; #endif if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { diff --git a/tests/libtest/lib552.c b/tests/libtest/lib552.c index 9cae45993..e42ba34f9 100644 --- a/tests/libtest/lib552.c +++ b/tests/libtest/lib552.c @@ -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 @@ -40,7 +40,7 @@ void dump(const char *text, size_t i; size_t c; - unsigned int width=0x10; + unsigned int width = 0x10; if(nohex) /* without the hex output, we can fit more on screen */ @@ -48,7 +48,7 @@ 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); @@ -63,14 +63,14 @@ void dump(const char *text, 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) { + 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) { + if(nohex && (i+c+2 < size) && ptr[i+c+1] == 0x0D && ptr[i+c+2] == 0x0A) { i+=(c+3-width); break; } @@ -182,7 +182,7 @@ int test(char *URL) test_setopt(curl, CURLOPT_VERBOSE, 1L); /* setup repeated data string */ - for(i=0; i < sizeof(databuf); ++i) + for(i = 0; i < sizeof(databuf); ++i) databuf[i] = fill[i % sizeof fill]; /* Post */ diff --git a/tests/libtest/lib553.c b/tests/libtest/lib553.c index 288f4c1d1..c06561e1d 100644 --- a/tests/libtest/lib553.c +++ b/tests/libtest/lib553.c @@ -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 @@ -32,7 +32,7 @@ static size_t myreadfunc(void *ptr, size_t size, size_t nmemb, void *stream) { - static size_t total=POSTLEN; + static size_t total = POSTLEN; static char buf[1024]; (void)stream; @@ -60,7 +60,7 @@ int test(char *URL) CURL *curl; CURLcode res = CURLE_FAILED_INIT; int i; - struct curl_slist *headerlist=NULL, *hl; + struct curl_slist *headerlist = NULL, *hl; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); @@ -77,7 +77,7 @@ int test(char *URL) for(i = 0; i < NUM_HEADERS; i++) { int len = snprintf(buf, sizeof(buf), "Header%d: ", i); memset(&buf[len], 'A', SIZE_HEADERS); - buf[len + SIZE_HEADERS]=0; /* zero terminate */ + buf[len + SIZE_HEADERS] = 0; /* zero terminate */ hl = curl_slist_append(headerlist, buf); if(!hl) goto test_cleanup; diff --git a/tests/libtest/lib554.c b/tests/libtest/lib554.c index 083746243..936d0a10a 100644 --- a/tests/libtest/lib554.c +++ b/tests/libtest/lib554.c @@ -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 @@ -67,11 +67,11 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp) static int once(char *URL, bool oldstyle) { CURL *curl; - CURLcode res=CURLE_OK; + CURLcode res = CURLE_OK; CURLFORMcode formrc; - struct curl_httppost *formpost=NULL; - struct curl_httppost *lastptr=NULL; + struct curl_httppost *formpost = NULL; + struct curl_httppost *lastptr = NULL; struct WriteThis pooh; struct WriteThis pooh2; diff --git a/tests/libtest/lib555.c b/tests/libtest/lib555.c index 8156a95e7..464f6e0b0 100644 --- a/tests/libtest/lib555.c +++ b/tests/libtest/lib555.c @@ -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 @@ -77,9 +77,9 @@ int test(char *URL) { int res = 0; CURL *curl = NULL; - int counter=0; + int counter = 0; CURLM *m = NULL; - int running=1; + int running = 1; start_test_timing(); diff --git a/tests/libtest/lib557.c b/tests/libtest/lib557.c index c718be4ee..df63d9c6b 100644 --- a/tests/libtest/lib557.c +++ b/tests/libtest/lib557.c @@ -129,7 +129,7 @@ static int test_unsigned_short_formatting(void) #if (SIZEOF_SHORT == 1) - i=1; us_test[i].num = 0xFFU; us_test[i].expected = "256"; + i = 1; us_test[i].num = 0xFFU; us_test[i].expected = "256"; i++; us_test[i].num = 0xF0U; us_test[i].expected = "240"; i++; us_test[i].num = 0x0FU; us_test[i].expected = "15"; @@ -146,7 +146,7 @@ static int test_unsigned_short_formatting(void) #elif (SIZEOF_SHORT == 2) - i=1; us_test[i].num = 0xFFFFU; us_test[i].expected = "65535"; + i = 1; us_test[i].num = 0xFFFFU; us_test[i].expected = "65535"; i++; us_test[i].num = 0xFF00U; us_test[i].expected = "65280"; i++; us_test[i].num = 0x00FFU; us_test[i].expected = "255"; @@ -167,7 +167,7 @@ static int test_unsigned_short_formatting(void) #elif (SIZEOF_SHORT == 4) - i=1; us_test[i].num = 0xFFFFFFFFU; us_test[i].expected = "4294967295"; + i = 1; us_test[i].num = 0xFFFFFFFFU; us_test[i].expected = "4294967295"; i++; us_test[i].num = 0xFFFF0000U; us_test[i].expected = "4294901760"; i++; us_test[i].num = 0x0000FFFFU; us_test[i].expected = "65535"; @@ -201,9 +201,9 @@ static int test_unsigned_short_formatting(void) #endif - for(i=1; i<=num_ushort_tests; i++) { + for(i = 1; i <= num_ushort_tests; i++) { - for(j=0; j<BUFSZ; j++) + for(j = 0; j<BUFSZ; j++) us_test[i].result[j] = 'X'; us_test[i].result[BUFSZ-1] = '\0'; @@ -236,7 +236,7 @@ static int test_signed_short_formatting(void) #if (SIZEOF_SHORT == 1) - i=1; ss_test[i].num = 0x7F; ss_test[i].expected = "127"; + i = 1; ss_test[i].num = 0x7F; ss_test[i].expected = "127"; i++; ss_test[i].num = 0x70; ss_test[i].expected = "112"; i++; ss_test[i].num = 0x07; ss_test[i].expected = "7"; @@ -261,7 +261,7 @@ static int test_signed_short_formatting(void) #elif (SIZEOF_SHORT == 2) - i=1; ss_test[i].num = 0x7FFF; ss_test[i].expected = "32767"; + i = 1; ss_test[i].num = 0x7FFF; ss_test[i].expected = "32767"; i++; ss_test[i].num = 0x7FFE; ss_test[i].expected = "32766"; i++; ss_test[i].num = 0x7FFD; ss_test[i].expected = "32765"; i++; ss_test[i].num = 0x7F00; ss_test[i].expected = "32512"; @@ -304,7 +304,7 @@ static int test_signed_short_formatting(void) #elif (SIZEOF_SHORT == 4) - i=1; ss_test[i].num = 0x7FFFFFFF; ss_test[i].expected = "2147483647"; + i = 1; ss_test[i].num = 0x7FFFFFFF; ss_test[i].expected = "2147483647"; i++; ss_test[i].num = 0x7FFFFFFE; ss_test[i].expected = "2147483646"; i++; ss_test[i].num = 0x7FFFFFFD; ss_test[i].expected = "2147483645"; i++; ss_test[i].num = 0x7FFF0000; ss_test[i].expected = "2147418112"; @@ -371,9 +371,9 @@ static int test_signed_short_formatting(void) #endif - for(i=1; i<=num_sshort_tests; i++) { + for(i = 1; i <= num_sshort_tests; i++) { - for(j=0; j<BUFSZ; j++) + for(j = 0; j<BUFSZ; j++) ss_test[i].result[j] = 'X'; ss_test[i].result[BUFSZ-1] = '\0'; @@ -406,7 +406,7 @@ static int test_unsigned_int_formatting(void) #if (SIZEOF_INT == 2) - i=1; ui_test[i].num = 0xFFFFU; ui_test[i].expected = "65535"; + i = 1; ui_test[i].num = 0xFFFFU; ui_test[i].expected = "65535"; i++; ui_test[i].num = 0xFF00U; ui_test[i].expected = "65280"; i++; ui_test[i].num = 0x00FFU; ui_test[i].expected = "255"; @@ -427,7 +427,7 @@ static int test_unsigned_int_formatting(void) #elif (SIZEOF_INT == 4) - i=1; ui_test[i].num = 0xFFFFFFFFU; ui_test[i].expected = "4294967295"; + i = 1; ui_test[i].num = 0xFFFFFFFFU; ui_test[i].expected = "4294967295"; i++; ui_test[i].num = 0xFFFF0000U; ui_test[i].expected = "4294901760"; i++; ui_test[i].num = 0x0000FFFFU; ui_test[i].expected = "65535"; @@ -462,7 +462,7 @@ static int test_unsigned_int_formatting(void) #elif (SIZEOF_INT == 8) /* !checksrc! disable LONGLINE all */ - i=1; ui_test[i].num = 0xFFFFFFFFFFFFFFFFU; ui_test[i].expected = "18446744073709551615"; + i = 1; ui_test[i].num = 0xFFFFFFFFFFFFFFFFU; ui_test[i].expected = "18446744073709551615"; i++; ui_test[i].num = 0xFFFFFFFF00000000U; ui_test[i].expected = "18446744069414584320"; i++; ui_test[i].num = 0x00000000FFFFFFFFU; ui_test[i].expected = "4294967295"; @@ -521,9 +521,9 @@ static int test_unsigned_int_formatting(void) #endif - for(i=1; i<=num_uint_tests; i++) { + for(i = 1; i <= num_uint_tests; i++) { - for(j=0; j<BUFSZ; j++) + for(j = 0; j<BUFSZ; j++) ui_test[i].result[j] = 'X'; ui_test[i].result[BUFSZ-1] = '\0'; @@ -556,7 +556,7 @@ static int test_signed_int_formatting(void) #if (SIZEOF_INT == 2) - i=1; si_test[i].num = 0x7FFF; si_test[i].expected = "32767"; + i = 1; si_test[i].num = 0x7FFF; si_test[i].expected = "32767"; i++; si_test[i].num = 0x7FFE; si_test[i].expected = "32766"; i++; si_test[i].num = 0x7FFD; si_test[i].expected = "32765"; i++; si_test[i].num = 0x7F00; si_test[i].expected = "32512"; @@ -599,7 +599,7 @@ static int test_signed_int_formatting(void) #elif (SIZEOF_INT == 4) - i=1; si_test[i].num = 0x7FFFFFFF; si_test[i].expected = "2147483647"; + i = 1; si_test[i].num = 0x7FFFFFFF; si_test[i].expected = "2147483647"; i++; si_test[i].num = 0x7FFFFFFE; si_test[i].expected = "2147483646"; i++; si_test[i].num = 0x7FFFFFFD; si_test[i].expected = "2147483645"; i++; si_test[i].num = 0x7FFF0000; si_test[i].expected = "2147418112"; @@ -666,7 +666,7 @@ static int test_signed_int_formatting(void) #elif (SIZEOF_INT == 8) - i=1; si_test[i].num = 0x7FFFFFFFFFFFFFFF; si_test[i].expected = "9223372036854775807"; + i = 1; si_test[i].num = 0x7FFFFFFFFFFFFFFF; si_test[i].expected = "9223372036854775807"; i++; si_test[i].num = 0x7FFFFFFFFFFFFFFE; si_test[i].expected = "9223372036854775806"; i++; si_test[i].num = 0x7FFFFFFFFFFFFFFD; si_test[i].expected = "9223372036854775805"; i++; si_test[i].num = 0x7FFFFFFF00000000; si_test[i].expected = "9223372032559808512"; @@ -749,9 +749,9 @@ static int test_signed_int_formatting(void) #endif - for(i=1; i<=num_sint_tests; i++) { + for(i = 1; i <= num_sint_tests; i++) { - for(j=0; j<BUFSZ; j++) + for(j = 0; j<BUFSZ; j++) si_test[i].result[j] = 'X'; si_test[i].result[BUFSZ-1] = '\0'; @@ -784,7 +784,7 @@ static int test_unsigned_long_formatting(void) #if (SIZEOF_LONG == 2) - i=1; ul_test[i].num = 0xFFFFUL; ul_test[i].expected = "65535"; + i = 1; ul_test[i].num = 0xFFFFUL; ul_test[i].expected = "65535"; i++; ul_test[i].num = 0xFF00UL; ul_test[i].expected = "65280"; i++; ul_test[i].num = 0x00FFUL; ul_test[i].expected = "255"; @@ -805,7 +805,7 @@ static int test_unsigned_long_formatting(void) #elif (SIZEOF_LONG == 4) - i=1; ul_test[i].num = 0xFFFFFFFFUL; ul_test[i].expected = "4294967295"; + i = 1; ul_test[i].num = 0xFFFFFFFFUL; ul_test[i].expected = "4294967295"; i++; ul_test[i].num = 0xFFFF0000UL; ul_test[i].expected = "4294901760"; i++; ul_test[i].num = 0x0000FFFFUL; ul_test[i].expected = "65535"; @@ -839,7 +839,7 @@ static int test_unsigned_long_formatting(void) #elif (SIZEOF_LONG == 8) - i=1; ul_test[i].num = 0xFFFFFFFFFFFFFFFFUL; ul_test[i].expected = "18446744073709551615"; + i = 1; ul_test[i].num = 0xFFFFFFFFFFFFFFFFUL; ul_test[i].expected = "18446744073709551615"; i++; ul_test[i].num = 0xFFFFFFFF00000000UL; ul_test[i].expected = "18446744069414584320"; i++; ul_test[i].num = 0x00000000FFFFFFFFUL; ul_test[i].expected = "4294967295"; @@ -898,9 +898,9 @@ static int test_unsigned_long_formatting(void) #endif - for(i=1; i<=num_ulong_tests; i++) { + for(i = 1; i <= num_ulong_tests; i++) { - for(j=0; j<BUFSZ; j++) + for(j = 0; j<BUFSZ; j++) ul_test[i].result[j] = 'X'; ul_test[i].result[BUFSZ-1] = '\0'; @@ -933,7 +933,7 @@ static int test_signed_long_formatting(void) #if (SIZEOF_LONG == 2) - i=1; sl_test[i].num = 0x7FFFL; sl_test[i].expected = "32767"; + i = 1; sl_test[i].num = 0x7FFFL; sl_test[i].expected = "32767"; i++; sl_test[i].num = 0x7FFEL; sl_test[i].expected = "32766"; i++; sl_test[i].num = 0x7FFDL; sl_test[i].expected = "32765"; i++; sl_test[i].num = 0x7F00L; sl_test[i].expected = "32512"; @@ -976,7 +976,7 @@ static int test_signed_long_formatting(void) #elif (SIZEOF_LONG == 4) - i=1; sl_test[i].num = 0x7FFFFFFFL; sl_test[i].expected = "2147483647"; + i = 1; sl_test[i].num = 0x7FFFFFFFL; sl_test[i].expected = "2147483647"; i++; sl_test[i].num = 0x7FFFFFFEL; sl_test[i].expected = "2147483646"; i++; sl_test[i].num = 0x7FFFFFFDL; sl_test[i].expected = "2147483645"; i++; sl_test[i].num = 0x7FFF0000L; sl_test[i].expected = "2147418112"; @@ -1043,7 +1043,7 @@ static int test_signed_long_formatting(void) #elif (SIZEOF_LONG == 8) - i=1; sl_test[i].num = 0x7FFFFFFFFFFFFFFFL; sl_test[i].expected = "9223372036854775807"; + i = 1; sl_test[i].num = 0x7FFFFFFFFFFFFFFFL; sl_test[i].expected = "9223372036854775807"; i++; sl_test[i].num = 0x7FFFFFFFFFFFFFFEL; sl_test[i].expected = "9223372036854775806"; i++; sl_test[i].num = 0x7FFFFFFFFFFFFFFDL; sl_test[i].expected = "9223372036854775805"; i++; sl_test[i].num = 0x7FFFFFFF00000000L; sl_test[i].expected = "9223372032559808512"; @@ -1126,9 +1126,9 @@ static int test_signed_long_formatting(void) #endif - for(i=1; i<=num_slong_tests; i++) { + for(i = 1; i <= num_slong_tests; i++) { - for(j=0; j<BUFSZ; j++) + for(j = 0; j<BUFSZ; j++) sl_test[i].result[j] = 'X'; sl_test[i].result[BUFSZ-1] = '\0'; @@ -1161,7 +1161,7 @@ static int test_curl_off_t_formatting(void) #if (SIZEOF_CURL_OFF_T == 2) - i=1; co_test[i].num = MPRNT_OFF_T_C(0x7FFF); co_test[i].expected = "32767"; + i = 1; co_test[i].num = MPRNT_OFF_T_C(0x7FFF); co_test[i].expected = "32767"; i++; co_test[i].num = MPRNT_OFF_T_C(0x7FFE); co_test[i].expected = "32766"; i++; co_test[i].num = MPRNT_OFF_T_C(0x7FFD); co_test[i].expected = "32765"; i++; co_test[i].num = MPRNT_OFF_T_C(0x7F00); co_test[i].expected = "32512"; @@ -1204,7 +1204,7 @@ static int test_curl_off_t_formatting(void) #elif (SIZEOF_CURL_OFF_T == 4) - i=1; co_test[i].num = MPRNT_OFF_T_C(0x7FFFFFFF); co_test[i].expected = "2147483647"; + i = 1; co_test[i].num = MPRNT_OFF_T_C(0x7FFFFFFF); co_test[i].expected = "2147483647"; i++; co_test[i].num = MPRNT_OFF_T_C(0x7FFFFFFE); co_test[i].expected = "2147483646"; i++; co_test[i].num = MPRNT_OFF_T_C(0x7FFFFFFD); co_test[i].expected = "2147483645"; i++; co_test[i].num = MPRNT_OFF_T_C(0x7FFF0000); co_test[i].expected = "2147418112"; @@ -1271,7 +1271,7 @@ static int test_curl_off_t_formatting(void) #elif (SIZEOF_CURL_OFF_T == 8) - i=1; co_test[i].num = MPRNT_OFF_T_C(0x7FFFFFFFFFFFFFFF); co_test[i].expected = "9223372036854775807"; + i = 1; co_test[i].num = MPRNT_OFF_T_C(0x7FFFFFFFFFFFFFFF); co_test[i].expected = "9223372036854775807"; i++; co_test[i].num = MPRNT_OFF_T_C(0x7FFFFFFFFFFFFFFE); co_test[i].expected = "9223372036854775806"; i++; co_test[i].num = MPRNT_OFF_T_C(0x7FFFFFFFFFFFFFFD); co_test[i].expected = "9223372036854775805"; i++; co_test[i].num = MPRNT_OFF_T_C(0x7FFFFFFF00000000); co_test[i].expected = "9223372032559808512"; @@ -1354,9 +1354,9 @@ static int test_curl_off_t_formatting(void) #endif - for(i=1; i<=num_cofft_tests; i++) { + for(i = 1; i <= num_cofft_tests; i++) { - for(j=0; j<BUFSZ; j++) + for(j = 0; j<BUFSZ; j++) co_test[i].result[j] = 'X'; co_test[i].result[BUFSZ-1] = '\0'; diff --git a/tests/libtest/lib567.c b/tests/libtest/lib567.c index f9f55e3c0..64fb29afb 100644 --- a/tests/libtest/lib567.c +++ b/tests/libtest/lib567.c @@ -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 @@ -30,7 +30,7 @@ int test(char *URL) { CURLcode res; CURL *curl; - struct curl_slist *custom_headers=NULL; + struct curl_slist *custom_headers = NULL; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); diff --git a/tests/libtest/lib568.c b/tests/libtest/lib568.c index 0cdef812b..3bb53f61e 100644 --- a/tests/libtest/lib568.c +++ b/tests/libtest/lib568.c @@ -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 @@ -47,8 +47,8 @@ int test(char *URL) FILE *sdpf = NULL; struct_stat file_info; char *stream_uri = NULL; - int request=1; - struct curl_slist *custom_headers=NULL; + int request = 1; + struct curl_slist *custom_headers = NULL; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); diff --git a/tests/libtest/lib569.c b/tests/libtest/lib569.c index d7381d9a2..c18c882b9 100644 --- a/tests/libtest/lib569.c +++ b/tests/libtest/lib569.c @@ -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 @@ -37,7 +37,7 @@ int test(char *URL) CURL *curl; char *stream_uri = NULL; char *rtsp_session_id; - int request=1; + int request = 1; int i; FILE *idfile = NULL; diff --git a/tests/libtest/lib570.c b/tests/libtest/lib570.c index 9d9b5a134..1756a8615 100644 --- a/tests/libtest/lib570.c +++ b/tests/libtest/lib570.c @@ -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 @@ -32,7 +32,7 @@ int test(char *URL) { int res; CURL *curl; - int request=1; + int request = 1; char *stream_uri = NULL; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { diff --git a/tests/libtest/lib571.c b/tests/libtest/lib571.c index f19b643ff..21aa267b7 100644 --- a/tests/libtest/lib571.c +++ b/tests/libtest/lib571.c @@ -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 @@ -103,7 +103,7 @@ int test(char *URL) int res; CURL *curl; char *stream_uri = NULL; - int request=1; + int request = 1; FILE *protofile = NULL; protofile = fopen(libtest_arg2, "wb"); diff --git a/tests/libtest/lib572.c b/tests/libtest/lib572.c index 47a9da535..a78c9358d 100644 --- a/tests/libtest/lib572.c +++ b/tests/libtest/lib572.c @@ -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 @@ -47,8 +47,8 @@ int test(char *URL) FILE *paramsf = NULL; struct_stat file_info; char *stream_uri = NULL; - int request=1; - struct curl_slist *custom_headers=NULL; + int request = 1; + struct curl_slist *custom_headers = NULL; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); diff --git a/tests/libtest/lib578.c b/tests/libtest/lib578.c index 41b23db34..1b4ee526c 100644 --- a/tests/libtest/lib578.c +++ b/tests/libtest/lib578.c @@ -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 @@ -51,7 +51,7 @@ static int progress_callback(void *clientp, double dltotal, double dlnow, int test(char *URL) { CURL *curl; - CURLcode res=CURLE_OK; + CURLcode res = CURLE_OK; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); diff --git a/tests/libtest/lib579.c b/tests/libtest/lib579.c index 61aa4f5df..cba4b1cb4 100644 --- a/tests/libtest/lib579.c +++ b/tests/libtest/lib579.c @@ -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 size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp) int test(char *URL) { CURL *curl; - CURLcode res=CURLE_OK; + CURLcode res = CURLE_OK; struct curl_slist *slist = NULL; struct WriteThis pooh; pooh.counter = 0; diff --git a/tests/libtest/lib586.c b/tests/libtest/lib586.c index 859ef3430..669f71c15 100644 --- a/tests/libtest/lib586.c +++ b/tests/libtest/lib586.c @@ -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 @@ static void *fire(void *ptr) CURLcode code; struct Tdata *tdata = (struct Tdata*)ptr; CURL *curl; - int i=0; + int i = 0; curl = curl_easy_init(); if(!curl) { @@ -185,7 +185,7 @@ int test(char *URL) res = 0; /* start treads */ - for(i=1; i<=THREADS; i++) { + for(i = 1; i <= THREADS; i++) { /* set thread data */ tdata.url = URL; @@ -218,7 +218,7 @@ int test(char *URL) /* try to free share, expect to fail because share is in use*/ printf("try SHARE_CLEANUP...\n"); scode = curl_share_cleanup(share); - if(scode==CURLSHE_OK) { + if(scode == CURLSHE_OK) { fprintf(stderr, "curl_share_cleanup succeed but error expected\n"); share = NULL; } @@ -235,7 +235,7 @@ test_cleanup: /* free share */ printf("SHARE_CLEANUP\n"); scode = curl_share_cleanup(share); - if(scode!=CURLSHE_OK) + if(scode != CURLSHE_OK) fprintf(stderr, "curl_share_cleanup failed, code errno %d\n", (int)scode); diff --git a/tests/libtest/lib589.c b/tests/libtest/lib589.c index 1e5ebb1e4..667459d0d 100644 --- a/tests/libtest/lib589.c +++ b/tests/libtest/lib589.c @@ -26,7 +26,7 @@ int test(char *URL) { CURL *curl; - CURLcode res=CURLE_OK; + CURLcode res = CURLE_OK; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); diff --git a/tests/libtest/lib599.c b/tests/libtest/lib599.c index 843fb2121..0e05977b5 100644 --- a/tests/libtest/lib599.c +++ b/tests/libtest/lib599.c @@ -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 @@ -42,7 +42,7 @@ static int progress_callback(void *clientp, double dltotal, int test(char *URL) { CURL *curl; - CURLcode res=CURLE_OK; + CURLcode res = CURLE_OK; double content_length = 0.0; if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { diff --git a/tests/libtest/mk-lib1521.pl b/tests/libtest/mk-lib1521.pl index fe7e65d7a..6ded47220 100644 --- a/tests/libtest/mk-lib1521.pl +++ b/tests/libtest/mk-lib1521.pl @@ -143,9 +143,9 @@ int test(char *URL) void *conv_to_network_cb = NULL; void *conv_from_utf8_cb = NULL; void *interleavecb = NULL; - char *stringpointerextra=(char *)"moooo"; - struct curl_slist *slist=NULL; - struct curl_httppost *httppost=NULL; + char *stringpointerextra = (char *)"moooo"; + struct curl_slist *slist = NULL; + struct curl_httppost *httppost = NULL; curl_mime *mimepost = NULL; FILE *stream = stderr; struct data object; diff --git a/tests/server/fake_ntlm.c b/tests/server/fake_ntlm.c index 0d1b3e1b6..2d547ffae 100644 --- a/tests/server/fake_ntlm.c +++ b/tests/server/fake_ntlm.c @@ -78,7 +78,7 @@ static char *printable(char *inbuf, size_t inlength) return outbuf; } - for(i=0; i<inlength; i++) { + for(i = 0; i<inlength; i++) { if(o > outsize - (HEX_STR_LEN + 1)) { newsize = outsize + outincr; @@ -186,7 +186,7 @@ int main(int argc, char *argv[]) } filename = test2file(testnum); - stream=fopen(filename, "rb"); + stream = fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); @@ -204,7 +204,7 @@ int main(int argc, char *argv[]) } } - stream=fopen(filename, "rb"); + stream = fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); @@ -224,7 +224,7 @@ int main(int argc, char *argv[]) while(fgets(buf, sizeof(buf), stdin)) { if(strcmp(buf, type1_input) == 0) { - stream=fopen(filename, "rb"); + stream = fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); @@ -246,7 +246,7 @@ int main(int argc, char *argv[]) fflush(stdout); } else if(strncmp(buf, type3_input, strlen(type3_input)) == 0) { - stream=fopen(filename, "rb"); + stream = fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); diff --git a/tests/server/resolve.c b/tests/server/resolve.c index 34f14e066..4cbdba6ec 100644 --- a/tests/server/resolve.c +++ b/tests/server/resolve.c @@ -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 @@ -57,11 +57,11 @@ static bool use_ipv6 = FALSE; static const char *ipv_inuse = "IPv4"; -const char *serverlogfile=""; /* for a util.c function we don't use */ +const char *serverlogfile = ""; /* for a util.c function we don't use */ int main(int argc, char *argv[]) { - int arg=1; + int arg = 1; const char *host = NULL; int rc = 0; diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c index 120d65d52..8f004e120 100644 --- a/tests/server/rtspd.c +++ b/tests/server/rtspd.c @@ -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,11 +70,11 @@ static int serverlogslocked = 0; #define REQBUFSIZ 150000 #define REQBUFSIZ_TXT "149999" -static long prevtestno=-1; /* previous test number we served */ -static long prevpartno=-1; /* previous part number we served */ -static bool prevbounce=FALSE; /* instructs the server to increase the part - number for a test in case the identical - testno+partno request shows up again */ +static long prevtestno = -1; /* previous test number we served */ +static long prevpartno = -1; /* previous part number we served */ +static bool prevbounce = FALSE; /* instructs the server to increase the part + number for a test in case the identical + testno+partno request shows up again */ #define RCMD_NORMALREQ 0 /* default request, use the tests file normally */ #define RCMD_IDLE 1 /* told to sit idle */ @@ -156,7 +156,7 @@ enum { DOCNUMBER_NOTHING = -7, DOCNUMBER_QUIT = -6, DOCNUMBER_BADCONNECT = -5, - DOCNUMBER_INTERNAL= -4, + DOCNUMBER_INTERNAL = -4, DOCNUMBER_CONNECT = -3, DOCNUMBER_WERULEZ = -2, DOCNUMBER_404 = -1 @@ -332,7 +332,7 @@ static void restore_signal_handlers(void) static int ProcessRequest(struct httprequest *req) { - char *line=&req->reqbuf[req->checkindex]; + char *line = &req->reqbuf[req->checkindex]; bool chunked = FALSE; static char request[REQUEST_KEYWORD_SIZE]; static char doc[MAXDOCNAMELEN]; @@ -421,7 +421,7 @@ static int ProcessRequest(struct httprequest *req) filename = test2file(req->testno); - stream=fopen(filename, "rb"); + stream = fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); @@ -433,7 +433,7 @@ static int ProcessRequest(struct httprequest *req) else { char *cmd = NULL; size_t cmdsize = 0; - int num=0; + int num = 0; int rtp_channel = 0; int rtp_size = 0; @@ -596,7 +596,7 @@ static int ProcessRequest(struct httprequest *req) if(got_exit_signal) return 1; /* done */ - if((req->cl==0) && strncasecompare("Content-Length:", line, 15)) { + if((req->cl == 0) && strncasecompare("Content-Length:", line, 15)) { /* If we don't ignore content-length, we read it and we read the whole request including the body before we return. If we've been told to ignore the content-length, we will return as soon as all headers @@ -896,10 +896,10 @@ static int send_doc(curl_socket_t sock, struct httprequest *req) ssize_t written; size_t count; const char *buffer; - char *ptr=NULL; + char *ptr = NULL; FILE *stream; - char *cmd=NULL; - size_t cmdsize=0; + char *cmd = NULL; + size_t cmdsize = 0; FILE *dump; bool persistant = TRUE; bool sendfailure = FALSE; @@ -988,7 +988,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req) if(0 != req->partno) snprintf(partbuf, sizeof(partbuf), "data%ld", req->partno); - stream=fopen(filename, "rb"); + stream = fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); @@ -1012,7 +1012,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req) } /* re-open the same file again */ - stream=fopen(filename, "rb"); + stream = fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); @@ -1140,7 +1140,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req) char command[32]; int quarters; int num; - ptr=cmd; + ptr = cmd; do { if(2 == sscanf(ptr, "%31s %d", command, &num)) { if(!strcmp("wait", command)) { @@ -1194,7 +1194,7 @@ int main(int argc, char *argv[]) struct httprequest req; int rc; int error; - int arg=1; + int arg = 1; long pid; memset(&req, 0, sizeof(req)); diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index 6695d8486..f13ef208d 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -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 @@ -478,26 +478,26 @@ static void lograw(unsigned char *buffer, ssize_t len) ssize_t i; unsigned char *ptr = buffer; char *optr = data; - ssize_t width=0; + ssize_t width = 0; int left = sizeof(data); - for(i=0; i<len; i++) { + for(i = 0; i<len; i++) { switch(ptr[i]) { case '\n': snprintf(optr, left, "\\n"); width += 2; optr += 2; - left-=2; + left -= 2; break; case '\r': snprintf(optr, left, "\\r"); width += 2; optr += 2; - left-=2; + left -= 2; break; default: snprintf(optr, left, "%c", (ISGRAPH(ptr[i]) || - ptr[i]==0x20) ?ptr[i]:'.'); + ptr[i] == 0x20) ?ptr[i]:'.'); width++; optr++; left--; @@ -1200,7 +1200,7 @@ static curl_socket_t sockdaemon(curl_socket_t sock, int rc; int totdelay = 0; int maxretr = 10; - int delay= 20; + int delay = 20; int attempt = 0; int error = 0; @@ -1343,7 +1343,7 @@ int main(int argc, char *argv[]) bool juggle_again; int rc; int error; - int arg=1; + int arg = 1; enum sockmode mode = PASSIVE_LISTEN; /* default */ const char *addr = NULL; diff --git a/tests/server/sws.c b/tests/server/sws.c index bff30f212..5fcd6732b 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -81,11 +81,11 @@ static bool is_proxy = FALSE; #define REQBUFSIZ 150000 #define REQBUFSIZ_TXT "149999" -static long prevtestno=-1; /* previous test number we served */ -static long prevpartno=-1; /* previous part number we served */ -static bool prevbounce=FALSE; /* instructs the server to increase the part - number for a test in case the identical - testno+partno request shows up again */ +static long prevtestno = -1; /* previous test number we served */ +static long prevpartno = -1; /* previous part number we served */ +static bool prevbounce = FALSE; /* instructs the server to increase the part + number for a test in case the identical + testno+partno request shows up again */ #define RCMD_NORMALREQ 0 /* default request, use the tests file normally */ #define RCMD_IDLE 1 /* told to sit idle */ @@ -359,7 +359,7 @@ static int parse_servercmd(struct httprequest *req) filename = test2file(req->testno); - stream=fopen(filename, "rb"); + stream = fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); @@ -372,7 +372,7 @@ static int parse_servercmd(struct httprequest *req) char *orgcmd = NULL; char *cmd = NULL; size_t cmdsize = 0; - int num=0; + int num = 0; /* get the custom server control "commands" */ error = getpart(&orgcmd, &cmdsize, "reply", "servercmd", stream); @@ -456,7 +456,7 @@ static int parse_servercmd(struct httprequest *req) static int ProcessRequest(struct httprequest *req) { - char *line=&req->reqbuf[req->checkindex]; + char *line = &req->reqbuf[req->checkindex]; bool chunked = FALSE; static char request[REQUEST_KEYWORD_SIZE]; static char doc[MAXDOCNAMELEN]; @@ -552,7 +552,7 @@ static int ProcessRequest(struct httprequest *req) if(sscanf(req->reqbuf, "CONNECT %" MAXDOCNAMELEN_TXT "s HTTP/%d.%d", doc, &prot_major, &prot_minor) == 3) { char *portp = NULL; - unsigned long part=0; + unsigned long part = 0; snprintf(logbuf, sizeof(logbuf), "Received a CONNECT %s HTTP/%d.%d request", @@ -711,7 +711,7 @@ static int ProcessRequest(struct httprequest *req) if(got_exit_signal) return 1; /* done */ - if((req->cl==0) && strncasecompare("Content-Length:", line, 15)) { + if((req->cl == 0) && strncasecompare("Content-Length:", line, 15)) { /* If we don't ignore content-length, we read it and we read the whole request including the body before we return. If we've been told to ignore the content-length, we will return as soon as all headers @@ -858,7 +858,7 @@ static void storerequest(const char *reqbuf, size_t totalsize) size_t written; size_t writeleft; FILE *dump; - const char *dumpfile=is_proxy?REQUEST_PROXY_DUMP:REQUEST_DUMP; + const char *dumpfile = is_proxy?REQUEST_PROXY_DUMP:REQUEST_DUMP; if(reqbuf == NULL) return; @@ -1044,10 +1044,10 @@ static int send_doc(curl_socket_t sock, struct httprequest *req) ssize_t written; size_t count; const char *buffer; - char *ptr=NULL; + char *ptr = NULL; FILE *stream; - char *cmd=NULL; - size_t cmdsize=0; + char *cmd = NULL; + size_t cmdsize = 0; FILE *dump; bool persistant = TRUE; bool sendfailure = FALSE; @@ -1118,7 +1118,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req) /* select the <data> tag for "normal" requests and the <connect> one for CONNECT requests (within the <reply> section) */ - const char *section= req->connect_request?"connect":"data"; + const char *section = req->connect_request?"connect":"data"; if(req->partno) snprintf(partbuf, sizeof(partbuf), "%s%ld", section, req->partno); @@ -1127,7 +1127,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req) logmsg("Send response test%ld section <%s>", req->testno, partbuf); - stream=fopen(filename, "rb"); + stream = fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); @@ -1150,7 +1150,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req) } /* re-open the same file again */ - stream=fopen(filename, "rb"); + stream = fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); @@ -1266,7 +1266,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req) char command[32]; int quarters; int num; - ptr=cmd; + ptr = cmd; do { if(2 == sscanf(ptr, "%31s %d", command, &num)) { if(!strcmp("wait", command)) { @@ -1436,7 +1436,7 @@ static void http_connect(curl_socket_t *infdp, int max_tunnel_idx; /* CTRL or DATA */ int loop; int i; - int timeout_count=0; + int timeout_count = 0; /* primary tunnel client endpoint already connected */ clientfd[CTRL] = *infdp; @@ -1526,7 +1526,7 @@ static void http_connect(curl_socket_t *infdp, if(rc > 0) { /* socket action */ bool tcp_fin_wr; - timeout_count=0; + timeout_count = 0; if(got_exit_signal) break; @@ -1974,7 +1974,7 @@ int main(int argc, char *argv[]) struct httprequest req; int rc = 0; int error; - int arg=1; + int arg = 1; long pid; const char *connecthost = "127.0.0.1"; const char *socket_type = "IPv4"; @@ -2319,7 +2319,7 @@ int main(int argc, char *argv[]) logmsg("====> Client disconnect %d", req.connmon); if(req.connmon) { - const char *keepopen="[DISCONNECT]\n"; + const char *keepopen = "[DISCONNECT]\n"; storerequest(keepopen, strlen(keepopen)); } diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index df01eb782..1932ea411 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -515,7 +515,7 @@ static void read_ahead(struct testcase *test, } else { if(test->rcount) { - c=test->rptr[0]; + c = test->rptr[0]; test->rptr++; test->rcount--; } @@ -571,9 +571,9 @@ static ssize_t write_behind(struct testcase *test, int convert) char outfile[256]; snprintf(outfile, sizeof(outfile), "log/upload.%ld", test->testno); #ifdef WIN32 - test->ofile=open(outfile, O_CREAT|O_RDWR|O_BINARY, 0777); + test->ofile = open(outfile, O_CREAT|O_RDWR|O_BINARY, 0777); #else - test->ofile=open(outfile, O_CREAT|O_RDWR, 0777); + test->ofile = open(outfile, O_CREAT|O_RDWR, 0777); #endif if(test->ofile == -1) { logmsg("Couldn't create and/or open file %s for upload!", outfile); @@ -1074,7 +1074,7 @@ static int parse_servercmd(struct testcase *req) filename = test2file(req->testno); - stream=fopen(filename, "rb"); + stream = fopen(filename, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); @@ -1086,7 +1086,7 @@ static int parse_servercmd(struct testcase *req) char *orgcmd = NULL; char *cmd = NULL; size_t cmdsize = 0; - int num=0; + int num = 0; /* get the custom server control "commands" */ error = getpart(&orgcmd, &cmdsize, "reply", "servercmd", stream); @@ -1192,7 +1192,7 @@ static int validate_access(struct testcase *test, snprintf(partbuf, sizeof(partbuf), "data%ld", partno); if(file) { - FILE *stream=fopen(file, "rb"); + FILE *stream = fopen(file, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); diff --git a/tests/server/util.c b/tests/server/util.c index 42e585349..1bbd89a3c 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -81,15 +81,15 @@ char *data_to_hex(char *data, size_t len) if(len > 255) len = 255; - for(i=0; i < len; i++) { + for(i = 0; i < len; i++) { if((data[i] >= 0x20) && (data[i] < 0x7f)) *optr++ = *iptr++; else { snprintf(optr, 4, "%%%02x", *iptr++); - optr+=3; + optr += 3; } } - *optr=0; /* in case no sprintf was used */ + *optr = 0; /* in case no sprintf was used */ return buf; } @@ -189,7 +189,7 @@ void win32_cleanup(void) #endif /* USE_WINSOCK */ /* set by the main code to point to where the test dir is */ -const char *path="."; +const char *path = "."; char *test2file(long testno) { diff --git a/tests/unit/unit1300.c b/tests/unit/unit1300.c index 8ec32a8c9..c64fadef9 100644 --- a/tests/unit/unit1300.c +++ b/tests/unit/unit1300.c @@ -145,7 +145,7 @@ UNITTEST_START * 3: "new" head's previous will be NULL */ - head=llist.head; + head = llist.head; abort_unless(head, "llist.head is NULL"); element_next = head->next; llist_size = Curl_llist_count(&llist); diff --git a/tests/unit/unit1303.c b/tests/unit/unit1303.c index 13fb0e05c..75a8e59c2 100644 --- a/tests/unit/unit1303.c +++ b/tests/unit/unit1303.c @@ -138,7 +138,7 @@ UNITTEST_START data->progress.t_startop.tv_sec = BASE; data->progress.t_startop.tv_usec = 0; - for(i=0; i < sizeof(run)/sizeof(run[0]); i++) { + 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); diff --git a/tests/unit/unit1309.c b/tests/unit/unit1309.c index 9d1e70d27..cb533e70b 100644 --- a/tests/unit/unit1309.c +++ b/tests/unit/unit1309.c @@ -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 @@ -43,7 +43,7 @@ static void splayprint(struct Curl_tree * t, int d, char output) return; splayprint(t->larger, d+1, output); - for(i=0; i<d; i++) + for(i = 0; i<d; i++) if(output) printf(" "); @@ -52,7 +52,7 @@ static void splayprint(struct Curl_tree * t, int d, char output) (long)t->key.tv_usec, i); } - for(count=0, node = t->samen; node != t; node = node->samen, count++) + for(count = 0, node = t->samen; node != t; node = node->samen, count++) ; if(output) { diff --git a/tests/unit/unit1323.c b/tests/unit/unit1323.c index 65dd3d287..7bb4cca40 100644 --- a/tests/unit/unit1323.c +++ b/tests/unit/unit1323.c @@ -49,7 +49,7 @@ UNITTEST_START }; size_t i; - for(i=0; i < sizeof(tests)/sizeof(tests[0]); i++) { + for(i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) { time_t result = curlx_tvdiff(tests[i].first, tests[i].second); if(result != tests[i].result) { printf("%d.%06u to %d.%06u got %d, but expected %d\n", diff --git a/tests/unit/unit1395.c b/tests/unit/unit1395.c index 13ea97bc4..527f28142 100644 --- a/tests/unit/unit1395.c +++ b/tests/unit/unit1395.c @@ -43,7 +43,7 @@ struct dotdot { UNITTEST_START unsigned int i; - int fails=0; + int fails = 0; const struct dotdot pairs[] = { { "/a/b/c/./../../g", "/a/g" }, { "mid/content=5/../6", "mid/6" }, @@ -74,7 +74,7 @@ UNITTEST_START { ".", "" }, }; - for(i=0; i < sizeof(pairs)/sizeof(pairs[0]); i++) { + for(i = 0; i < sizeof(pairs)/sizeof(pairs[0]); i++) { char *out = Curl_dedotdotify(pairs[i].input); abort_unless(out != NULL, "returned NULL!"); diff --git a/tests/unit/unit1396.c b/tests/unit/unit1396.c index 9fba1f634..4dd25b40d 100644 --- a/tests/unit/unit1396.c +++ b/tests/unit/unit1396.c @@ -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 @@ -81,7 +81,7 @@ UNITTEST_START hnd = curl_easy_init(); abort_unless(hnd != NULL, "returned NULL!"); - for(i=0; list1[i].in; i++) { + for(i = 0; list1[i].in; i++) { int outlen; char *out = curl_easy_unescape(hnd, list1[i].in, list1[i].inlen, @@ -97,7 +97,7 @@ UNITTEST_START curl_free(out); } - for(i=0; list2[i].in; i++) { + for(i = 0; list2[i].in; i++) { int outlen; char *out = curl_easy_escape(hnd, list2[i].in, list2[i].inlen); abort_unless(out != NULL, "returned NULL!"); diff --git a/tests/unit/unit1398.c b/tests/unit/unit1398.c index 9491c46c5..b7260195a 100644 --- a/tests/unit/unit1398.c +++ b/tests/unit/unit1398.c @@ -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 @@ -30,7 +30,7 @@ UNITTEST_START int rc; char buf[3] = {'b', 'u', 'g'}; -const char *str="bug"; +const char *str = "bug"; int width = 3; char output[24]; |