Slightly massage buffer-messaging commit

Saves a few bytes.
This commit is contained in:
Behdad Esfahbod 2019-06-05 12:13:49 -07:00
parent 4b1b0bf2f5
commit c7439d4e3a
2 changed files with 7 additions and 4 deletions

View File

@ -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);

View File

@ -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 ())