From: Behdad Esfahbod Date: Thu, 22 Apr 2010 02:30:36 +0000 (-0400) Subject: Remove ArrayAfter, use StructAfter in place X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e2f43edf2f49f4047e28b1ce2ea95938536de9c;p=platform%2Fupstream%2FlibHarfBuzzSharp.git Remove ArrayAfter, use StructAfter in place --- diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index 7c87705..2176e38 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -48,6 +48,8 @@ template inline char * DeConstCharP (const Type X) { return (cha #define CAST(T,X,Ofs) (*(reinterpret_cast(CharP(&(X)) + Ofs))) +/* StructAfter(X) returns the struct T& that is placed after X. + * Works with X of variable size also. */ template inline const Type& StructAfter(const TObject &X) { @@ -59,17 +61,6 @@ inline Type& StructAfter(TObject &X) return * reinterpret_cast (CharP (&X) + X.get_size()); } -template -inline const Type* ArrayAfter(const TObject &X) -{ - return reinterpret_cast (ConstCharP (&X) + X.get_size()); -} -template -inline Type* ArrayAfter(TObject &X) -{ - return reinterpret_cast (CharP (&X) + X.get_size()); -} - /* * Class features @@ -522,8 +513,8 @@ struct LongOffsetTo : GenericOffsetTo {}; template struct GenericArrayOf { - const Type *const_array(void) const { return ArrayAfter (len); } - Type *array(void) { return ArrayAfter (len); } + const Type *const_array(void) const { return &StructAfter (len); } + Type *array(void) { return &StructAfter (len); } const Type *const_sub_array (unsigned int start_offset, unsigned int *pcount /* IN/OUT */) const { @@ -640,8 +631,8 @@ struct OffsetListOf : OffsetArrayOf template struct HeadlessArrayOf { - const Type *const_array(void) const { return ArrayAfter (len); } - Type *array(void) { return ArrayAfter (len); } + const Type *const_array(void) const { return &StructAfter (len); } + Type *array(void) { return &StructAfter (len); } inline const Type& operator [] (unsigned int i) const {