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.
This commit is contained in:
Alexei Podtelezhnikov 2014-07-16 22:05:56 -04:00
parent 177982e933
commit c0a6f20a4b
4 changed files with 11 additions and 31 deletions

View File

@ -1,3 +1,13 @@
2014-07-16 Alexei Podtelezhnikov <apodtele@gmail.com>
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 <apodtele@gmail.com>
* src/base/ftcalc.c (FT_MSB): Utilize gcc builtins.

View File

@ -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 <ctypes.h> which are

View File

@ -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 */

View File

@ -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;