summaryrefslogtreecommitdiff
path: root/docs/examples/evhiperfifo.c
diff options
context:
space:
mode:
authorMarcel Raad <Marcel.Raad@teamviewer.com>2019-05-21 11:25:42 +0200
committerMarcel Raad <Marcel.Raad@teamviewer.com>2019-05-22 10:06:33 +0200
commit159ea554afb69f429098b0b5e7aa841149e93f2d (patch)
tree5260fe1276cac531c33d07f272e392b342bcc4e0 /docs/examples/evhiperfifo.c
parentacb097ca7f2ac6304bc664dd9154114fd27bffca (diff)
downloadgnurl-159ea554afb69f429098b0b5e7aa841149e93f2d.tar.gz
gnurl-159ea554afb69f429098b0b5e7aa841149e93f2d.tar.bz2
gnurl-159ea554afb69f429098b0b5e7aa841149e93f2d.zip
examples: fix "clarify calculation precedence" warnings
Closes https://github.com/curl/curl/pull/3919
Diffstat (limited to 'docs/examples/evhiperfifo.c')
-rw-r--r--docs/examples/evhiperfifo.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/examples/evhiperfifo.c b/docs/examples/evhiperfifo.c
index 38ea312be..4d77d5294 100644
--- a/docs/examples/evhiperfifo.c
+++ b/docs/examples/evhiperfifo.c
@@ -203,8 +203,8 @@ static void event_cb(EV_P_ struct ev_io *w, int revents)
GlobalInfo *g = (GlobalInfo*) w->data;
CURLMcode rc;
- int action = (revents&EV_READ?CURL_POLL_IN:0)|
- (revents&EV_WRITE?CURL_POLL_OUT:0);
+ int action = ((revents & EV_READ) ? CURL_POLL_IN : 0) |
+ ((revents & EV_WRITE) ? CURL_POLL_OUT : 0);
rc = curl_multi_socket_action(g->multi, w->fd, action, &g->still_running);
mcode_or_die("event_cb: curl_multi_socket_action", rc);
check_multi_info(g);
@@ -247,7 +247,8 @@ static void setsock(SockInfo *f, curl_socket_t s, CURL *e, int act,
{
printf("%s \n", __PRETTY_FUNCTION__);
- int kind = (act&CURL_POLL_IN?EV_READ:0)|(act&CURL_POLL_OUT?EV_WRITE:0);
+ int kind = ((act & CURL_POLL_IN) ? EV_READ : 0) |
+ ((act & CURL_POLL_OUT) ? EV_WRITE : 0);
f->sockfd = s;
f->action = act;