Clarified calculation precedence for '&' and '?'

This commit is contained in:
Phuntsok Drak-pa 2018-04-15 16:57:00 +02:00 committed by GitHub
parent 9950fd1e42
commit d88b89ba89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,7 +45,7 @@ void write_utf8(FILE* t_out, uint32_t t_c) {
ustring str(loops + 1, 0); ustring str(loops + 1, 0);
for (size_t i = 0; i <= loops; ++i) { for (size_t i = 0; i <= loops; ++i) {
str[i] = static_cast<unsigned char>( str[i] = static_cast<unsigned char>(
((t_c & (i == loops) ? 0x3F : 0xFF) >> ((loops - i) * 6)) + ((t_c & ((i == loops) ? 0x3F : 0xFF)) >> ((loops - i) * 6)) +
((i == 0) ? header : 0x80)); ((i == 0) ? header : 0x80));
} }
fwrite(str.data(), sizeof(unsigned char), str.size(), t_out); fwrite(str.data(), sizeof(unsigned char), str.size(), t_out);