diff options
author | suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> | 2009-07-03 18:01:22 +0900 |
---|---|---|
committer | suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> | 2009-07-03 18:01:22 +0900 |
commit | 9f8e1eff87e642ead25e71cd49efc5ca4934ceca (patch) | |
tree | a8564581fdbc918ca122e19d5943a7a6e2a59588 | |
parent | 2cd993da4de1bcb74d33d655e4d3279d0c5db877 (diff) | |
download | freetype2-9f8e1eff87e642ead25e71cd49efc5ca4934ceca.tar.gz |
psnames: Handle Unicode codepoints by FT_UInt32 variables.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | src/psnames/psmodule.c | 15 |
2 files changed, 17 insertions, 7 deletions
@@ -1,5 +1,14 @@ 2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> + psnames: Handle Unicode codepoints by FT_UInt32 variables. + + * src/psnames/psmodule.c (BASE_GLYPH): Cast the result + to unsigned 32-bit integer for LP64 platform. + (ps_unicode_value): Return the value by unsigned 32-bit + integer instead of unsigned long. + +2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> + psaux: Use size_t variable to pass the buffer size. * src/psaux/psaux.h (to_bytes): The type of `max_bytes' diff --git a/src/psnames/psmodule.c b/src/psnames/psmodule.c index 6069ad8ee..3a7d27ee4 100644 --- a/src/psnames/psmodule.c +++ b/src/psnames/psmodule.c @@ -34,7 +34,7 @@ #define VARIANT_BIT 0x80000000UL -#define BASE_GLYPH( code ) ( (code) & ~VARIANT_BIT ) +#define BASE_GLYPH( code ) ( (FT_UInt32)( (code) & ~VARIANT_BIT ) ) /* Return the Unicode value corresponding to a given glyph. Note that */ @@ -58,7 +58,7 @@ /* `uniXXXXYYYYZZZZ'... */ FT_Int count; - FT_ULong value = 0; + FT_UInt32 value = 0; const char* p = glyph_name + 3; @@ -93,7 +93,7 @@ if ( *p == '\0' ) return value; if ( *p == '.' ) - return value | VARIANT_BIT; + return (FT_UInt32)( value | VARIANT_BIT ); } } @@ -102,7 +102,7 @@ if ( glyph_name[0] == 'u' ) { FT_Int count; - FT_ULong value = 0; + FT_UInt32 value = 0; const char* p = glyph_name + 1; @@ -133,7 +133,7 @@ if ( *p == '\0' ) return value; if ( *p == '.' ) - return value | VARIANT_BIT; + return (FT_UInt32)( value | VARIANT_BIT ); } } @@ -155,9 +155,10 @@ /* now look up the glyph in the Adobe Glyph List */ if ( !dot ) - return ft_get_adobe_glyph_index( glyph_name, p ); + return (FT_UInt32)ft_get_adobe_glyph_index( glyph_name, p ); else - return ft_get_adobe_glyph_index( glyph_name, dot ) | VARIANT_BIT; + return (FT_UInt32)( ft_get_adobe_glyph_index( glyph_name, dot ) | + VARIANT_BIT ); } } |