]> granicus.if.org Git - curl/commitdiff
tests: declare TU-local variables static
authorMarcel Raad <raad@teamviewer.com>
Mon, 1 May 2017 10:55:09 +0000 (12:55 +0200)
committerMarcel Raad <raad@teamviewer.com>
Mon, 1 May 2017 10:55:09 +0000 (12:55 +0200)
This fixes missing-variable-declarations warnings when building with
clang.

tests/libtest/lib1509.c
tests/libtest/lib1531.c
tests/libtest/lib1900.c
tests/libtest/lib509.c
tests/libtest/lib540.c
tests/unit/unit1396.c
tests/unit/unit1600.c

index df428a0d00a0fd0a0b27aff9facc3a90d0c7a794..ccb668304efbf0fc5460add554720244b96a34d4 100644 (file)
@@ -28,7 +28,7 @@
 size_t WriteOutput(void *ptr, size_t size, size_t nmemb, void *stream);
 size_t WriteHeader(void *ptr, size_t size, size_t nmemb, void *stream);
 
-unsigned long realHeaderSize = 0;
+static unsigned long realHeaderSize = 0;
 
 int test(char *URL)
 {
index b21d06733dab2590e21000f8830df2ef948ae79c..e6386b2646f4d5a129d391cfc5ea58cd7b80a9eb 100644 (file)
@@ -27,8 +27,8 @@
 
 #define TEST_HANG_TIMEOUT 60 * 1000
 
-char const testData[] = ".abc\0xyz";
-off_t const testDataSize = sizeof(testData) - 1;
+static char const testData[] = ".abc\0xyz";
+static off_t const testDataSize = sizeof(testData) - 1;
 
 int test(char *URL)
 {
index 4502fc0d668efaf436df31b9430f3ba4e41f384b..d72e3e6a2d96d614e796e99fffc75dce47921683 100644 (file)
 #define MAX_URLS 200
 #define MAX_BLACKLIST 20
 
-int urltime[MAX_URLS];
-char *urlstring[MAX_URLS];
-CURL *handles[MAX_URLS];
-char *site_blacklist[MAX_BLACKLIST];
-char *server_blacklist[MAX_BLACKLIST];
-int num_handles;
-int blacklist_num_servers;
-int blacklist_num_sites;
+static int urltime[MAX_URLS];
+static char *urlstring[MAX_URLS];
+static CURL *handles[MAX_URLS];
+static char *site_blacklist[MAX_BLACKLIST];
+static char *server_blacklist[MAX_BLACKLIST];
+static int num_handles;
+static int blacklist_num_servers;
+static int blacklist_num_sites;
 
 static size_t
 write_callback(void *contents, size_t size, size_t nmemb, void *userp)
index 941ef720638d0124d9f021c27aa9891e0dd45d16..4f3e072aeec004b55c3d0e122901541c0eeacb2c 100644 (file)
 #include "memdebug.h"
 */
 
-int seen_malloc = 0;
-int seen_free = 0;
-int seen_realloc = 0;
-int seen_strdup = 0;
-int seen_calloc = 0;
+static int seen_malloc = 0;
+static int seen_free = 0;
+static int seen_realloc = 0;
+static int seen_strdup = 0;
+static int seen_calloc = 0;
 
 void *custom_malloc(size_t size);
 void custom_free(void *ptr);
index f5d89c41d2739c6d273eaa7e9c084fc26f655161..ac862092f22e579f45a63f72eb887ba313b6ab84 100644 (file)
@@ -46,7 +46,7 @@
 
 #define NUM_HANDLES 2
 
-CURL *eh[NUM_HANDLES];
+static CURL *eh[NUM_HANDLES];
 
 static int init(int num, CURLM *cm, const char *url, const char *userpwd,
                 struct curl_slist *headers)
index 84a5162dd830c45ab904cdb8fdbc844a1ac360a2..f3275fdb6926ea5a031a7a57362d6db69577eaa2 100644 (file)
@@ -21,7 +21,7 @@
  ***************************************************************************/
 #include "curlcheck.h"
 
-CURL *hnd;
+static CURL *hnd;
 
 static CURLcode unit_setup(void)
 {
index af0ad8435af50cc29c7915038eb2eca3939e03de..11d718d3543df24b728249ffebc1750b41edd41f 100644 (file)
@@ -24,7 +24,7 @@
 #include "urldata.h"
 #include "curl_ntlm_core.h"
 
-CURL *easy;
+static CURL *easy;
 
 static CURLcode unit_setup(void)
 {