X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=unicode.h;h=b6a16e37afe21466577bacc4ba5e27cb8a3c872e;hb=1b1b7cdc86ac07b9b79bfeb201a23d048aefcae6;hp=44a9b92c98b70b8c12aacd9dcdd37e0a9f09de48;hpb=e6010138b92e8ecef4ad729f95efdbce1c9614ee;p=cparser diff --git a/unicode.h b/unicode.h index 44a9b92..b6a16e3 100644 --- a/unicode.h +++ b/unicode.h @@ -50,16 +50,17 @@ static inline void obstack_grow_utf8(struct obstack *const obst, utf32 const c) if (c < 0x80U) { obstack_1grow(obst, c); } else if (c < 0x800) { - obstack_1grow(obst, 0xC0 | (c >> 6)); - obstack_1grow(obst, 0x80 | (c & 0x3F)); + obstack_1grow(obst, 0xC0 | (c >> 6)); + goto one_more; } else if (c < 0x10000) { - obstack_1grow(obst, 0xE0 | ( c >> 12)); - obstack_1grow(obst, 0x80 | ((c >> 6) & 0x3F)); - obstack_1grow(obst, 0x80 | ( c & 0x3F)); + obstack_1grow(obst, 0xE0 | (c >> 12)); + goto two_more; } else { - obstack_1grow(obst, 0xF0 | ( c >> 18)); + obstack_1grow(obst, 0xF0 | (c >> 18)); obstack_1grow(obst, 0x80 | ((c >> 12) & 0x3F)); +two_more: obstack_1grow(obst, 0x80 | ((c >> 6) & 0x3F)); +one_more: obstack_1grow(obst, 0x80 | ( c & 0x3F)); } }