ref: 418e18f3df04fdfbec597482182769dcf21963e2
parent: 955aff12c0c6c3dfc3fde44dd840bcdcad483fff
author: Alexei Podtelezhnikov <[email protected]>
date: Wed Oct 1 18:36:40 EDT 2014
[base] Use more common `FT_MSB' implementation with masks. * src/base/ftcalc.c (FT_MSB): Updated.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-10-01 Alexei Podtelezhnikov <[email protected]>
+
+ [base] Use more common `FT_MSB' implementation with masks.
+
+ * src/base/ftcalc.c (FT_MSB): Updated.
+
2014-09-30 Alexei Podtelezhnikov <[email protected]>
[base] Clean up.
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -118,27 +118,27 @@
FT_Int shift = 0;
/* determine msb bit index in `shift' */
- if ( z >= ( 1L << 16 ) )
+ if ( z & 0xFFFF0000U )
{
z >>= 16;
shift += 16;
}
- if ( z >= ( 1L << 8 ) )
+ if ( z & 0x0000FF00U )
{
z >>= 8;
shift += 8;
}
- if ( z >= ( 1L << 4 ) )
+ if ( z & 0x000000F0U )
{
z >>= 4;
shift += 4;
}
- if ( z >= ( 1L << 2 ) )
+ if ( z & 0x0000000CU )
{
z >>= 2;
shift += 2;
}
- if ( z >= ( 1L << 1 ) )
+ if ( z & 0x00000002U )
{
/* z >>= 1; */
shift += 1;