From c23177d5e90aec2ec42bd20004d0acf0a6412456 Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Sun, 30 Apr 2017 23:29:31 +0200 Subject: examples: declare TU-local variables static This fixes missing-variable-declarations warnings when building with clang. --- docs/examples/fopen.c | 2 +- docs/examples/ftpuploadfrommem.c | 2 +- docs/examples/http2-download.c | 4 ++-- docs/examples/http2-upload.c | 6 +++--- docs/examples/post-callback.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) (limited to 'docs/examples') diff --git a/docs/examples/fopen.c b/docs/examples/fopen.c index 95dd4ce9a..1e0a09a0a 100644 --- a/docs/examples/fopen.c +++ b/docs/examples/fopen.c @@ -88,7 +88,7 @@ char *url_fgets(char *ptr, size_t size, URL_FILE *file); void url_rewind(URL_FILE *file); /* we use a global one for convenience */ -CURLM *multi_handle; +static CURLM *multi_handle; /* curl calls this routine to get more data */ static size_t write_callback(char *buffer, diff --git a/docs/examples/ftpuploadfrommem.c b/docs/examples/ftpuploadfrommem.c index 577d15c1d..dec7bbbbe 100644 --- a/docs/examples/ftpuploadfrommem.c +++ b/docs/examples/ftpuploadfrommem.c @@ -27,7 +27,7 @@ #include #include -const char data[]= +static const char data[]= "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " "Nam rhoncus odio id venenatis volutpat. Vestibulum dapibus " "bibendum ullamcorper. Maecenas finibus elit augue, vel " diff --git a/docs/examples/http2-download.c b/docs/examples/http2-download.c index 0cf83f524..8c0b0876e 100644 --- a/docs/examples/http2-download.c +++ b/docs/examples/http2-download.c @@ -43,8 +43,8 @@ #define NUM_HANDLES 1000 -void *curl_hnd[NUM_HANDLES]; -int num_transfers; +static void *curl_hnd[NUM_HANDLES]; +static int num_transfers; /* a handle to number lookup, highly ineffective when we do many transfers... */ diff --git a/docs/examples/http2-upload.c b/docs/examples/http2-upload.c index aa0ac4458..01dfc0b3d 100644 --- a/docs/examples/http2-upload.c +++ b/docs/examples/http2-upload.c @@ -45,8 +45,8 @@ #define NUM_HANDLES 1000 -void *curl_hnd[NUM_HANDLES]; -int num_transfers; +static void *curl_hnd[NUM_HANDLES]; +static int num_transfers; /* a handle to number lookup, highly ineffective when we do many transfers... */ @@ -177,7 +177,7 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp) return retcode; } -struct input indata[NUM_HANDLES]; +static struct input indata[NUM_HANDLES]; static void setup(CURL *hnd, int num, const char *upload) { diff --git a/docs/examples/post-callback.c b/docs/examples/post-callback.c index f4cd50c0b..dbf249140 100644 --- a/docs/examples/post-callback.c +++ b/docs/examples/post-callback.c @@ -28,7 +28,7 @@ #include #include -const char data[]="this is what we post to the silly web server"; +static const char data[]="this is what we post to the silly web server"; struct WriteThis { const char *readptr; -- cgit v1.2.3