msvc: drop exception, make BIT() a bitfield with Visual Studio

Add casts to `bool`, or use `bit` type in local variables, where
neccessary to avoid MSVC compiler warnings C4242.

Note: There may remain places needing the above updates, where not
tested in CI, and missed in manual review.

Also:
- urldata: convert struct field `connect_only` to bitfield to match its
  counterpart in another struct.
- rename curl-specific `bit` type to `curl_bit`.

Closes #20142
This commit is contained in:
Viktor Szakats 2026-01-01 16:38:56 +01:00
parent 57ff2d6c91
commit 85c841cb45
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
32 changed files with 73 additions and 73 deletions

View file

@ -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)) {