Fix unicode compiler warning again

This commit is contained in:
herman ten brugge 2022-05-14 15:55:27 +02:00
parent 19cc80788d
commit 53dd065daf

View File

@ -349,10 +349,10 @@ ST_INLN char *unicode_to_utf8 (char *b, uint32_t Uc)
{
if (Uc<0x80) *b++=Uc;
else if (Uc<0x800) *b++=192+Uc/64, *b++=128+Uc%64;
else if (Uc-0xd800u<0x800) return b;
else if (Uc-0xd800u<0x800) goto error;
else if (Uc<0x10000) *b++=224+Uc/4096, *b++=128+Uc/64%64, *b++=128+Uc%64;
else if (Uc<0x110000) *b++=240+Uc/262144, *b++=128+Uc/4096%64, *b++=128+Uc/64%64, *b++=128+Uc%64;
else tcc_error("0x%x is not a valid universal character", Uc);
else error: tcc_error("0x%x is not a valid universal character", Uc);
return b;
}