From c7439d4e3a76d596845aad4e4bc860bd61ee47e3 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 5 Jun 2019 12:13:49 -0700 Subject: [PATCH] Slightly massage buffer-messaging commit Saves a few bytes. --- src/hb-buffer.cc | 3 --- src/hb-buffer.hh | 8 +++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index bbbbd227c..5dd83fc2c 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -2026,9 +2026,6 @@ hb_buffer_set_message_func (hb_buffer_t *buffer, bool hb_buffer_t::message_impl (hb_font_t *font, const char *fmt, va_list ap) { -#ifdef HB_NO_BUFFER_MESSAGE - return false; -#endif char buf[100]; vsnprintf (buf, sizeof (buf), fmt, ap); return (bool) this->message_func (this, font, buf, this->message_data); diff --git a/src/hb-buffer.hh b/src/hb-buffer.hh index b2b190ace..9aae38dbb 100644 --- a/src/hb-buffer.hh +++ b/src/hb-buffer.hh @@ -347,7 +347,13 @@ struct hb_buffer_t HB_INTERNAL void sort (unsigned int start, unsigned int end, int(*compar)(const hb_glyph_info_t *, const hb_glyph_info_t *)); - bool messaging () { return unlikely (message_func); } + bool messaging () + { +#ifdef HB_NO_BUFFER_MESSAGE + return false; +#endif + return unlikely (message_func); + } bool message (hb_font_t *font, const char *fmt, ...) HB_PRINTF_FUNC(3, 4) { if (!messaging ())