aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarcel Raad <Marcel.Raad@teamviewer.com>2019-05-11 14:51:24 +0200
committerMarcel Raad <Marcel.Raad@teamviewer.com>2019-05-12 09:31:09 +0200
commit6b3dde7fe62ea5a557fd1fd323fac2bcd0c2e9be (patch)
treec9bf3ba8868f5d8c8db313cd1cd462dff6a42239 /lib
parent5f8b9fe81d9681033babb4fbcf983304aa7d11c8 (diff)
build: fix "clarify calculation precedence" warnings
Codacy/CppCheck warns about this. Consistently use parentheses as we already do in some places to silence the warning. Closes https://github.com/curl/curl/pull/3866
Diffstat (limited to 'lib')
-rw-r--r--lib/asyn-ares.c4
-rw-r--r--lib/easy.c4
-rw-r--r--lib/formdata.c2
-rw-r--r--lib/mime.c6
-rw-r--r--lib/multi.c4
-rw-r--r--lib/progress.c4
6 files changed, 13 insertions, 11 deletions
diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c
index fc107bc6b..2dd64a72a 100644
--- a/lib/asyn-ares.c
+++ b/lib/asyn-ares.c
@@ -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;
diff --git a/lib/easy.c b/lib/easy.c
index 40be38220..9fc33ccb2 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -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;
diff --git a/lib/formdata.c b/lib/formdata.c
index 202d930c7..fd0863ef6 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -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);
diff --git a/lib/mime.c b/lib/mime.c
index 48147d4f5..6d4bc4fec 100644
--- a/lib/mime.c
+++ b/lib/mime.c
@@ -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) {
diff --git a/lib/multi.c b/lib/multi.c
index 631887bfc..71217989b 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -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");
diff --git a/lib/progress.c b/lib/progress.c
index d37e1d5a6..fe9929bb9 100644
--- a/lib/progress.c
+++ b/lib/progress.c
@@ -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 */