mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
"char" is (potentially) signed, so casting it to uint32_t will sign-extend it. Because we use |= to assign it to "word", and don't otherwise mask out the higher bits either, we effectively set subsequent bytes in the same word to 0xff for input bytes > 0x7f. That potentially includes the \0 terminator. For example, "é" (U+00e9) is "\xc3\xa9" when encoded as UTF-8, and would get us 0xffffffc3 instead of 0x0000a9c3.