From: Behdad Esfahbod Date: Mon, 10 May 2010 22:35:02 +0000 (-0400) Subject: Minor X-Git-Tag: submit/master/20120920.151126~7^2~700 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=33afa4e2dc352f08cc094703e3f01d3ecd83b354;p=framework%2Fuifw%2Fharfbuzz.git Minor --- diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index 107b2d1..311f74b 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -81,14 +81,13 @@ inline Type& StructAfter(TObject &X) * Size checking */ -#define ASSERT_SIZE(_thing, _size) ASSERT_STATIC (sizeof (_thing) == (_size)) - -#define _DEFINE_SIZE_ASSERTION(_size) \ - inline void _size_assertion (void) const { ASSERT_SIZE (*this, _size); } +#define _DEFINE_SIZE_ASSERTION(_compare) \ + inline void _size_assertion (void) const \ + { ASSERT_STATIC ((sizeof (*this)) _compare); } #define DEFINE_SIZE_STATIC(size) \ - _DEFINE_SIZE_ASSERTION (size); \ + _DEFINE_SIZE_ASSERTION (== (size)); \ static const unsigned int static_size = (size); \ static const unsigned int min_size = (size) @@ -97,14 +96,15 @@ inline Type& StructAfter(TObject &X) #define VAR0 (VAR+0) #define DEFINE_SIZE_MIN(size) \ + _DEFINE_SIZE_ASSERTION (>= (size)); \ static const unsigned int min_size = (size) #define DEFINE_SIZE_VAR(size, _var_type) \ - _DEFINE_SIZE_ASSERTION ((size) + VAR0 * sizeof (_var_type)); \ + _DEFINE_SIZE_ASSERTION (== (size) + VAR0 * sizeof (_var_type)); \ static const unsigned int min_size = (size) #define DEFINE_SIZE_VAR2(size, _var_type1, _var_type2) \ - _DEFINE_SIZE_ASSERTION ((size) + VAR0 * sizeof (_var_type1) + VAR0 * sizeof (_var_type2)); \ + _DEFINE_SIZE_ASSERTION (== (size) + VAR0 * sizeof (_var_type1) + VAR0 * sizeof (_var_type2)); \ static const unsigned int min_size = (size)