mirror of https://github.com/mpv-player/mpv
common: drop mp_append_utf8_buffer()
This commit is contained in:
parent
7639e05ea8
commit
ec539dad2b
|
@ -105,17 +105,8 @@ bool mp_rect_intersection(struct mp_rect *rc, const struct mp_rect *rc2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Encode the unicode codepoint as UTF-8, and append to the end of the
|
// Encode the unicode codepoint as UTF-8, and append to the end of the
|
||||||
// talloc'ed buffer.
|
// talloc'ed buffer. All guarantees bstr_xappend() give applies, such as
|
||||||
char *mp_append_utf8_buffer(char *buffer, uint32_t codepoint)
|
// implicit \0-termination for convenience.
|
||||||
{
|
|
||||||
char data[8];
|
|
||||||
uint8_t tmp;
|
|
||||||
char *output = data;
|
|
||||||
PUT_UTF8(codepoint, tmp, *output++ = tmp;);
|
|
||||||
return talloc_strndup_append_buffer(buffer, data, output - data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Like mp_append_utf8_buffer, but use bstr_xappend().
|
|
||||||
void mp_append_utf8_bstr(void *talloc_ctx, struct bstr *buf, uint32_t codepoint)
|
void mp_append_utf8_bstr(void *talloc_ctx, struct bstr *buf, uint32_t codepoint)
|
||||||
{
|
{
|
||||||
char data[8];
|
char data[8];
|
||||||
|
|
|
@ -73,8 +73,6 @@ struct mp_rect {
|
||||||
void mp_rect_union(struct mp_rect *rc, const struct mp_rect *src);
|
void mp_rect_union(struct mp_rect *rc, const struct mp_rect *src);
|
||||||
bool mp_rect_intersection(struct mp_rect *rc, const struct mp_rect *rc2);
|
bool mp_rect_intersection(struct mp_rect *rc, const struct mp_rect *rc2);
|
||||||
|
|
||||||
char *mp_append_utf8_buffer(char *buffer, uint32_t codepoint);
|
|
||||||
|
|
||||||
struct bstr;
|
struct bstr;
|
||||||
|
|
||||||
void mp_append_utf8_bstr(void *talloc_ctx, struct bstr *buf, uint32_t codepoint);
|
void mp_append_utf8_bstr(void *talloc_ctx, struct bstr *buf, uint32_t codepoint);
|
||||||
|
|
Loading…
Reference in New Issue