clang-tidy: add missing and delete redundant parentheses
No binary (build failed)
—
(log yok)
| @@ -219,7 +219,7 @@ void *curl_dbg_malloc(size_t wantedsize, int line, const char *source) | |
| /* alloc at least 64 bytes */ | |
| size = sizeof(struct memdebug) + wantedsize; | |
| - | mem = (Curl_cmalloc)(size); |
| + | mem = Curl_cmalloc(size); |
| if(mem) { | |
| mem->size = wantedsize; | |
| } | |
| @@ -249,7 +249,7 @@ void *curl_dbg_calloc(size_t wanted_elements, size_t wanted_size, | |
| user_size = wanted_size * wanted_elements; | |
| size = sizeof(struct memdebug) + user_size; | |
| - | mem = (Curl_ccalloc)(1, size); |
| + | mem = Curl_ccalloc(1, size); |
| if(mem) | |
| mem->size = user_size; | |
| @@ -344,7 +344,7 @@ void *curl_dbg_realloc(void *ptr, size_t wantedsize, | |
| # pragma warning(pop) | |
| #endif | |
| - | mem = (Curl_crealloc)(mem, size); |
| + | mem = Curl_crealloc(mem, size); |
| if(source) | |
| curl_dbg_log_locked("MEM %s:%d realloc(%p, %zu) = %p\n", | |
| source, line, (void *)ptr, wantedsize, | |
| @@ -380,7 +380,7 @@ void curl_dbg_free(void *ptr, int line, const char *source) | |
| #endif | |
| /* free for real */ | |
| - | (Curl_cfree)(mem); |
| + | Curl_cfree(mem); |
| } | |
| } | |
| @@ -423,7 +423,7 @@ static curl_off_t encoder_base64_size(curl_mimepart *part) | |
| return size; /* Unknown size or no data. */ | |
| /* Compute base64 character count. */ | |
| - | size = 4 * (1 + (size - 1) / 3); |
| + | size = 4 * (1 + ((size - 1) / 3)); |
| /* Effective character count must include CRLFs. */ | |
| return size + (2 * ((size - 1) / MAX_ENCODED_LINE_LENGTH)); | |
| @@ -676,9 +676,10 @@ static bool out_double(void *userp, | |
| #pragma GCC diagnostic push | |
| #pragma GCC diagnostic ignored "-Wformat-nonliteral" | |
| #endif | |
| + | /* !checksrc! disable BANNEDFUNC 1 */ |
| /* !checksrc! disable LONGLINE */ | |
| /* NOLINTNEXTLINE(clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling) */ | |
| - | (snprintf)(work, BUFFSIZE, formatbuf, dnum); |
| + | snprintf(work, BUFFSIZE, formatbuf, dnum); |
| #if defined(__GNUC__) || defined(__clang__) | |
| #pragma GCC diagnostic pop | |
| #endif | |
| @@ -422,7 +422,7 @@ static int parsedate(const char *date, time_t *output) | |
| (num_digits == 4) && | |
| (val <= 1400) && | |
| (indate < date) && | |
| - | ((date[-1] == '+' || date[-1] == '-'))) { |
| + | (date[-1] == '+' || date[-1] == '-')) { |
| /* four digits and a value less than or equal to 1400 (to take into | |
| account all sorts of funny time zone diffs) and it is preceded | |
| with a plus or minus. This is a time zone indication. 1400 is | |
| @@ -432,7 +432,7 @@ static int parsedate(const char *date, time_t *output) | |
| anyone has a more authoritative source for the exact maximum time | |
| zone offsets, please speak up! */ | |
| found = TRUE; | |
| - | tzoff = (val / 100 * 60 + val % 100) * 60; |
| + | tzoff = ((val / 100 * 60) + (val % 100)) * 60; |
| /* the + and - prefix indicates the local time compared to GMT, | |
| this we need their reversed math to get what we want */ | |
| @@ -486,7 +486,7 @@ static CURLcode tftp_tx(struct tftp_conn *state, tftp_event_t event) | |
| break; | |
| default: | |
| - | failf(data, "tftp_tx: internal error, event: %i", (int)(event)); |
| + | failf(data, "tftp_tx: internal error, event: %i", (int)event); |
| break; | |
| } | |
| @@ -870,8 +870,8 @@ CURLcode Curl_xfer_send_close(struct Curl_easy *data) | |
| bool Curl_xfer_is_blocked(struct Curl_easy *data) | |
| { | |
| - | bool want_send = ((data)->req.keepon & KEEP_SEND); |
| - | bool want_recv = ((data)->req.keepon & KEEP_RECV); |
| + | bool want_send = (data->req.keepon & KEEP_SEND); |
| + | bool want_recv = (data->req.keepon & KEEP_RECV); |
| if(!want_send) | |
| return want_recv && Curl_xfer_recv_is_paused(data); | |
| else if(!want_recv) | |