mirror of
https://github.com/curl/curl.git
synced 2026-08-25 06:23:30 +03:00
tidy-up: more whitespace/indent, comments
Also a couple of minor formatting updates in the root `CMakeLists.txt`. One swap to `#ifdef`. Closes #17929
This commit is contained in:
parent
63a8167f3e
commit
4d977fe552
82 changed files with 351 additions and 378 deletions
|
|
@ -619,7 +619,6 @@ static int test_dnsd(int argc, char **argv)
|
|||
}
|
||||
|
||||
logmsg("end of one transfer");
|
||||
|
||||
}
|
||||
|
||||
dnsd_cleanup:
|
||||
|
|
|
|||
|
|
@ -228,11 +228,8 @@ static int disconnect(FILE *dump, curl_socket_t fd)
|
|||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
do
|
||||
|
||||
encodedByte = X MOD 128
|
||||
|
||||
X = X DIV 128
|
||||
|
|
|
|||
|
|
@ -120,22 +120,22 @@ static const char *docbadconnect =
|
|||
|
||||
/* send back this on HTTP 404 file not found */
|
||||
static const char *doc404_HTTP = "HTTP/1.1 404 Not Found\r\n"
|
||||
"Server: " RTSPDVERSION "\r\n"
|
||||
"Connection: close\r\n"
|
||||
"Content-Type: text/html"
|
||||
END_OF_HEADERS
|
||||
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
|
||||
"<HTML><HEAD>\n"
|
||||
"<TITLE>404 Not Found</TITLE>\n"
|
||||
"</HEAD><BODY>\n"
|
||||
"<H1>Not Found</H1>\n"
|
||||
"The requested URL was not found on this server.\n"
|
||||
"<P><HR><ADDRESS>" RTSPDVERSION "</ADDRESS>\n" "</BODY></HTML>\n";
|
||||
"Server: " RTSPDVERSION "\r\n"
|
||||
"Connection: close\r\n"
|
||||
"Content-Type: text/html"
|
||||
END_OF_HEADERS
|
||||
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
|
||||
"<HTML><HEAD>\n"
|
||||
"<TITLE>404 Not Found</TITLE>\n"
|
||||
"</HEAD><BODY>\n"
|
||||
"<H1>Not Found</H1>\n"
|
||||
"The requested URL was not found on this server.\n"
|
||||
"<P><HR><ADDRESS>" RTSPDVERSION "</ADDRESS>\n" "</BODY></HTML>\n";
|
||||
|
||||
/* send back this on RTSP 404 file not found */
|
||||
static const char *doc404_RTSP = "RTSP/1.0 404 Not Found\r\n"
|
||||
"Server: " RTSPDVERSION
|
||||
END_OF_HEADERS;
|
||||
"Server: " RTSPDVERSION
|
||||
END_OF_HEADERS;
|
||||
|
||||
/* Default size to send away fake RTP data */
|
||||
#define RTP_DATA_SIZE 12
|
||||
|
|
|
|||
|
|
@ -143,17 +143,17 @@ static const char *docquit_sws =
|
|||
|
||||
/* send back this on 404 file not found */
|
||||
static const char *doc404 = "HTTP/1.1 404 Not Found\r\n"
|
||||
"Server: " SWSVERSION "\r\n"
|
||||
"Connection: close\r\n"
|
||||
"Content-Type: text/html"
|
||||
END_OF_HEADERS
|
||||
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
|
||||
"<HTML><HEAD>\n"
|
||||
"<TITLE>404 Not Found</TITLE>\n"
|
||||
"</HEAD><BODY>\n"
|
||||
"<H1>Not Found</H1>\n"
|
||||
"The requested URL was not found on this server.\n"
|
||||
"<P><HR><ADDRESS>" SWSVERSION "</ADDRESS>\n" "</BODY></HTML>\n";
|
||||
"Server: " SWSVERSION "\r\n"
|
||||
"Connection: close\r\n"
|
||||
"Content-Type: text/html"
|
||||
END_OF_HEADERS
|
||||
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
|
||||
"<HTML><HEAD>\n"
|
||||
"<TITLE>404 Not Found</TITLE>\n"
|
||||
"</HEAD><BODY>\n"
|
||||
"<H1>Not Found</H1>\n"
|
||||
"The requested URL was not found on this server.\n"
|
||||
"<P><HR><ADDRESS>" SWSVERSION "</ADDRESS>\n" "</BODY></HTML>\n";
|
||||
|
||||
/* work around for handling trailing headers */
|
||||
static int already_recv_zeroed_chunk = FALSE;
|
||||
|
|
@ -405,7 +405,6 @@ static int sws_ProcessRequest(struct sws_httprequest *req)
|
|||
logmsg("No test number in path");
|
||||
req->testno = DOCNUMBER_NOTHING;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(req->testno == DOCNUMBER_NOTHING) {
|
||||
|
|
|
|||
|
|
@ -510,13 +510,13 @@ static int synchnet(curl_socket_t f /* socket to flush */)
|
|||
for(;;) {
|
||||
#if defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO)
|
||||
long i;
|
||||
(void) IoctlSocket(f, FIONBIO, &i);
|
||||
(void)IoctlSocket(f, FIONBIO, &i);
|
||||
#elif defined(HAVE_IOCTLSOCKET)
|
||||
unsigned long i;
|
||||
(void) ioctlsocket(f, FIONREAD, &i);
|
||||
(void)ioctlsocket(f, FIONREAD, &i);
|
||||
#else
|
||||
int i;
|
||||
(void) ioctl(f, FIONREAD, &i);
|
||||
(void)ioctl(f, FIONREAD, &i);
|
||||
#endif
|
||||
if(i) {
|
||||
j++;
|
||||
|
|
@ -528,8 +528,8 @@ static int synchnet(curl_socket_t f /* socket to flush */)
|
|||
else
|
||||
fromaddrlen = sizeof(fromaddr.sa6);
|
||||
#endif
|
||||
(void) recvfrom(f, rbuf, sizeof(rbuf), 0,
|
||||
&fromaddr.sa, &fromaddrlen);
|
||||
(void)recvfrom(f, rbuf, sizeof(rbuf), 0,
|
||||
&fromaddr.sa, &fromaddrlen);
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
|
@ -1179,7 +1179,7 @@ static void sendtftp(struct testcase *test, const struct formats *pf)
|
|||
sdp->th_block = htons(sendblock);
|
||||
timeout = 0;
|
||||
#ifdef HAVE_SIGSETJMP
|
||||
(void) sigsetjmp(timeoutbuf, 1);
|
||||
(void)sigsetjmp(timeoutbuf, 1);
|
||||
#endif
|
||||
if(test->writedelay) {
|
||||
logmsg("Pausing %d seconds before %d bytes", test->writedelay,
|
||||
|
|
@ -1223,7 +1223,7 @@ send_data:
|
|||
break;
|
||||
}
|
||||
/* Re-synchronize with the other side */
|
||||
(void) synchnet(peer);
|
||||
(void)synchnet(peer);
|
||||
if(sap->th_block == (sendblock-1)) {
|
||||
goto send_data;
|
||||
}
|
||||
|
|
@ -1257,7 +1257,7 @@ static void recvtftp(struct testcase *test, const struct formats *pf)
|
|||
rap->th_block = htons(recvblock);
|
||||
recvblock++;
|
||||
#ifdef HAVE_SIGSETJMP
|
||||
(void) sigsetjmp(timeoutbuf, 1);
|
||||
(void)sigsetjmp(timeoutbuf, 1);
|
||||
#endif
|
||||
send_ack:
|
||||
logmsg("write");
|
||||
|
|
@ -1291,7 +1291,7 @@ send_ack:
|
|||
break; /* normal */
|
||||
}
|
||||
/* Re-synchronize with the other side */
|
||||
(void) synchnet(peer);
|
||||
(void)synchnet(peer);
|
||||
if(rdp->th_block == (recvblock-1))
|
||||
goto send_ack; /* rexmit */
|
||||
}
|
||||
|
|
@ -1315,7 +1315,7 @@ send_ack:
|
|||
|
||||
rap->th_opcode = htons(opcode_ACK); /* send the "final" ack */
|
||||
rap->th_block = htons(recvblock);
|
||||
(void) swrite(peer, &ackbuf.storage[0], 4);
|
||||
(void)swrite(peer, &ackbuf.storage[0], 4);
|
||||
#if defined(HAVE_ALARM) && defined(SIGALRM)
|
||||
mysignal(SIGALRM, justtimeout); /* just abort read on timeout */
|
||||
alarm(rexmtval);
|
||||
|
|
@ -1330,7 +1330,7 @@ send_ack:
|
|||
if(n >= 4 && /* if read some data */
|
||||
rdp->th_opcode == opcode_DATA && /* and got a data block */
|
||||
recvblock == rdp->th_block) { /* then my last ack was lost */
|
||||
(void) swrite(peer, &ackbuf.storage[0], 4); /* resend final ack */
|
||||
(void)swrite(peer, &ackbuf.storage[0], 4); /* resend final ack */
|
||||
}
|
||||
abort:
|
||||
/* make sure the output file is closed in case of abort */
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ static void win32_cleanup(void)
|
|||
{
|
||||
#ifdef USE_WINSOCK
|
||||
WSACleanup();
|
||||
#endif /* USE_WINSOCK */
|
||||
#endif
|
||||
|
||||
/* flush buffers of all streams regardless of their mode */
|
||||
_flushall();
|
||||
|
|
@ -560,7 +560,7 @@ static SIGHANDLER_T set_signal(int signum, SIGHANDLER_T handler,
|
|||
if(oldhdlr != SIG_ERR)
|
||||
siginterrupt(signum, (int) restartable);
|
||||
#else
|
||||
(void) restartable;
|
||||
(void)restartable;
|
||||
#endif
|
||||
|
||||
return oldhdlr;
|
||||
|
|
@ -640,31 +640,31 @@ void restore_signal_handlers(bool keep_sigalrm)
|
|||
{
|
||||
#ifdef SIGHUP
|
||||
if(SIG_ERR != old_sighup_handler)
|
||||
(void) set_signal(SIGHUP, old_sighup_handler, FALSE);
|
||||
(void)set_signal(SIGHUP, old_sighup_handler, FALSE);
|
||||
#endif
|
||||
#ifdef SIGPIPE
|
||||
if(SIG_ERR != old_sigpipe_handler)
|
||||
(void) set_signal(SIGPIPE, old_sigpipe_handler, FALSE);
|
||||
(void)set_signal(SIGPIPE, old_sigpipe_handler, FALSE);
|
||||
#endif
|
||||
#ifdef SIGALRM
|
||||
if(!keep_sigalrm) {
|
||||
if(SIG_ERR != old_sigalrm_handler)
|
||||
(void) set_signal(SIGALRM, old_sigalrm_handler, FALSE);
|
||||
(void)set_signal(SIGALRM, old_sigalrm_handler, FALSE);
|
||||
}
|
||||
#else
|
||||
(void)keep_sigalrm;
|
||||
#endif
|
||||
#ifdef SIGINT
|
||||
if(SIG_ERR != old_sigint_handler)
|
||||
(void) set_signal(SIGINT, old_sigint_handler, FALSE);
|
||||
(void)set_signal(SIGINT, old_sigint_handler, FALSE);
|
||||
#endif
|
||||
#ifdef SIGTERM
|
||||
if(SIG_ERR != old_sigterm_handler)
|
||||
(void) set_signal(SIGTERM, old_sigterm_handler, FALSE);
|
||||
(void)set_signal(SIGTERM, old_sigterm_handler, FALSE);
|
||||
#endif
|
||||
#if defined(SIGBREAK) && defined(_WIN32)
|
||||
if(SIG_ERR != old_sigbreak_handler)
|
||||
(void) set_signal(SIGBREAK, old_sigbreak_handler, FALSE);
|
||||
(void)set_signal(SIGBREAK, old_sigbreak_handler, FALSE);
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
#ifndef UNDER_CE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue