X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fencoding.c;fp=src%2Fencoding.c;h=9337c9a16e6a277b2f4880058103b4cdd1377eee;hp=6d40605b95e026222f5e56d624e92c277aa453dd;hb=4a20aae0dd8469a352517a0b107416ffa99ccc55;hpb=8618172276fae088f311923a61bbf26c3d4d8941 diff --git a/src/encoding.c b/src/encoding.c index 6d40605b..9337c9a1 100644 --- a/src/encoding.c +++ b/src/encoding.c @@ -77,7 +77,7 @@ typedef unsigned (*decode_codepoint_fn)(const u8 *in, size_t remaining, /* Encode the Unicode codepoint @c and return the number of bytes used. */ typedef unsigned (*encode_codepoint_fn)(u32 c, u8 *out); -static inline unsigned +static forceinline unsigned utf8_decode_codepoint(const u8 *in, size_t remaining, bool validate, u32 *c_ret) { if (likely(in[0] < 0x80)) { /* U+0...U+7F */ @@ -124,7 +124,7 @@ invalid: return 1; } -static inline unsigned +static forceinline unsigned utf8_encode_codepoint(u32 c, u8 *out) { if (likely(c < 0x80)) { @@ -152,7 +152,7 @@ utf8_encode_codepoint(u32 c, u8 *out) return 4; } -static inline unsigned +static forceinline unsigned utf16le_decode_codepoint(const u8 *in, size_t remaining, bool validate, u32 *c_ret) { @@ -188,7 +188,7 @@ invalid: return min(remaining, 2); } -static inline unsigned +static forceinline unsigned utf16le_encode_codepoint(u32 c, u8 *out) { if (likely(c < 0x10000)) { @@ -213,7 +213,7 @@ utf16le_encode_codepoint(u32 c, u8 *out) * If the input string is malformed, return @ilseq_err with errno set to EILSEQ. * If out of memory, return WIMLIB_ERR_NOMEM with errno set to ENOMEM. */ -static inline int +static forceinline int convert_string(const u8 * const in, const size_t in_nbytes, u8 **out_ret, size_t *out_nbytes_ret, int ilseq_err,