From bcc8f32b4c46cd73f591924c64a6f63df6eaf9e7 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 27 Feb 2013 12:02:42 -0500 Subject: [PATCH] [buffer] Minor --- src/hb-buffer-serialize.cc | 10 +++++++--- src/hb-buffer.h | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/hb-buffer-serialize.cc b/src/hb-buffer-serialize.cc index b9561162a..bd23208d5 100644 --- a/src/hb-buffer-serialize.cc +++ b/src/hb-buffer-serialize.cc @@ -202,13 +202,17 @@ hb_buffer_serialize_glyphs (hb_buffer_t *buffer, unsigned int end, char *buf, unsigned int buf_size, - unsigned int *buf_consumed, + unsigned int *buf_consumed, /* May be NULL */ hb_font_t *font, /* May be NULL */ hb_buffer_serialize_format_t format, hb_buffer_serialize_flags_t flags) { assert (start <= end && end <= buffer->len); + unsigned int sconsumed; + if (!buf_consumed) + buf_consumed = &sconsumed; + *buf_consumed = 0; assert ((!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALID) || @@ -242,8 +246,8 @@ hb_buffer_serialize_glyphs (hb_buffer_t *buffer, hb_bool_t hb_buffer_deserialize_glyphs (hb_buffer_t *buffer, const char *buf, - unsigned int buf_len, - unsigned int *buf_consumed, + unsigned int buf_len, /* -1 means nul-terminated */ + unsigned int *buf_consumed, /* May be NULL */ hb_font_t *font, /* May be NULL */ hb_buffer_serialize_format_t format) { diff --git a/src/hb-buffer.h b/src/hb-buffer.h index 5386e360a..d2d17a55b 100644 --- a/src/hb-buffer.h +++ b/src/hb-buffer.h @@ -304,7 +304,7 @@ hb_buffer_serialize_glyphs (hb_buffer_t *buffer, unsigned int end, char *buf, unsigned int buf_size, - unsigned int *buf_consumed, + unsigned int *buf_consumed, /* May be NULL */ hb_font_t *font, /* May be NULL */ hb_buffer_serialize_format_t format, hb_buffer_serialize_flags_t flags); @@ -313,7 +313,7 @@ hb_bool_t hb_buffer_deserialize_glyphs (hb_buffer_t *buffer, const char *buf, unsigned int buf_len, - unsigned int *buf_consumed, + unsigned int *buf_consumed, /* May be NULL */ hb_font_t *font, /* May be NULL */ hb_buffer_serialize_format_t format);