summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/examples/cacertinmem.c2
-rw-r--r--docs/examples/curlx.c4
-rw-r--r--docs/examples/evhiperfifo.c2
-rw-r--r--docs/examples/externalsocket.c2
-rw-r--r--docs/examples/ghiper.c4
-rw-r--r--docs/examples/hiperfifo.c6
-rw-r--r--docs/examples/htmltidy.c20
-rw-r--r--docs/examples/http2-serverpush.c2
-rw-r--r--docs/examples/opensslthreadlock.c8
-rw-r--r--docs/examples/rtsp.c8
-rw-r--r--docs/examples/smooth-gtk-thread.c2
-rw-r--r--docs/examples/url2file.c2
12 files changed, 31 insertions, 31 deletions
diff --git a/docs/examples/cacertinmem.c b/docs/examples/cacertinmem.c
index a3a4c8d10..bba8c722e 100644
--- a/docs/examples/cacertinmem.c
+++ b/docs/examples/cacertinmem.c
@@ -28,7 +28,7 @@
#include <curl/curl.h>
#include <stdio.h>
-size_t writefunction( void *ptr, size_t size, size_t nmemb, void *stream)
+size_t writefunction(void *ptr, size_t size, size_t nmemb, void *stream)
{
fwrite(ptr, size, nmemb, stream);
return (nmemb*size);
diff --git a/docs/examples/curlx.c b/docs/examples/curlx.c
index 7a189905c..155da2371 100644
--- a/docs/examples/curlx.c
+++ b/docs/examples/curlx.c
@@ -415,7 +415,7 @@ int main(int argc, char **argv)
goto err;
}
- if(!(p12bio = BIO_new_file(p.p12file , "rb"))) {
+ if(!(p12bio = BIO_new_file(p.p12file, "rb"))) {
BIO_printf(p.errorbio, "Error opening P12 file %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/evhiperfifo.c b/docs/examples/evhiperfifo.c
index 6d7936b5c..118f152ee 100644
--- a/docs/examples/evhiperfifo.c
+++ b/docs/examples/evhiperfifo.c
@@ -329,7 +329,7 @@ static int prog_cb (void *p, double dltotal, double dlnow, double ult,
/* Create a new easy handle, and add it to the global curl_multi */
-static void new_conn(char *url, GlobalInfo *g )
+static void new_conn(char *url, GlobalInfo *g)
{
ConnInfo *conn;
CURLMcode rc;
diff --git a/docs/examples/externalsocket.c b/docs/examples/externalsocket.c
index 8152515b6..9b144b42d 100644
--- a/docs/examples/externalsocket.c
+++ b/docs/examples/externalsocket.c
@@ -107,7 +107,7 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_URL, "http://99.99.99.99:9999");
/* Create the socket "manually" */
- if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == CURL_SOCKET_BAD ) {
+ if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == CURL_SOCKET_BAD) {
printf("Error creating listening socket.\n");
return 3;
}
diff --git a/docs/examples/ghiper.c b/docs/examples/ghiper.c
index f78a943b9..7317a63d8 100644
--- a/docs/examples/ghiper.c
+++ b/docs/examples/ghiper.c
@@ -247,7 +247,7 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
if(!fdp) {
MSG_OUT("Adding data: %s%s\n",
what&CURL_POLL_IN?"READ":"",
- what&CURL_POLL_OUT?"WRITE":"" );
+ what&CURL_POLL_OUT?"WRITE":"");
addsock(s, e, what, g);
}
else {
@@ -279,7 +279,7 @@ static int prog_cb (void *p, double dltotal, double dlnow, double ult,
}
/* Create a new easy handle, and add it to the global curl_multi */
-static void new_conn(char *url, GlobalInfo *g )
+static void new_conn(char *url, GlobalInfo *g)
{
ConnInfo *conn;
CURLMcode rc;
diff --git a/docs/examples/hiperfifo.c b/docs/examples/hiperfifo.c
index 9b2cfb587..98bcafe6d 100644
--- a/docs/examples/hiperfifo.c
+++ b/docs/examples/hiperfifo.c
@@ -191,7 +191,7 @@ static void event_cb(int fd, short kind, void *userp)
mcode_or_die("event_cb: curl_multi_socket_action", rc);
check_multi_info(g);
- if(g->still_running <= 0 ) {
+ if(g->still_running <= 0) {
fprintf(MSG_OUT, "last transfer done, kill timeout\n");
if(evtimer_pending(g->timer_event, NULL)) {
evtimer_del(g->timer_event);
@@ -312,7 +312,7 @@ static int prog_cb (void *p, double dltotal, double dlnow, double ult,
/* Create a new easy handle, and add it to the global curl_multi */
-static void new_conn(char *url, GlobalInfo *g )
+static void new_conn(char *url, GlobalInfo *g)
{
ConnInfo *conn;
CURLMcode rc;
@@ -360,7 +360,7 @@ static void fifo_cb(int fd, short event, void *arg)
s[0]='\0';
rv=fscanf(g->input, "%1023s%n", s, &n);
s[n]='\0';
- if(n && s[0] ) {
+ if(n && s[0]) {
new_conn(s, arg); /* if we read a URL, go get it! */
}
else
diff --git a/docs/examples/htmltidy.c b/docs/examples/htmltidy.c
index 01b1e68f1..687e3f346 100644
--- a/docs/examples/htmltidy.c
+++ b/docs/examples/htmltidy.c
@@ -37,27 +37,27 @@ uint write_cb(char *in, uint size, uint nmemb, TidyBuffer *out)
{
uint r;
r = size * nmemb;
- tidyBufAppend( out, in, r );
+ tidyBufAppend(out, in, r);
return r;
}
/* Traverse the document tree */
-void dumpNode(TidyDoc doc, TidyNode tnod, int indent )
+void dumpNode(TidyDoc doc, TidyNode tnod, int indent)
{
TidyNode child;
for(child = tidyGetChild(tnod); child; child = tidyGetNext(child) ) {
- ctmbstr name = tidyNodeGetName( child );
+ ctmbstr name = tidyNodeGetName(child);
if(name) {
/* if it has a name, then it's an HTML tag ... */
TidyAttr attr;
- printf( "%*.*s%s ", indent, indent, "<", name);
+ printf("%*.*s%s ", indent, indent, "<", name);
/* walk the attribute list */
for(attr=tidyAttrFirst(child); attr; attr=tidyAttrNext(attr) ) {
printf(tidyAttrName(attr));
tidyAttrValue(attr)?printf("=\"%s\" ",
tidyAttrValue(attr)):printf(" ");
}
- printf( ">\n");
+ printf(">\n");
}
else {
/* if it doesn't have a name, then it's probably text, cdata, etc... */
@@ -67,12 +67,12 @@ void dumpNode(TidyDoc doc, TidyNode tnod, int indent )
printf("%*.*s\n", indent, indent, buf.bp?(char *)buf.bp:"");
tidyBufFree(&buf);
}
- dumpNode( doc, child, indent + 4 ); /* recursive */
+ dumpNode(doc, child, indent + 4); /* recursive */
}
}
-int main(int argc, char **argv )
+int main(int argc, char **argv)
{
CURL *curl;
char curl_errbuf[CURL_ERROR_SIZE];
@@ -91,7 +91,7 @@ int main(int argc, char **argv )
tdoc = tidyCreate();
tidyOptSetBool(tdoc, TidyForceOutput, yes); /* try harder */
tidyOptSetInt(tdoc, TidyWrapLen, 4096);
- tidySetErrorBuffer( tdoc, &tidy_errbuf );
+ tidySetErrorBuffer(tdoc, &tidy_errbuf);
tidyBufInit(&docbuf);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &docbuf);
@@ -103,7 +103,7 @@ int main(int argc, char **argv )
if(err >= 0) {
err = tidyRunDiagnostics(tdoc); /* load tidy error buffer */
if(err >= 0) {
- dumpNode( tdoc, tidyGetRoot(tdoc), 0 ); /* walk the tree */
+ dumpNode(tdoc, tidyGetRoot(tdoc), 0); /* walk the tree */
fprintf(stderr, "%s\n", tidy_errbuf.bp); /* show errors */
}
}
@@ -121,7 +121,7 @@ int main(int argc, char **argv )
}
else
- printf( "usage: %s <url>\n", argv[0] );
+ printf("usage: %s <url>\n", argv[0]);
return 0;
}
diff --git a/docs/examples/http2-serverpush.c b/docs/examples/http2-serverpush.c
index af557e5bc..1a8c69b7d 100644
--- a/docs/examples/http2-serverpush.c
+++ b/docs/examples/http2-serverpush.c
@@ -187,7 +187,7 @@ static int server_push_callback(CURL *parent,
headp = curl_pushheader_byname(headers, ":path");
if(headp) {
- fprintf(stderr, "**** The PATH is %s\n", headp /* skip :path + colon */ );
+ fprintf(stderr, "**** The PATH is %s\n", headp /* skip :path + colon */);
}
(*transfers)++; /* one more */
diff --git a/docs/examples/opensslthreadlock.c b/docs/examples/opensslthreadlock.c
index 100ae4681..eebc42ee2 100644
--- a/docs/examples/opensslthreadlock.c
+++ b/docs/examples/opensslthreadlock.c
@@ -39,7 +39,7 @@
#define MUTEX_CLEANUP(x) pthread_mutex_destroy(&(x))
#define MUTEX_LOCK(x) pthread_mutex_lock(&(x))
#define MUTEX_UNLOCK(x) pthread_mutex_unlock(&(x))
-#define THREAD_ID pthread_self( )
+#define THREAD_ID pthread_self()
void handle_error(const char *file, int lineno, const char *msg)
@@ -69,10 +69,10 @@ int thread_setup(void)
{
int i;
- mutex_buf = malloc(CRYPTO_num_locks( ) * sizeof(MUTEX_TYPE));
+ mutex_buf = malloc(CRYPTO_num_locks() * sizeof(MUTEX_TYPE));
if(!mutex_buf)
return 0;
- for(i = 0; i < CRYPTO_num_locks( ); i++)
+ for(i = 0; i < CRYPTO_num_locks(); i++)
MUTEX_SETUP(mutex_buf[i]);
CRYPTO_set_id_callback(id_function);
CRYPTO_set_locking_callback(locking_function);
@@ -87,7 +87,7 @@ int thread_cleanup(void)
return 0;
CRYPTO_set_id_callback(NULL);
CRYPTO_set_locking_callback(NULL);
- for(i = 0; i < CRYPTO_num_locks( ); i++)
+ for(i = 0; i < CRYPTO_num_locks(); i++)
MUTEX_CLEANUP(mutex_buf[i]);
free(mutex_buf);
mutex_buf = NULL;
diff --git a/docs/examples/rtsp.c b/docs/examples/rtsp.c
index 5c00c145d..63c46e151 100644
--- a/docs/examples/rtsp.c
+++ b/docs/examples/rtsp.c
@@ -46,12 +46,12 @@ static int _getch(void)
{
struct termios oldt, newt;
int ch;
- tcgetattr( STDIN_FILENO, &oldt );
+ tcgetattr(STDIN_FILENO, &oldt);
newt = oldt;
- newt.c_lflag &= ~( ICANON | ECHO );
- tcsetattr( STDIN_FILENO, TCSANOW, &newt );
+ newt.c_lflag &= ~( ICANON | ECHO);
+ tcsetattr(STDIN_FILENO, TCSANOW, &newt);
ch = getchar();
- tcsetattr( STDIN_FILENO, TCSANOW, &oldt );
+ tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
return ch;
}
#endif
diff --git a/docs/examples/smooth-gtk-thread.c b/docs/examples/smooth-gtk-thread.c
index 8756494c1..547cc0f30 100644
--- a/docs/examples/smooth-gtk-thread.c
+++ b/docs/examples/smooth-gtk-thread.c
@@ -81,7 +81,7 @@ void *pull_one_url(void *NaN)
g_strdup_printf("xoap.weather.com/weather/local/%s?cc=*&dayf=5&unit=i\n",
urls[j]);
- printf( "http %s", http );
+ printf("http %s", http);
curl = curl_easy_init();
if(curl) {
diff --git a/docs/examples/url2file.c b/docs/examples/url2file.c
index 30a2ab0c0..39f84d68b 100644
--- a/docs/examples/url2file.c
+++ b/docs/examples/url2file.c
@@ -41,7 +41,7 @@ int main(int argc, char *argv[])
static const char *pagefilename = "page.out";
FILE *pagefile;
- if(argc < 2 ) {
+ if(argc < 2) {
printf("Usage: %s <URL>\n", argv[0]);
return 1;
}