mirror of
https://github.com/curl/curl.git
synced 2026-08-24 20:13:35 +03:00
build: fix Codacy warnings
Reduce variable scopes and remove redundant variable stores. Closes https://github.com/curl/curl/pull/3975
This commit is contained in:
parent
04ac54e196
commit
e23c52b329
23 changed files with 80 additions and 123 deletions
|
|
@ -749,10 +749,6 @@ static bool incoming(curl_socket_t listenfd)
|
|||
fd_set fds_read;
|
||||
fd_set fds_write;
|
||||
fd_set fds_err;
|
||||
curl_socket_t sockfd = CURL_SOCKET_BAD;
|
||||
int maxfd = -99;
|
||||
ssize_t rc;
|
||||
int error = 0;
|
||||
int clients = 0; /* connected clients */
|
||||
struct perclient c[2];
|
||||
|
||||
|
|
@ -772,15 +768,17 @@ static bool incoming(curl_socket_t listenfd)
|
|||
|
||||
do {
|
||||
int i;
|
||||
ssize_t rc;
|
||||
int error = 0;
|
||||
curl_socket_t sockfd = listenfd;
|
||||
int maxfd = (int)sockfd;
|
||||
|
||||
FD_ZERO(&fds_read);
|
||||
FD_ZERO(&fds_write);
|
||||
FD_ZERO(&fds_err);
|
||||
|
||||
sockfd = listenfd;
|
||||
/* there's always a socket to wait for */
|
||||
FD_SET(sockfd, &fds_read);
|
||||
maxfd = (int)sockfd;
|
||||
|
||||
for(i = 0; i < 2; i++) {
|
||||
if(c[i].used) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue