Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix "clarify calculation precedence" warnings #3866

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/asyn-ares.c
Expand Up @@ -331,9 +331,9 @@ static int waitperform(struct connectdata *conn, int timeout_ms)
/* move through the descriptors and ask for processing on them */
for(i = 0; i < num; i++)
ares_process_fd((ares_channel)data->state.resolver,
pfd[i].revents & (POLLRDNORM|POLLIN)?
(pfd[i].revents & (POLLRDNORM|POLLIN))?
pfd[i].fd:ARES_SOCKET_BAD,
pfd[i].revents & (POLLWRNORM|POLLOUT)?
(pfd[i].revents & (POLLWRNORM|POLLOUT))?
pfd[i].fd:ARES_SOCKET_BAD);
}
return nfds;
Expand Down
4 changes: 2 additions & 2 deletions lib/easy.c
Expand Up @@ -451,8 +451,8 @@ static int events_socket(struct Curl_easy *easy, /* easy handle */
m->socket.revents = 0;
ev->list = m;
infof(easy, "socket cb: socket %d ADDED as %s%s\n", s,
what&CURL_POLL_IN?"IN":"",
what&CURL_POLL_OUT?"OUT":"");
(what&CURL_POLL_IN)?"IN":"",
(what&CURL_POLL_OUT)?"OUT":"");
}
else
return CURLE_OUT_OF_MEMORY;
Expand Down
2 changes: 1 addition & 1 deletion lib/formdata.c
Expand Up @@ -569,7 +569,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
if(((form->flags & HTTPPOST_FILENAME) ||
(form->flags & HTTPPOST_BUFFER)) &&
!form->contenttype) {
char *f = form->flags & HTTPPOST_BUFFER?
char *f = (form->flags & HTTPPOST_BUFFER)?
form->showfilename : form->value;
char const *type;
type = Curl_mime_contenttype(f);
Expand Down
6 changes: 4 additions & 2 deletions lib/mime.c
Expand Up @@ -821,8 +821,10 @@ static size_t readback_part(curl_mimepart *part,
struct curl_slist *hdr = (struct curl_slist *) part->state.ptr;
switch(part->state.state) {
case MIMESTATE_BEGIN:
mimesetstate(&part->state, part->flags & MIME_BODY_ONLY? MIMESTATE_BODY:
MIMESTATE_CURLHEADERS, part->curlheaders);
mimesetstate(&part->state,
(part->flags & MIME_BODY_ONLY)?
MIMESTATE_BODY: MIMESTATE_CURLHEADERS,
part->curlheaders);
break;
case MIMESTATE_USERHEADERS:
if(!hdr) {
Expand Down
4 changes: 2 additions & 2 deletions lib/multi.c
Expand Up @@ -3056,8 +3056,8 @@ void Curl_multi_dump(struct Curl_multi *multi)
continue;
}
fprintf(stderr, "[%s %s] ",
entry->action&CURL_POLL_IN?"RECVING":"",
entry->action&CURL_POLL_OUT?"SENDING":"");
(entry->action&CURL_POLL_IN)?"RECVING":"",
(entry->action&CURL_POLL_OUT)?"SENDING":"");
}
if(data->numsocks)
fprintf(stderr, "\n");
Expand Down
4 changes: 2 additions & 2 deletions lib/progress.c
Expand Up @@ -564,9 +564,9 @@ int Curl_pgrsUpdate(struct connectdata *conn)

/* Get the total amount of data expected to get transferred */
total_expected_transfer =
(data->progress.flags & PGRS_UL_SIZE_KNOWN?
((data->progress.flags & PGRS_UL_SIZE_KNOWN)?
data->progress.size_ul:data->progress.uploaded)+
(data->progress.flags & PGRS_DL_SIZE_KNOWN?
((data->progress.flags & PGRS_DL_SIZE_KNOWN)?
data->progress.size_dl:data->progress.downloaded);

/* We have transferred this much so far */
Expand Down
4 changes: 2 additions & 2 deletions tests/libtest/lib1156.c
Expand Up @@ -88,15 +88,15 @@ static int onetest(CURL *curl, const char *url, const testparams *p)
unsigned int replyselector;
char urlbuf[256];

replyselector = p->flags & F_CONTENTRANGE? 1: 0;
replyselector = (p->flags & F_CONTENTRANGE)? 1: 0;
if(p->flags & F_HTTP416)
replyselector += 2;
msnprintf(urlbuf, sizeof(urlbuf), "%s%04u", url, replyselector);
test_setopt(curl, CURLOPT_URL, urlbuf);
test_setopt(curl, CURLOPT_RESUME_FROM, (p->flags & F_RESUME)? 3: 0);
test_setopt(curl, CURLOPT_RANGE, !(p->flags & F_RESUME)?
"3-1000000": (char *) NULL);
test_setopt(curl, CURLOPT_FAILONERROR, p->flags & F_FAIL? 1: 0);
test_setopt(curl, CURLOPT_FAILONERROR, (p->flags & F_FAIL)? 1: 0);
hasbody = 0;
res = curl_easy_perform(curl);
if(res != p->result) {
Expand Down