diff options
author | Daniel Stenberg <daniel@haxx.se> | 2016-12-13 23:34:59 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2016-12-13 23:39:11 +0100 |
commit | b228d2952b6762b5c9b851fba0cf391e80c6761a (patch) | |
tree | d8d52d61b047a31b1c51851f1b48c4dc9cfcd1f4 /docs/examples | |
parent | 5fad800efdf1cb84f863f3634b85c898fb3d0d66 (diff) |
checksrc: stricter no-space-before-paren enforcement
In order to make the code style more uniform everywhere
Diffstat (limited to 'docs/examples')
-rw-r--r-- | docs/examples/curlx.c | 8 | ||||
-rw-r--r-- | docs/examples/debug.c | 2 | ||||
-rw-r--r-- | docs/examples/evhiperfifo.c | 14 | ||||
-rw-r--r-- | docs/examples/ftpupload.c | 2 | ||||
-rw-r--r-- | docs/examples/ghiper.c | 18 | ||||
-rw-r--r-- | docs/examples/hiperfifo.c | 14 | ||||
-rw-r--r-- | docs/examples/http2-download.c | 2 | ||||
-rw-r--r-- | docs/examples/http2-serverpush.c | 2 | ||||
-rw-r--r-- | docs/examples/http2-upload.c | 2 | ||||
-rw-r--r-- | docs/examples/multi-app.c | 2 | ||||
-rw-r--r-- | docs/examples/multi-debugcallback.c | 2 | ||||
-rw-r--r-- | docs/examples/multi-post.c | 2 | ||||
-rw-r--r-- | docs/examples/postit2.c | 2 | ||||
-rw-r--r-- | docs/examples/smooth-gtk-thread.c | 12 | ||||
-rw-r--r-- | docs/examples/synctime.c | 6 |
15 files changed, 45 insertions, 45 deletions
diff --git a/docs/examples/curlx.c b/docs/examples/curlx.c index e0d709999..3b11ef737 100644 --- a/docs/examples/curlx.c +++ b/docs/examples/curlx.c @@ -293,7 +293,7 @@ int main(int argc, char **argv) binaryptr = malloc(tabLength); p.verbose = 0; - p.errorbio = BIO_new_fp (stderr, BIO_NOCLOSE); + p.errorbio = BIO_new_fp(stderr, BIO_NOCLOSE); curl_global_init(CURL_GLOBAL_DEFAULT); @@ -408,7 +408,7 @@ int main(int argc, char **argv) } - p.errorbio = BIO_new_fp (stderr, BIO_NOCLOSE); + p.errorbio = BIO_new_fp(stderr, BIO_NOCLOSE); if(!(p.curl = curl_easy_init())) { BIO_printf(p.errorbio, "Cannot init curl lib\n"); @@ -419,7 +419,7 @@ int main(int argc, char **argv) BIO_printf(p.errorbio, "Error opening P12 file %s\n", p.p12file); goto err; } - if(!(p.p12 = d2i_PKCS12_bio (p12bio, NULL))) { + if(!(p.p12 = d2i_PKCS12_bio(p12bio, NULL))) { BIO_printf(p.errorbio, "Cannot decode P12 structure %s\n", p.p12file); goto err; } @@ -505,7 +505,7 @@ int main(int argc, char **argv) { int lu; int i=0; - while((lu = BIO_read (in, &binaryptr[i], tabLength-i)) >0) { + while((lu = BIO_read(in, &binaryptr[i], tabLength-i)) >0) { i+=lu; if(i== tabLength) { tabLength+=100; diff --git a/docs/examples/debug.c b/docs/examples/debug.c index f5d58bf19..cbf1c1106 100644 --- a/docs/examples/debug.c +++ b/docs/examples/debug.c @@ -88,7 +88,7 @@ int my_trace(CURL *handle, curl_infotype type, const char *text; (void)handle; /* prevent compiler warning */ - switch (type) { + switch(type) { case CURLINFO_TEXT: fprintf(stderr, "== Info: %s", data); default: /* in case a new one is introduced to shock us */ diff --git a/docs/examples/evhiperfifo.c b/docs/examples/evhiperfifo.c index 52f682818..efe42475a 100644 --- a/docs/examples/evhiperfifo.c +++ b/docs/examples/evhiperfifo.c @@ -134,7 +134,7 @@ static void mcode_or_die(const char *where, CURLMcode code) { if(CURLM_OK != code) { const char *s; - switch (code) { + switch(code) { case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break; @@ -317,8 +317,8 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data) /* CURLOPT_PROGRESSFUNCTION */ -static int prog_cb (void *p, double dltotal, double dlnow, double ult, - double uln) +static int prog_cb(void *p, double dltotal, double dlnow, double ult, + double uln) { ConnInfo *conn = (ConnInfo *)p; (void)ult; @@ -388,7 +388,7 @@ static void fifo_cb(EV_P_ struct ev_io *w, int revents) } /* Create a named pipe and tell libevent to monitor it */ -static int init_fifo (GlobalInfo *g) +static int init_fifo(GlobalInfo *g) { struct stat st; static const char *fifo = "hiper.fifo"; @@ -399,18 +399,18 @@ static int init_fifo (GlobalInfo *g) if((st.st_mode & S_IFMT) == S_IFREG) { errno = EEXIST; perror("lstat"); - exit (1); + exit(1); } } unlink(fifo); if(mkfifo (fifo, 0600) == -1) { perror("mkfifo"); - exit (1); + exit(1); } sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0); if(sockfd == -1) { perror("open"); - exit (1); + exit(1); } g->input = fdopen(sockfd, "r"); diff --git a/docs/examples/ftpupload.c b/docs/examples/ftpupload.c index bba0c4d53..41e2d807c 100644 --- a/docs/examples/ftpupload.c +++ b/docs/examples/ftpupload.c @@ -127,7 +127,7 @@ int main(void) curl_easy_strerror(res)); /* clean up the FTP commands list */ - curl_slist_free_all (headerlist); + curl_slist_free_all(headerlist); /* always cleanup */ curl_easy_cleanup(curl); diff --git a/docs/examples/ghiper.c b/docs/examples/ghiper.c index c0fbd8246..a1af4c5a3 100644 --- a/docs/examples/ghiper.c +++ b/docs/examples/ghiper.c @@ -98,7 +98,7 @@ static void mcode_or_die(const char *where, CURLMcode code) { if(CURLM_OK != code) { const char *s; - switch (code) { + switch(code) { case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break; case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break; case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break; @@ -272,8 +272,8 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data) } /* CURLOPT_PROGRESSFUNCTION */ -static int prog_cb (void *p, double dltotal, double dlnow, double ult, - double uln) +static int prog_cb(void *p, double dltotal, double dlnow, double ult, + double uln) { ConnInfo *conn = (ConnInfo *)p; MSG_OUT("Progress: %s (%g/%g)\n", conn->url, dlnow, dltotal); @@ -318,7 +318,7 @@ static void new_conn(char *url, GlobalInfo *g) } /* This gets called by glib whenever data is received from the fifo */ -static gboolean fifo_cb (GIOChannel *ch, GIOCondition condition, gpointer data) +static gboolean fifo_cb(GIOChannel *ch, GIOCondition condition, gpointer data) { #define BUF_SIZE 1024 gsize len, tp; @@ -380,21 +380,21 @@ int init_fifo(void) if((st.st_mode & S_IFMT) == S_IFREG) { errno = EEXIST; perror("lstat"); - exit (1); + exit(1); } } - unlink (fifo); + unlink(fifo); if(mkfifo (fifo, 0600) == -1) { perror("mkfifo"); - exit (1); + exit(1); } - socket = open (fifo, O_RDWR | O_NONBLOCK, 0); + socket = open(fifo, O_RDWR | O_NONBLOCK, 0); if(socket == -1) { perror("open"); - exit (1); + exit(1); } MSG_OUT("Now, pipe some URL's into > %s\n", fifo); diff --git a/docs/examples/hiperfifo.c b/docs/examples/hiperfifo.c index dce009c5b..f08fcda99 100644 --- a/docs/examples/hiperfifo.c +++ b/docs/examples/hiperfifo.c @@ -128,7 +128,7 @@ static void mcode_or_die(const char *where, CURLMcode code) { if(CURLM_OK != code) { const char *s; - switch (code) { + switch(code) { case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break; case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break; case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break; @@ -300,8 +300,8 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data) /* CURLOPT_PROGRESSFUNCTION */ -static int prog_cb (void *p, double dltotal, double dlnow, double ult, - double uln) +static int prog_cb(void *p, double dltotal, double dlnow, double ult, + double uln) { ConnInfo *conn = (ConnInfo *)p; (void)ult; @@ -371,7 +371,7 @@ static void fifo_cb(int fd, short event, void *arg) /* Create a named pipe and tell libevent to monitor it */ static const char *fifo = "hiper.fifo"; -static int init_fifo (GlobalInfo *g) +static int init_fifo(GlobalInfo *g) { struct stat st; curl_socket_t sockfd; @@ -381,18 +381,18 @@ static int init_fifo (GlobalInfo *g) if((st.st_mode & S_IFMT) == S_IFREG) { errno = EEXIST; perror("lstat"); - exit (1); + exit(1); } } unlink(fifo); if(mkfifo (fifo, 0600) == -1) { perror("mkfifo"); - exit (1); + exit(1); } sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0); if(sockfd == -1) { perror("open"); - exit (1); + exit(1); } g->input = fdopen(sockfd, "r"); diff --git a/docs/examples/http2-download.c b/docs/examples/http2-download.c index 9e87a064e..c82fed285 100644 --- a/docs/examples/http2-download.c +++ b/docs/examples/http2-download.c @@ -114,7 +114,7 @@ int my_trace(CURL *handle, curl_infotype type, int num = hnd2num(handle); (void)handle; /* prevent compiler warning */ (void)userp; - switch (type) { + switch(type) { case CURLINFO_TEXT: fprintf(stderr, "== %d Info: %s", num, data); default: /* in case a new one is introduced to shock us */ diff --git a/docs/examples/http2-serverpush.c b/docs/examples/http2-serverpush.c index 1a8c69b7d..ecd9cc5d4 100644 --- a/docs/examples/http2-serverpush.c +++ b/docs/examples/http2-serverpush.c @@ -93,7 +93,7 @@ int my_trace(CURL *handle, curl_infotype type, const char *text; (void)handle; /* prevent compiler warning */ (void)userp; - switch (type) { + switch(type) { case CURLINFO_TEXT: fprintf(stderr, "== Info: %s", data); default: /* in case a new one is introduced to shock us */ diff --git a/docs/examples/http2-upload.c b/docs/examples/http2-upload.c index b6353713e..67e17f34b 100644 --- a/docs/examples/http2-upload.c +++ b/docs/examples/http2-upload.c @@ -133,7 +133,7 @@ int my_trace(CURL *handle, curl_infotype type, snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06ld", now->tm_hour, now->tm_min, now->tm_sec, (long)tv.tv_usec); - switch (type) { + switch(type) { case CURLINFO_TEXT: fprintf(stderr, "%s [%d] Info: %s", timebuf, num, data); default: /* in case a new one is introduced to shock us */ diff --git a/docs/examples/multi-app.c b/docs/examples/multi-app.c index f8447930a..9a8ecfeb8 100644 --- a/docs/examples/multi-app.c +++ b/docs/examples/multi-app.c @@ -156,7 +156,7 @@ int main(void) break; } - switch (idx) { + switch(idx) { case HTTP_HANDLE: printf("HTTP transfer completed with status %d\n", msg->data.result); break; diff --git a/docs/examples/multi-debugcallback.c b/docs/examples/multi-debugcallback.c index d07cc3bb9..be241fc72 100644 --- a/docs/examples/multi-debugcallback.c +++ b/docs/examples/multi-debugcallback.c @@ -96,7 +96,7 @@ int my_trace(CURL *handle, curl_infotype type, (void)userp; (void)handle; /* prevent compiler warning */ - switch (type) { + switch(type) { case CURLINFO_TEXT: fprintf(stderr, "== Info: %s", data); default: /* in case a new one is introduced to shock us */ diff --git a/docs/examples/multi-post.c b/docs/examples/multi-post.c index 5d9abc12f..cc2ca18e9 100644 --- a/docs/examples/multi-post.c +++ b/docs/examples/multi-post.c @@ -165,7 +165,7 @@ int main(void) curl_formfree(formpost); /* free slist */ - curl_slist_free_all (headerlist); + curl_slist_free_all(headerlist); } return 0; } diff --git a/docs/examples/postit2.c b/docs/examples/postit2.c index 67e685f1e..ef50a66d9 100644 --- a/docs/examples/postit2.c +++ b/docs/examples/postit2.c @@ -101,7 +101,7 @@ int main(int argc, char *argv[]) /* then cleanup the formpost chain */ curl_formfree(formpost); /* free slist */ - curl_slist_free_all (headerlist); + curl_slist_free_all(headerlist); } return 0; } diff --git a/docs/examples/smooth-gtk-thread.c b/docs/examples/smooth-gtk-thread.c index 547cc0f30..713fcc6c3 100644 --- a/docs/examples/smooth-gtk-thread.c +++ b/docs/examples/smooth-gtk-thread.c @@ -105,7 +105,7 @@ void *pull_one_url(void *NaN) curl_easy_cleanup(curl); } - g_free (http); + g_free(http); /* Adds more latency, testing the mutex.*/ sleep(1); @@ -118,7 +118,7 @@ void *pull_one_url(void *NaN) gboolean pulse_bar(gpointer data) { gdk_threads_enter(); - gtk_progress_bar_pulse (GTK_PROGRESS_BAR (data)); + gtk_progress_bar_pulse(GTK_PROGRESS_BAR (data)); gdk_threads_leave(); /* Return true so the function will be called again; @@ -182,8 +182,8 @@ int main(int argc, char **argv) /* Init thread */ g_thread_init(NULL); - gdk_threads_init (); - gdk_threads_enter (); + gdk_threads_init(); + gdk_threads_enter(); gtk_init(&argc, &argv); @@ -203,9 +203,9 @@ int main(int argc, char **argv) /* Progress bar */ progress_bar = gtk_progress_bar_new(); - gtk_progress_bar_pulse (GTK_PROGRESS_BAR (progress_bar)); + gtk_progress_bar_pulse(GTK_PROGRESS_BAR (progress_bar)); /* Make uniform pulsing */ - gint pulse_ref = g_timeout_add (300, pulse_bar, progress_bar); + gint pulse_ref = g_timeout_add(300, pulse_bar, progress_bar); g_object_set_data(G_OBJECT(progress_bar), "pulse_id", GINT_TO_POINTER(pulse_ref)); gtk_container_add(GTK_CONTAINER(inside_frame), progress_bar); diff --git a/docs/examples/synctime.c b/docs/examples/synctime.c index 1c787bb91..48377f527 100644 --- a/docs/examples/synctime.c +++ b/docs/examples/synctime.c @@ -152,9 +152,9 @@ size_t SyncTime_CURL_WriteHeader(void *ptr, size_t size, size_t nmemb, TmpStr1 & 2? */ AutoSyncTime = 0; else { - RetVal = sscanf ((char *)(ptr), "Date: %s %hu %s %hu %hu:%hu:%hu", - TmpStr1, &SYSTime.wDay, TmpStr2, &SYSTime.wYear, - &SYSTime.wHour, &SYSTime.wMinute, &SYSTime.wSecond); + RetVal = sscanf((char *)(ptr), "Date: %s %hu %s %hu %hu:%hu:%hu", + TmpStr1, &SYSTime.wDay, TmpStr2, &SYSTime.wYear, + &SYSTime.wHour, &SYSTime.wMinute, &SYSTime.wSecond); if(RetVal == 7) { SYSTime.wMilliseconds = 500; /* adjust to midpoint, 0.5 sec */ |