From 0e0a4da9b7677a09e00d27313236e1f333864dd6 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 25 Sep 2012 11:09:04 -0400 Subject: [PATCH] [buffer] Towards template'izing different UTF adders --- src/hb-buffer.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index 6c0f349..5471634 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -917,6 +917,15 @@ hb_buffer_add_utf16 (hb_buffer_t *buffer, #undef UTF_NEXT } +static inline const uint32_t * +hb_utf32_next (const uint32_t *text, + const uint32_t *end, + hb_codepoint_t *unicode) +{ + *unicode = *text; + return text + 1; +} + void hb_buffer_add_utf32 (hb_buffer_t *buffer, const uint32_t *text, @@ -929,7 +938,7 @@ hb_buffer_add_utf32 (hb_buffer_t *buffer, if (unlikely (hb_object_is_inert (buffer))) return; buffer->content_type = HB_BUFFER_CONTENT_TYPE_UNICODE; -#define UTF_NEXT(S, E, U) ((U) = *(S), (S)+1) +#define UTF_NEXT(S, E, U) hb_utf32_next (S, E, &(U)) ADD_UTF (uint32_t); #undef UTF_NEXT } -- 2.7.4