Unverified Commit 6b3dde7f authored by Marcel Raad's avatar Marcel Raad
Browse files

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
parent 5f8b9fe8
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -331,9 +331,9 @@ static int waitperform(struct connectdata *conn, int timeout_ms)
    /* move through the descriptors and ask for processing on them */
    /* move through the descriptors and ask for processing on them */
    for(i = 0; i < num; i++)
    for(i = 0; i < num; i++)
      ares_process_fd((ares_channel)data->state.resolver,
      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].fd:ARES_SOCKET_BAD,
                      pfd[i].revents & (POLLWRNORM|POLLOUT)?
                      (pfd[i].revents & (POLLWRNORM|POLLOUT))?
                      pfd[i].fd:ARES_SOCKET_BAD);
                      pfd[i].fd:ARES_SOCKET_BAD);
  }
  }
  return nfds;
  return nfds;
+2 −2
Original line number Original line Diff line number Diff line
@@ -451,8 +451,8 @@ static int events_socket(struct Curl_easy *easy, /* easy handle */
        m->socket.revents = 0;
        m->socket.revents = 0;
        ev->list = m;
        ev->list = m;
        infof(easy, "socket cb: socket %d ADDED as %s%s\n", s,
        infof(easy, "socket cb: socket %d ADDED as %s%s\n", s,
              what&CURL_POLL_IN?"IN":"",
              (what&CURL_POLL_IN)?"IN":"",
              what&CURL_POLL_OUT?"OUT":"");
              (what&CURL_POLL_OUT)?"OUT":"");
      }
      }
      else
      else
        return CURLE_OUT_OF_MEMORY;
        return CURLE_OUT_OF_MEMORY;
+1 −1
Original line number Original line Diff line number Diff line
@@ -569,7 +569,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
      if(((form->flags & HTTPPOST_FILENAME) ||
      if(((form->flags & HTTPPOST_FILENAME) ||
          (form->flags & HTTPPOST_BUFFER)) &&
          (form->flags & HTTPPOST_BUFFER)) &&
         !form->contenttype) {
         !form->contenttype) {
        char *f = form->flags & HTTPPOST_BUFFER?
        char *f = (form->flags & HTTPPOST_BUFFER)?
          form->showfilename : form->value;
          form->showfilename : form->value;
        char const *type;
        char const *type;
        type = Curl_mime_contenttype(f);
        type = Curl_mime_contenttype(f);
+4 −2
Original line number Original line Diff line number Diff line
@@ -821,8 +821,10 @@ static size_t readback_part(curl_mimepart *part,
    struct curl_slist *hdr = (struct curl_slist *) part->state.ptr;
    struct curl_slist *hdr = (struct curl_slist *) part->state.ptr;
    switch(part->state.state) {
    switch(part->state.state) {
    case MIMESTATE_BEGIN:
    case MIMESTATE_BEGIN:
      mimesetstate(&part->state, part->flags & MIME_BODY_ONLY? MIMESTATE_BODY:
      mimesetstate(&part->state,
                                 MIMESTATE_CURLHEADERS, part->curlheaders);
                   (part->flags & MIME_BODY_ONLY)?
                     MIMESTATE_BODY: MIMESTATE_CURLHEADERS,
                   part->curlheaders);
      break;
      break;
    case MIMESTATE_USERHEADERS:
    case MIMESTATE_USERHEADERS:
      if(!hdr) {
      if(!hdr) {
+2 −2
Original line number Original line Diff line number Diff line
@@ -3056,8 +3056,8 @@ void Curl_multi_dump(struct Curl_multi *multi)
          continue;
          continue;
        }
        }
        fprintf(stderr, "[%s %s] ",
        fprintf(stderr, "[%s %s] ",
                entry->action&CURL_POLL_IN?"RECVING":"",
                (entry->action&CURL_POLL_IN)?"RECVING":"",
                entry->action&CURL_POLL_OUT?"SENDING":"");
                (entry->action&CURL_POLL_OUT)?"SENDING":"");
      }
      }
      if(data->numsocks)
      if(data->numsocks)
        fprintf(stderr, "\n");
        fprintf(stderr, "\n");
Loading