From 68e12e68f813bfd22dda040463d042cc06b958ec Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 13 May 2019 17:28:59 -0700 Subject: [PATCH] Fix more semi-colon issues --- src/hb-coretext.cc | 4 ++-- src/hb-directwrite.cc | 4 ++-- src/hb-graphite2.cc | 4 ++-- src/hb-uniscribe.cc | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc index 383428570..85993d196 100644 --- a/src/hb-coretext.cc +++ b/src/hb-coretext.cc @@ -608,7 +608,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, #define ALLOCATE_ARRAY(Type, name, len, on_no_room) \ Type *name = (Type *) scratch; \ - { \ + do { \ unsigned int _consumed = DIV_CEIL ((len) * sizeof (Type), sizeof (*scratch)); \ if (unlikely (_consumed > scratch_size)) \ { \ @@ -617,7 +617,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, } \ scratch += _consumed; \ scratch_size -= _consumed; \ - } + } while (0) ALLOCATE_ARRAY (UniChar, pchars, buffer->len * 2, /*nothing*/); unsigned int chars_len = 0; diff --git a/src/hb-directwrite.cc b/src/hb-directwrite.cc index 6b2761e83..057ae3305 100644 --- a/src/hb-directwrite.cc +++ b/src/hb-directwrite.cc @@ -530,12 +530,12 @@ _hb_directwrite_shape_full (hb_shape_plan_t *shape_plan, hb_buffer_t::scratch_buffer_t *scratch = buffer->get_scratch_buffer (&scratch_size); #define ALLOCATE_ARRAY(Type, name, len) \ Type *name = (Type *) scratch; \ - { \ + do { \ unsigned int _consumed = DIV_CEIL ((len) * sizeof (Type), sizeof (*scratch)); \ assert (_consumed <= scratch_size); \ scratch += _consumed; \ scratch_size -= _consumed; \ - } + } while (0) #define utf16_index() var1.u32 diff --git a/src/hb-graphite2.cc b/src/hb-graphite2.cc index 5b1ba4515..f799f8b22 100644 --- a/src/hb-graphite2.cc +++ b/src/hb-graphite2.cc @@ -310,12 +310,12 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan HB_UNUSED, #define ALLOCATE_ARRAY(Type, name, len) \ Type *name = (Type *) scratch; \ - { \ + do { \ unsigned int _consumed = DIV_CEIL ((len) * sizeof (Type), sizeof (*scratch)); \ assert (_consumed <= scratch_size); \ scratch += _consumed; \ scratch_size -= _consumed; \ - } + } while (0) ALLOCATE_ARRAY (hb_graphite2_cluster_t, clusters, buffer->len); ALLOCATE_ARRAY (hb_codepoint_t, gids, glyph_count); diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc index 4e004416b..f97ed91fc 100644 --- a/src/hb-uniscribe.cc +++ b/src/hb-uniscribe.cc @@ -728,12 +728,12 @@ retry: #define ALLOCATE_ARRAY(Type, name, len) \ Type *name = (Type *) scratch; \ - { \ + do { \ unsigned int _consumed = DIV_CEIL ((len) * sizeof (Type), sizeof (*scratch)); \ assert (_consumed <= scratch_size); \ scratch += _consumed; \ scratch_size -= _consumed; \ - } + } while (0) #define utf16_index() var1.u32