msvc: drop exception, make `BIT()` a bitfield with Visual Studio
No binary (build failed)
—
(log yok)
| @@ -199,7 +199,7 @@ err_exit: | |
| static CURL_THREAD_RETURN_T CURL_STDCALL getaddrinfo_thread(void *arg) | |
| { | |
| struct async_thrdd_addr_ctx *addr_ctx = arg; | |
| - | bool do_abort; |
| + | curl_bit do_abort; |
| Curl_mutex_acquire(&addr_ctx->mutx); | |
| do_abort = addr_ctx->do_abort; | |
| @@ -301,7 +301,7 @@ static void async_thrdd_destroy(struct Curl_easy *data) | |
| #endif | |
| if(thrdd->addr && (thrdd->addr->thread_hnd != curl_thread_t_null)) { | |
| - | bool done; |
| + | curl_bit done; |
| Curl_mutex_acquire(&addr->mutx); | |
| #ifndef CURL_DISABLE_SOCKETPAIR | |
| @@ -462,7 +462,7 @@ static void async_thrdd_shutdown(struct Curl_easy *data) | |
| { | |
| struct async_thrdd_ctx *thrdd = &data->state.async.thrdd; | |
| struct async_thrdd_addr_ctx *addr_ctx = thrdd->addr; | |
| - | bool done; |
| + | curl_bit done; |
| if(!addr_ctx) | |
| return; | |
| @@ -569,7 +569,7 @@ CURLcode Curl_async_is_resolved(struct Curl_easy *data, | |
| struct Curl_dns_entry **dns) | |
| { | |
| struct async_thrdd_ctx *thrdd = &data->state.async.thrdd; | |
| - | bool done = FALSE; |
| + | curl_bit done = FALSE; |
| DEBUGASSERT(dns); | |
| *dns = NULL; | |
| @@ -666,7 +666,7 @@ CURLcode Curl_async_pollset(struct Curl_easy *data, struct easy_pollset *ps) | |
| { | |
| struct async_thrdd_ctx *thrdd = &data->state.async.thrdd; | |
| CURLcode result = CURLE_OK; | |
| - | bool thrd_done; |
| + | curl_bit thrd_done; |
| #if !defined(USE_HTTPSRR_ARES) && defined(CURL_DISABLE_SOCKETPAIR) | |
| (void)ps; | |
| @@ -228,7 +228,7 @@ static CURLcode cf_ip_attempt_connect(struct cf_ip_attempt *a, | |
| struct Curl_easy *data, | |
| bool *connected) | |
| { | |
| - | *connected = a->connected; |
| + | *connected = (bool)a->connected; |
| if(!a->result && !*connected) { | |
| /* evaluate again */ | |
| a->result = Curl_conn_cf_connect(a->cf, data, connected); | |
| @@ -1263,7 +1263,7 @@ static CURLcode cf_tcp_connect(struct Curl_cfilter *cf, | |
| } | |
| /* Connect TCP socket */ | |
| - | rc = do_connect(cf, data, cf->conn->bits.tcp_fastopen); |
| + | rc = do_connect(cf, data, (bool)cf->conn->bits.tcp_fastopen); |
| error = SOCKERRNO; | |
| set_local_ip(cf, data); | |
| CURL_TRC_CF(data, cf, "local address %s port %d...", | |
| @@ -513,7 +513,7 @@ CURLcode Curl_conn_connect(struct Curl_easy *data, | |
| return CURLE_FAILED_INIT; | |
| } | |
| - | *done = cf->connected; |
| + | *done = (bool)cf->connected; |
| if(*done) | |
| return CURLE_OK; | |
| @@ -610,7 +610,7 @@ bool Curl_conn_is_connected(struct connectdata *conn, int sockindex) | |
| return FALSE; | |
| cf = conn->cfilter[sockindex]; | |
| if(cf) | |
| - | return cf->connected; |
| + | return (bool)cf->connected; |
| else if(conn->handler->flags & PROTOPT_NONETWORK) | |
| return TRUE; | |
| return FALSE; | |
| @@ -317,7 +317,7 @@ void Curl_conncontrol(struct connectdata *conn, | |
| ((ctrl == CONNCTRL_STREAM) && !is_multiplex); | |
| if((ctrl == CONNCTRL_STREAM) && is_multiplex) | |
| ; /* stream signal on multiplex conn never affects close state */ | |
| - | else if((bit)closeit != conn->bits.close) { |
| + | else if((curl_bit)closeit != conn->bits.close) { |
| conn->bits.close = closeit; /* the only place in the source code that | |
| should assign this bit */ | |
| } | |
| @@ -1169,7 +1169,7 @@ CURLcode Curl_cookie_loadfiles(struct Curl_easy *data) | |
| data->state.cookie_engine = TRUE; | |
| while(list) { | |
| result = cookie_load(data, list->data, data->cookies, | |
| - | data->set.cookiesession); |
| + | (bool)data->set.cookiesession); |
| if(result) | |
| break; | |
| list = list->next; | |
| @@ -59,7 +59,7 @@ static void cshutdn_run_conn_handler(struct Curl_easy *data, | |
| conn->connection_id, conn->bits.aborted)); | |
| /* There are protocol handlers that block on retrieving | |
| * server responses here (FTP). Set a short timeout. */ | |
| - | conn->handler->disconnect(data, conn, conn->bits.aborted); |
| + | conn->handler->disconnect(data, conn, (bool)conn->bits.aborted); |
| } | |
| conn->bits.shutdown_handler = TRUE; | |
| @@ -332,8 +332,8 @@ static bool sasl_choose_krb5(struct Curl_easy *data, struct sasl_ctx *sctx) | |
| Curl_auth_create_gssapi_user_message(data, sctx->conn->user, | |
| sctx->conn->passwd, | |
| service, sctx->conn->host.name, | |
| - | sctx->sasl->mutual_auth, NULL, |
| - | krb5, &sctx->resp); |
| + | (bool)sctx->sasl->mutual_auth, |
| + | NULL, krb5, &sctx->resp); |
| } | |
| return TRUE; | |
| } | |
| @@ -712,7 +712,7 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct Curl_easy *data, | |
| result = !krb5 ? CURLE_OUT_OF_MEMORY : | |
| Curl_auth_create_gssapi_user_message(data, conn->user, conn->passwd, | |
| service, conn->host.name, | |
| - | sasl->mutual_auth, NULL, |
| + | (bool)sasl->mutual_auth, NULL, |
| krb5, &resp); | |
| newstate = SASL_GSSAPI_TOKEN; | |
| break; | |
| @@ -728,7 +728,7 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct Curl_easy *data, | |
| message */ | |
| result = Curl_auth_create_gssapi_user_message(data, NULL, NULL, | |
| NULL, NULL, | |
| - | sasl->mutual_auth, |
| + | (bool)sasl->mutual_auth, |
| &serverdata, | |
| krb5, &resp); | |
| newstate = SASL_GSSAPI_NO_DATA; | |
| @@ -801,7 +801,7 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct Curl_easy *data, | |
| sasl->curmech = NULL; | |
| /* Start an alternative SASL authentication */ | |
| - | return Curl_sasl_start(sasl, data, sasl->force_ir, progress); |
| + | return Curl_sasl_start(sasl, data, (bool)sasl->force_ir, progress); |
| default: | |
| failf(data, "Unsupported SASL authentication mechanism"); | |
| result = CURLE_UNSUPPORTED_PROTOCOL; /* Should not happen */ | |
| @@ -233,13 +233,8 @@ struct timeval { | |
| #endif | |
| /* the type we use for storing a single boolean bit */ | |
| - | #ifdef _MSC_VER |
| - | typedef bool bit; |
| - | #define BIT(x) bool x |
| - | #else |
| - | typedef unsigned int bit; |
| - | #define BIT(x) bit x:1 |
| - | #endif |
| + | typedef unsigned int curl_bit; |
| + | #define BIT(x) curl_bit x:1 |
| /* | |
| * Redefine TRUE and FALSE too, to catch current use. With this | |
| @@ -458,7 +458,7 @@ bool Curl_cw_out_is_paused(struct Curl_easy *data) | |
| return FALSE; | |
| ctx = (struct cw_out_ctx *)cw_out; | |
| - | return ctx->paused; |
| + | return (bool)ctx->paused; |
| } | |
| static CURLcode cw_out_flush(struct Curl_easy *data, | |
| @@ -1519,7 +1519,7 @@ static CURLcode ftp_state_type(struct Curl_easy *data, | |
| information. Which in FTP cannot be much more than the file size and | |
| date. */ | |
| if(data->req.no_body && ftpc->file && | |
| - | ftp_need_type(ftpc, data->state.prefer_ascii)) { |
| + | ftp_need_type(ftpc, (bool)data->state.prefer_ascii)) { |
| /* The SIZE command is _not_ RFC 959 specified, and therefore many servers | |
| may not support it! It is however the only way we have to get a file's | |
| size! */ | |
| @@ -1529,7 +1529,8 @@ static CURLcode ftp_state_type(struct Curl_easy *data, | |
| /* Some servers return different sizes for different modes, and thus we | |
| must set the proper type before we check the size */ | |
| - | result = ftp_nb_type(data, ftpc, ftp, data->state.prefer_ascii, FTP_TYPE); |
| + | result = ftp_nb_type(data, ftpc, ftp, (bool)data->state.prefer_ascii, |
| + | FTP_TYPE); |
| if(result) | |
| return result; | |
| } | |
| @@ -1570,7 +1571,7 @@ static CURLcode ftp_state_ul_setup(struct Curl_easy *data, | |
| bool sizechecked) | |
| { | |
| CURLcode result = CURLE_OK; | |
| - | bool append = data->set.remote_append; |
| + | curl_bit append = data->set.remote_append; |
| if((data->state.resume_from && !sizechecked) || | |
| ((data->state.resume_from > 0) && sizechecked)) { | |
| @@ -2239,7 +2240,7 @@ static CURLcode ftp_do_more(struct Curl_easy *data, int *completep) | |
| } | |
| } | |
| else if(data->state.upload) { | |
| - | result = ftp_nb_type(data, ftpc, ftp, data->state.prefer_ascii, |
| + | result = ftp_nb_type(data, ftpc, ftp, (bool)data->state.prefer_ascii, |
| FTP_STOR_TYPE); | |
| if(result) | |
| return result; | |
| @@ -2284,7 +2285,7 @@ static CURLcode ftp_do_more(struct Curl_easy *data, int *completep) | |
| FTP_RETR_LIST_TYPE); | |
| } | |
| else { | |
| - | result = ftp_nb_type(data, ftpc, ftp, data->state.prefer_ascii, |
| + | result = ftp_nb_type(data, ftpc, ftp, (bool)data->state.prefer_ascii, |
| FTP_RETR_TYPE); | |
| } | |
| if(result) | |
| @@ -2417,7 +2418,7 @@ static CURLcode client_write_header(struct Curl_easy *data, | |
| * headers from CONNECT should not automatically be part of the | |
| * output. */ | |
| CURLcode result; | |
| - | bool save = data->set.include_header; |
| + | bool save = (bool)data->set.include_header; |
| data->set.include_header = TRUE; | |
| result = Curl_client_write(data, CLIENTWRITE_HEADER, buf, blen); | |
| data->set.include_header = save; | |
| @@ -527,7 +527,7 @@ static bool http_should_fail(struct Curl_easy *data, int httpcode) | |
| return TRUE; | |
| #endif | |
| - | return data->state.authproblem; |
| + | return (bool)data->state.authproblem; |
| } | |
| /* | |
| @@ -806,7 +806,7 @@ Curl_http_output_auth(struct Curl_easy *data, | |
| #ifndef CURL_DISABLE_PROXY | |
| /* Send proxy authentication header if needed */ | |
| if(conn->bits.httpproxy && | |
| - | (conn->bits.tunnel_proxy == (bit)proxytunnel)) { |
| + | (conn->bits.tunnel_proxy == (curl_bit)proxytunnel)) { |
| result = output_auth_headers(data, conn, authproxy, request, path, TRUE); | |
| if(result) | |
| return result; | |
| @@ -986,7 +986,8 @@ static CURLcode on_stream_frame(struct Curl_cfilter *cf, | |
| else | |
| stream->status_code = -1; | |
| - | h2_xfer_write_resp_hd(cf, data, stream, STRCONST("\r\n"), stream->closed); |
| + | h2_xfer_write_resp_hd(cf, data, stream, STRCONST("\r\n"), |
| + | (bool)stream->closed); |
| if(stream->status_code / 100 != 1) { | |
| stream->resp_hds_complete = TRUE; | |
| @@ -228,7 +228,7 @@ static CURLcode httpchunk_readwrite(struct Curl_easy *data, | |
| case CHUNK_POSTLF: | |
| if(*buf == 0x0a) { | |
| /* The last one before we go back to hex state and start all over. */ | |
| - | Curl_httpchunk_reset(data, ch, ch->ignore_body); |
| + | Curl_httpchunk_reset(data, ch, (bool)ch->ignore_body); |
| } | |
| else if(*buf != 0x0d) { | |
| ch->state = CHUNK_FAILED; | |
| @@ -602,7 +602,7 @@ static CURLcode cr_chunked_read(struct Curl_easy *data, | |
| CURLcode result = CURLE_READ_ERROR; | |
| *pnread = 0; | |
| - | *peos = ctx->eos; |
| + | *peos = (bool)ctx->eos; |
| if(!ctx->eos) { | |
| if(!ctx->read_eos && Curl_bufq_is_empty(&ctx->chunkbuf)) { | |
| @@ -187,7 +187,7 @@ void Curl_http_proxy_get_destination(struct Curl_cfilter *cf, | |
| if(*phostname != cf->conn->host.name) | |
| *pipv6_ip = (strchr(*phostname, ':') != NULL); | |
| else | |
| - | *pipv6_ip = cf->conn->bits.ipv6_ip; |
| + | *pipv6_ip = (bool)cf->conn->bits.ipv6_ip; |
| } | |
| struct cf_proxy_ctx { | |
| @@ -710,7 +710,8 @@ static CURLcode imap_perform_authentication(struct Curl_easy *data, | |
| } | |
| /* Calculate the SASL login details */ | |
| - | result = Curl_sasl_start(&imapc->sasl, data, imapc->ir_supported, &progress); |
| + | result = Curl_sasl_start(&imapc->sasl, data, (bool)imapc->ir_supported, |
| + | &progress); |
| if(!result) { | |
| if(progress == SASL_INPROGRESS) | |
| @@ -2037,7 +2037,7 @@ static CURLcode cr_mime_read(struct Curl_easy *data, | |
| if(ctx->total_len >= 0) | |
| ctx->seen_eos = (ctx->read_len >= ctx->total_len); | |
| *pnread = nread; | |
| - | *peos = ctx->seen_eos; |
| + | *peos = (bool)ctx->seen_eos; |
| break; | |
| } | |
| @@ -623,7 +623,7 @@ static void multi_done_locked(struct connectdata *conn, | |
| Curl_resolv_unlink(data, &data->state.dns[1]); | |
| Curl_dnscache_prune(data); | |
| - | if(multi_conn_should_close(conn, data, mdctx->premature)) { |
| + | if(multi_conn_should_close(conn, data, (bool)mdctx->premature)) { |
| #ifndef CURL_DISABLE_VERBOSE_STRINGS | |
| CURL_TRC_M(data, "multi_done, terminating conn #%" FMT_OFF_T " to %s:%d, " | |
| "forbid=%d, close=%d, premature=%d, conn_multiplex=%d", | |
| @@ -632,7 +632,7 @@ static void multi_done_locked(struct connectdata *conn, | |
| Curl_conn_is_multiplex(conn, FIRSTSOCKET)); | |
| #endif | |
| connclose(conn, "disconnecting"); | |
| - | Curl_conn_terminate(data, conn, mdctx->premature); |
| + | Curl_conn_terminate(data, conn, (bool)mdctx->premature); |
| } | |
| else if(!Curl_conn_get_max_concurrent(data, conn, FIRSTSOCKET)) { | |
| #ifndef CURL_DISABLE_VERBOSE_STRINGS | |
| @@ -640,7 +640,7 @@ static void multi_done_locked(struct connectdata *conn, | |
| " by server, not reusing", conn->connection_id, host, port); | |
| #endif | |
| connclose(conn, "server shutdown"); | |
| - | Curl_conn_terminate(data, conn, mdctx->premature); |
| + | Curl_conn_terminate(data, conn, (bool)mdctx->premature); |
| } | |
| else { | |
| /* the connection is no longer in use by any transfer */ | |
| @@ -1629,7 +1629,7 @@ CURLMcode curl_multi_wakeup(CURLM *m) | |
| */ | |
| static bool multi_ischanged(struct Curl_multi *multi, bool clear) | |
| { | |
| - | bool retval = multi->recheckstate; |
| + | bool retval = (bool)multi->recheckstate; |
| if(clear) | |
| multi->recheckstate = FALSE; | |
| return retval; | |
| @@ -271,9 +271,9 @@ static bool pop3_is_multiline(const char *cmdline) | |
| for(i = 0; i < CURL_ARRAYSIZE(pop3cmds); ++i) { | |
| if(curl_strnequal(pop3cmds[i].name, cmdline, pop3cmds[i].nlen)) { | |
| if(!cmdline[pop3cmds[i].nlen]) | |
| - | return pop3cmds[i].multiline; |
| + | return (bool)pop3cmds[i].multiline; |
| else if(cmdline[pop3cmds[i].nlen] == ' ') | |
| - | return pop3cmds[i].multiline_with_args; |
| + | return (bool)pop3cmds[i].multiline_with_args; |
| } | |
| } | |
| /* Unknown command, assume multi-line for backward compatibility with | |
| @@ -189,7 +189,7 @@ bool Curl_rlimit_active(struct Curl_rlimit *r) | |
| bool Curl_rlimit_is_blocked(struct Curl_rlimit *r) | |
| { | |
| - | return r->blocked; |
| + | return (bool)r->blocked; |
| } | |
| int64_t Curl_rlimit_avail(struct Curl_rlimit *r, | |
| @@ -117,7 +117,7 @@ CURLcode Curl_client_start(struct Curl_easy *data) | |
| bool Curl_creader_will_rewind(struct Curl_easy *data) | |
| { | |
| - | return data->req.rewind_read; |
| + | return (bool)data->req.rewind_read; |
| } | |
| void Curl_creader_set_rewind(struct Curl_easy *data, bool enable) | |
| @@ -727,7 +727,7 @@ static CURLcode cr_in_read(struct Curl_easy *data, | |
| if(ctx->total_len >= 0) | |
| ctx->seen_eos = (ctx->read_len >= ctx->total_len); | |
| *pnread = nread; | |
| - | *peos = ctx->seen_eos; |
| + | *peos = (bool)ctx->seen_eos; |
| break; | |
| } | |
| CURL_TRC_READ(data, "cr_in_read(len=%zu, total=%"FMT_OFF_T | |
| @@ -742,7 +742,7 @@ static bool cr_in_needs_rewind(struct Curl_easy *data, | |
| { | |
| struct cr_in_ctx *ctx = reader->ctx; | |
| (void)data; | |
| - | return ctx->has_used_cb; |
| + | return (bool)ctx->has_used_cb; |
| } | |
| static curl_off_t cr_in_total_length(struct Curl_easy *data, | |
| @@ -903,7 +903,7 @@ static bool cr_in_is_paused(struct Curl_easy *data, | |
| { | |
| struct cr_in_ctx *ctx = reader->ctx; | |
| (void)data; | |
| - | return ctx->is_paused; |
| + | return (bool)ctx->is_paused; |
| } | |
| static const struct Curl_crtype cr_in = { | |
| @@ -1013,7 +1013,7 @@ static CURLcode cr_lc_read(struct Curl_easy *data, | |
| if(ctx->read_eos) | |
| ctx->eos = TRUE; | |
| *pnread = nread; | |
| - | *peos = ctx->eos; |
| + | *peos = (bool)ctx->eos; |
| goto out; | |
| } | |
| @@ -431,7 +431,7 @@ static CURLcode cr_eob_read(struct Curl_easy *data, | |
| CURL_TRC_SMTP(data, "mail body complete, returning EOS"); | |
| ctx->eos = TRUE; | |
| } | |
| - | *peos = ctx->eos; |
| + | *peos = (bool)ctx->eos; |
| DEBUGF(infof(data, "cr_eob_read(%zu) -> %d, %zd, %d", | |
| blen, result, *pnread, *peos)); | |
| return result; | |
| @@ -1308,7 +1308,7 @@ static CURLcode socks_proxy_cf_connect(struct Curl_cfilter *cf, | |
| cf->connected = TRUE; | |
| out: | |
| - | *done = cf->connected; |
| + | *done = (bool)cf->connected; |
| return result; | |
| } | |
| @@ -1309,8 +1309,8 @@ static bool ConnectionExists(struct Curl_easy *data, | |
| /* wait_pipe is TRUE if we encounter a bundle that is undecided. There | |
| * is no matching connection then, yet. */ | |
| *usethis = match.found; | |
| - | *force_reuse = match.force_reuse; |
| - | *waitpipe = match.wait_pipe; |
| + | *force_reuse = (bool)match.force_reuse; |
| + | *waitpipe = (bool)match.wait_pipe; |
| return result; | |
| } | |
| @@ -1367,7 +1367,7 @@ static struct connectdata *allocate_conn(struct Curl_easy *data) | |
| conn->bits.ftp_use_eprt = data->set.ftp_use_eprt; | |
| #endif | |
| conn->ip_version = data->set.ipver; | |
| - | conn->connect_only = data->set.connect_only; |
| + | conn->connect_only = (bool)data->set.connect_only; |
| conn->transport_wanted = TRNSPRT_TCP; /* most of them are TCP streams */ | |
| /* Store the local bind parameters that will be used for this connection */ | |
| @@ -3157,7 +3157,7 @@ static CURLcode resolve_unix(struct Curl_easy *data, | |
| return CURLE_OUT_OF_MEMORY; | |
| hostaddr->addr = Curl_unix2addr(unix_path, &longpath, | |
| - | conn->bits.abstract_unix_socket); |
| + | (bool)conn->bits.abstract_unix_socket); |
| if(!hostaddr->addr) { | |
| if(longpath) | |
| /* Long paths are not supported for now */ | |
| @@ -724,8 +724,8 @@ struct connectdata { | |
| /* HTTP version last responded with by the server or negotiated via ALPN. | |
| * 0 at start, then one of 09, 10, 11, etc. */ | |
| uint8_t httpversion_seen; | |
| - | uint8_t connect_only; |
| uint8_t gssapi_delegation; /* inherited from set.gssapi_delegation */ | |
| + | BIT(connect_only); |
| }; | |
| #ifndef CURL_DISABLE_PROXY | |
| @@ -1158,7 +1158,8 @@ static int cb_h3_end_headers(nghttp3_conn *conn, int64_t stream_id, | |
| if(!stream) | |
| return 0; | |
| /* add a CRLF only if we have received some headers */ | |
| - | h3_xfer_write_resp_hd(cf, data, stream, STRCONST("\r\n"), stream->closed); |
| + | h3_xfer_write_resp_hd(cf, data, stream, STRCONST("\r\n"), |
| + | (bool)stream->closed); |
| CURL_TRC_CF(data, cf, "[%" PRId64 "] end_headers, status=%d", | |
| stream_id, stream->status_code); | |
| @@ -3240,7 +3240,7 @@ static X509_STORE *ossl_get_cached_x509_store(struct Curl_cfilter *cf, | |
| !ossl_cached_x509_store_expired(data, share) && | |
| !ossl_cached_x509_store_different(cf, data, share)) { | |
| store = share->store; | |
| - | *pempty = share->store_is_empty; |
| + | *pempty = (bool)share->store_is_empty; |
| } | |
| return store; | |
| @@ -3333,7 +3333,7 @@ CURLcode Curl_ssl_setup_x509_store(struct Curl_cfilter *cf, | |
| result = ossl_populate_x509_store(cf, data, octx, store); | |
| if(result == CURLE_OK && cache_criteria_met) { | |
| - | ossl_set_cached_x509_store(cf, data, store, octx->store_is_empty); |
| + | ossl_set_cached_x509_store(cf, data, store, (bool)octx->store_is_empty); |
| } | |
| } | |
| @@ -5017,7 +5017,7 @@ static bool ossl_data_pending(struct Curl_cfilter *cf, | |
| { | |
| struct ssl_connect_data *connssl = cf->ctx; | |
| (void)data; | |
| - | return connssl->input_pending; |
| + | return (bool)connssl->input_pending; |
| } | |
| static CURLcode ossl_send(struct Curl_cfilter *cf, | |
| @@ -83,7 +83,7 @@ static bool cr_data_pending(struct Curl_cfilter *cf, | |
| (void)data; | |
| DEBUGASSERT(ctx && ctx->backend); | |
| backend = (struct rustls_ssl_backend_data *)ctx->backend; | |
| - | return backend->data_in_pending; |
| + | return (bool)backend->data_in_pending; |
| } | |
| struct io_ctx { | |
| @@ -1716,7 +1716,7 @@ static CURLcode cf_ssl_create(struct Curl_cfilter **pcf, | |
| #else | |
| ctx = cf_ctx_new(data, alpn_get_spec(data->state.http_neg.wanted, | |
| data->state.http_neg.preferred, | |
| - | conn->bits.tls_enable_alpn)); |
| + | (bool)conn->bits.tls_enable_alpn)); |
| #endif | |
| if(!ctx) { | |
| result = CURLE_OUT_OF_MEMORY; | |
| @@ -1767,7 +1767,7 @@ static CURLcode cf_ssl_proxy_create(struct Curl_cfilter **pcf, | |
| struct ssl_connect_data *ctx; | |
| CURLcode result; | |
| /* ALPN is default, but if user explicitly disables it, obey */ | |
| - | bool use_alpn = data->set.ssl_enable_alpn; |
| + | bool use_alpn = (bool)data->set.ssl_enable_alpn; |
| http_majors wanted = CURL_HTTP_V1x; | |
| (void)conn; | |
| @@ -836,14 +836,15 @@ static CURLcode ws_enc_add_frame(struct Curl_easy *data, | |
| return CURLE_SEND_ERROR; | |
| } | |
| - | result = ws_frame_flags2firstbyte(data, flags, enc->contfragment, &firstb); |
| + | result = ws_frame_flags2firstbyte(data, flags, (bool)enc->contfragment, |
| + | &firstb); |
| if(result) | |
| return result; | |
| /* fragmentation only applies to data frames (text/binary); | |
| * control frames (close/ping/pong) do not affect the CONT status */ | |
| if(flags & (CURLWS_TEXT | CURLWS_BINARY)) { | |
| - | enc->contfragment = (flags & CURLWS_CONT) ? (bit)TRUE : (bit)FALSE; |
| + | enc->contfragment = (curl_bit)((flags & CURLWS_CONT) ? TRUE : FALSE); |
| } | |
| if(flags & CURLWS_PING && payload_len > WS_MAX_CNTRL_LEN) { | |
| @@ -1177,7 +1178,7 @@ static CURLcode cr_ws_read(struct Curl_easy *data, | |
| if(ctx->read_eos) | |
| ctx->eos = TRUE; | |
| *pnread = nread; | |
| - | *peos = ctx->eos; |
| + | *peos = (bool)ctx->eos; |
| goto out; | |
| } | |
| @@ -244,7 +244,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) | |
| struct OutStruct *outs = &per->outs; | |
| struct OperationConfig *config = per->config; | |
| size_t bytes = sz * nmemb; | |
| - | bool is_tty = global->isatty; |
| + | bool is_tty = (bool)global->isatty; |
| #ifdef _WIN32 | |
| CONSOLE_SCREEN_BUFFER_INFO console_info; | |
| intptr_t fhnd; | |
| @@ -1166,8 +1166,8 @@ static CURLcode create_single(struct OperationConfig *config, | |
| CURLSH *share, struct State *state, | |
| bool *added, bool *skipped) | |
| { | |
| - | const bool orig_isatty = global->isatty; |
| - | const bool orig_noprogress = global->noprogress; |
| + | const bool orig_isatty = (bool)global->isatty; |
| + | const bool orig_noprogress = (bool)global->noprogress; |
| CURLcode result = CURLE_OK; | |
| while(state->urlnode) { | |
| struct per_transfer *per = NULL; | |
| @@ -2174,8 +2174,8 @@ static CURLcode run_all_transfers(CURLSH *share, | |
| CURLcode result) | |
| { | |
| /* Save the values of noprogress and isatty to restore them later on */ | |
| - | bool orig_noprogress = global->noprogress; |
| - | bool orig_isatty = global->isatty; |
| + | bool orig_noprogress = (bool)global->noprogress; |
| + | bool orig_isatty = (bool)global->isatty; |
| struct per_transfer *per; | |
| /* Time to actually do the transfers */ | |