mirror of
https://github.com/curl/curl.git
synced 2026-08-25 10:53:37 +03:00
examples: fix "clarify calculation precedence" warnings
Closes https://github.com/curl/curl/pull/3919
This commit is contained in:
parent
acb097ca7f
commit
159ea554af
4 changed files with 18 additions and 15 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue