From ec539dad2b8aeaaac75cfea6eac621530937227a Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 30 Dec 2013 22:49:11 +0100 Subject: common: drop mp_append_utf8_buffer() --- common/common.c | 13 ++----------- common/common.h | 2 -- 2 files changed, 2 insertions(+), 13 deletions(-) (limited to 'common') diff --git a/common/common.c b/common/common.c index 741dc236b9..e9cd70cf41 100644 --- a/common/common.c +++ b/common/common.c @@ -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 -// talloc'ed buffer. -char *mp_append_utf8_buffer(char *buffer, uint32_t codepoint) -{ - 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(). +// talloc'ed buffer. All guarantees bstr_xappend() give applies, such as +// implicit \0-termination for convenience. void mp_append_utf8_bstr(void *talloc_ctx, struct bstr *buf, uint32_t codepoint) { char data[8]; diff --git a/common/common.h b/common/common.h index 7ae18d1b6f..afb0f6ceda 100644 --- a/common/common.h +++ b/common/common.h @@ -73,8 +73,6 @@ struct mp_rect { 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); -char *mp_append_utf8_buffer(char *buffer, uint32_t codepoint); - struct bstr; void mp_append_utf8_bstr(void *talloc_ctx, struct bstr *buf, uint32_t codepoint); -- cgit v1.2.3