mirror of
https://github.com/curl/curl.git
synced 2026-08-26 06:53:32 +03:00
checksrc: stricter no-space-before-paren enforcement
In order to make the code style more uniform everywhere
This commit is contained in:
parent
5fad800efd
commit
b228d2952b
81 changed files with 281 additions and 260 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ int main(void)
|
|||
curl_formfree(formpost);
|
||||
|
||||
/* free slist */
|
||||
curl_slist_free_all (headerlist);
|
||||
curl_slist_free_all(headerlist);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue