From 061cb4649342b005fb1de93abae25e889cc560bd Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 13 Nov 2013 14:50:25 -0500 Subject: [PATCH] Use long alignment for scratch buffer Fixes last of scratch alignment warnings in hb-coretext. --- src/hb-buffer-private.hh | 2 +- src/hb-buffer.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hb-buffer-private.hh b/src/hb-buffer-private.hh index 478bad0ef..d3ed4491e 100644 --- a/src/hb-buffer-private.hh +++ b/src/hb-buffer-private.hh @@ -186,7 +186,7 @@ struct hb_buffer_t { HB_INTERNAL bool make_room_for (unsigned int num_in, unsigned int num_out); HB_INTERNAL bool shift_forward (unsigned int count); - typedef int scratch_buffer_t; + typedef long scratch_buffer_t; HB_INTERNAL scratch_buffer_t *get_scratch_buffer (unsigned int *size); inline void clear_context (unsigned int side) { context_len[side] = 0; } diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index df2ad7360..bbf8ea0f9 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -161,9 +161,9 @@ hb_buffer_t::get_scratch_buffer (unsigned int *size) out_len = 0; out_info = info; - ASSERT_STATIC (sizeof (pos[0]) % sizeof (scratch_buffer_t) == 0); + assert ((uintptr_t) pos % sizeof (scratch_buffer_t) == 0); *size = allocated * sizeof (pos[0]) / sizeof (scratch_buffer_t); - return (scratch_buffer_t *) pos; + return (scratch_buffer_t *) (void *) pos; }