diff --git a/ChangeLog b/ChangeLog index 04e456f4c..99c7ba826 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2014-07-16 Alexei Podtelezhnikov + + Replace `ft_highpow2' function. + + * src/pfr/pfrobjs.c (pfr_face_get_kerning): Use `FT_MSB' instead of + `ft_highpow2'. + + * src/base/ftutil.c, include/internal/ftobjs.h (ft_highpow2): Remove + it. + 2014-07-15 Alexei Podtelezhnikov * src/base/ftcalc.c (FT_MSB): Utilize gcc builtins. diff --git a/include/internal/ftobjs.h b/include/internal/ftobjs.h index 701c850eb..faa37f8f5 100644 --- a/include/internal/ftobjs.h +++ b/include/internal/ftobjs.h @@ -82,14 +82,6 @@ FT_BEGIN_HEADER #define FT_PIX_CEIL( x ) FT_PIX_FLOOR( (x) + 63 ) - /* - * Return the highest power of 2 that is <= value; this correspond to - * the highest bit in a given 32-bit value. - */ - FT_BASE( FT_UInt32 ) - ft_highpow2( FT_UInt32 value ); - - /* * character classification functions -- since these are used to parse * font files, we must not use those in which are diff --git a/src/base/ftutil.c b/src/base/ftutil.c index 879d02752..9f3718941 100644 --- a/src/base/ftutil.c +++ b/src/base/ftutil.c @@ -411,26 +411,4 @@ } - FT_BASE_DEF( FT_UInt32 ) - ft_highpow2( FT_UInt32 value ) - { - FT_UInt32 value2; - - - /* - * We simply clear the lowest bit in each iteration. When - * we reach 0, we know that the previous value was our result. - */ - for ( ;; ) - { - value2 = value & (value - 1); /* clear lowest bit */ - if ( value2 == 0 ) - break; - - value = value2; - } - return value; - } - - /* END */ diff --git a/src/pfr/pfrobjs.c b/src/pfr/pfrobjs.c index 194d2df2d..abfff2edf 100644 --- a/src/pfr/pfrobjs.c +++ b/src/pfr/pfrobjs.c @@ -515,7 +515,7 @@ { FT_UInt count = item->pair_count; FT_UInt size = item->pair_size; - FT_UInt power = (FT_UInt)ft_highpow2( (FT_UInt32)count ); + FT_UInt power = 1 << FT_MSB( count ); FT_UInt probe = power * size; FT_UInt extra = count - power; FT_Byte* base = stream->cursor;