Jinoh Kang (@iamahuman) commented about dlls/ws2_32/socket.c:
> }
>
>
> -static BOOL protocol_matches_filter( const int *filter, int protocol )
> +static BOOL protocol_matches_filter( const int *filter, unsigned int index )
Would it be more clear to accept `const WSAPROTOCOL_INFOW *` instead of an index into the `supported_protocols` array?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/384#note_3811
Jinoh Kang (@iamahuman) commented about dlls/ws2_32/tests/sock.c:
> + sum += s;
> + carry = s > sum;
> + count -= 2;
> + }
> + sum += carry; /* This won't produce another carry */
> + sum = (sum & 0xffff) + (sum >> 16);
> +
> + if (count) sum += *data; /* LE-only */
> +
> + sum = (sum & 0xffff) + (sum >> 16);
> + /* fold in any carry */
> + sum = (sum & 0xffff) + (sum >> 16);
> +
> + check = ~sum;
> + return check;
> +}
It's much simpler to implement 1's complement checksum without the use of an explicit `carry` variable. How about the following:
```suggestion:-25+0
static UINT16 chksum(BYTE *data, unsigned int count)
{
UINT16 *ptr = (UINT16 *)data, *end = ptr + count / 2;
unsigned int sum = 0;
while (ptr != end)
{
sum += *ptr++;
sum = (sum & 0xffff) + (sum >> 16);
}
if (count % 2)
{
sum += *(BYTE *)ptr; /* LE-only */
sum = (sum & 0xffff) + (sum >> 16);
}
return ~sum;
}
```
Note that `sum` is in range `[0, 0xfffe]` at the start of each iteration. After addition, the range extends to `[0, 0x1fffd]`; however, since `0xfffd + 0x1 = 0xfffe`, the range folds back to `[0, 0xfffe]`.
Ditto for tests in ntdll.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/384#note_3810
--
v2: winegstreamer: Check H264 ProcessOutput sample against actual image size.
winegstreamer: Use H264 input media type frame size when specified.
winegstreamer: Implement H264 SetOutputType by reconfiguring the pipeline.
https://gitlab.winehq.org/wine/wine/-/merge_requests/405