diff options
author | David Turner <david@freetype.org> | 2005-03-03 14:00:23 +0000 |
---|---|---|
committer | David Turner <david@freetype.org> | 2005-03-03 14:00:23 +0000 |
commit | 683973b47cb634dd80ac4863a556633ef1a16c03 (patch) | |
tree | ed0d04fb00a53a4156d32cbb4ba74f596ccf888b /src/base/ftutil.c | |
parent | 0780817a61528391d7a85023b3c3c23ef6565729 (diff) | |
download | freetype2-683973b47cb634dd80ac4863a556633ef1a16c03.tar.gz |
* include/freetype/internal/ftobjs.h, src/base/ftutil.c (ft_highpow2),
src/pfr/pfrload.c, src/pfr/pfrobjs.c, src/pfr/pfrtypes.h: implement
FT_OPTIMIZE_MEMORY, the kerning table is not loaded into the heap
anymore.
Diffstat (limited to 'src/base/ftutil.c')
-rw-r--r-- | src/base/ftutil.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/base/ftutil.c b/src/base/ftutil.c index ac3760f2d..317cd95fb 100644 --- a/src/base/ftutil.c +++ b/src/base/ftutil.c @@ -398,4 +398,24 @@ } + FT_BASE( FT_UInt32 ) + ft_highpow2( FT_UInt32 value ) + { + FT_UInt32 value2; + + /* we simply clear the lowest bit in each iteration. when + * we reach 0, we now that the previous value was our result + */ + for ( ;; ) + { + value2 = value & (value-1); /* clear lowest bit */ + if ( value2 == 0 ) + break; + + value = value2; + } + return value; + } + + /* END */ |