bdf: Improve bdf_property_t.value names for LP64 platforms.

This commit is contained in:
suzuki toshiya 2009-07-03 18:01:26 +09:00
parent 436db93a58
commit 2d7050ec80
4 changed files with 45 additions and 16 deletions

View File

@ -1,3 +1,22 @@
2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
bdf: Improve bdf_property_t.value names for LP64 platforms.
* src/bdf/bdf.h: In bdf_property_t.value, the member
`int32' is replaced by `l', `card32' is replaced by
`ul', to fix the difference between the name and the
types on LP64 platforms.
* src/bdf/bdfdrivr.c (BDF_Face_Init): Reflect
bdf_property_t.value change.
(bdf_get_bdf_property): Reflect bdf_property_t.value
change, with appropriate casts to FT_Int32/FT_UInt32.
Their destinations BDF_PropertyRec.{integer|cardinal}
are public and explicitly defined as FT_Int32/FT_UInt32.
* src/bdf/bdflib.c (_bdf_add_property): Reflect
bdf_property_t.value change.
2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
bdf: Fix some data types mismatching with their sources.

View File

@ -114,8 +114,8 @@ FT_BEGIN_HEADER
union
{
char* atom;
long int32;
unsigned long card32;
long l;
unsigned long ul;
} value; /* Value of the property. */

View File

@ -432,7 +432,7 @@ THE SOFTWARE.
prop = bdf_get_font_property( font, "AVERAGE_WIDTH" );
if ( prop )
bsize->width = (FT_Short)( ( prop->value.int32 + 5 ) / 10 );
bsize->width = (FT_Short)( ( prop->value.l + 5 ) / 10 );
else
bsize->width = (FT_Short)( bsize->height * 2/3 );
@ -440,21 +440,21 @@ THE SOFTWARE.
if ( prop )
/* convert from 722.7 decipoints to 72 points per inch */
bsize->size =
(FT_Pos)( ( prop->value.int32 * 64 * 7200 + 36135L ) / 72270L );
(FT_Pos)( ( prop->value.l * 64 * 7200 + 36135L ) / 72270L );
else
bsize->size = bsize->width << 6;
prop = bdf_get_font_property( font, "PIXEL_SIZE" );
if ( prop )
bsize->y_ppem = (FT_Short)prop->value.int32 << 6;
bsize->y_ppem = (FT_Short)prop->value.l << 6;
prop = bdf_get_font_property( font, "RESOLUTION_X" );
if ( prop )
resolution_x = (FT_Short)prop->value.int32;
resolution_x = (FT_Short)prop->value.l;
prop = bdf_get_font_property( font, "RESOLUTION_Y" );
if ( prop )
resolution_y = (FT_Short)prop->value.int32;
resolution_y = (FT_Short)prop->value.l;
if ( bsize->y_ppem == 0 )
{
@ -749,13 +749,23 @@ THE SOFTWARE.
break;
case BDF_INTEGER:
if ( prop->value.l > 0x7FFFFFFFL || prop->value.l < ( -1 - 0x7FFFFFFFL ) )
{
FT_TRACE1(( "bdf_get_bdf_property: " ));
FT_TRACE1(( "too large integer 0x%x is truncated\n" ));
}
aproperty->type = BDF_PROPERTY_TYPE_INTEGER;
aproperty->u.integer = prop->value.int32;
aproperty->u.integer = (FT_Int32)prop->value.l;
break;
case BDF_CARDINAL:
if ( prop->value.ul > 0xFFFFFFFFUL )
{
FT_TRACE1(( "bdf_get_bdf_property: " ));
FT_TRACE1(( "too large cardinal 0x%x is truncated\n" ));
}
aproperty->type = BDF_PROPERTY_TYPE_CARDINAL;
aproperty->u.cardinal = prop->value.card32;
aproperty->u.cardinal = (FT_UInt32)prop->value.ul;
break;
default:

View File

@ -1289,11 +1289,11 @@
break;
case BDF_INTEGER:
fp->value.int32 = _bdf_atol( value, 0, 10 );
fp->value.l = _bdf_atol( value, 0, 10 );
break;
case BDF_CARDINAL:
fp->value.card32 = _bdf_atoul( value, 0, 10 );
fp->value.ul = _bdf_atoul( value, 0, 10 );
break;
default:
@ -1359,11 +1359,11 @@
break;
case BDF_INTEGER:
fp->value.int32 = _bdf_atol( value, 0, 10 );
fp->value.l = _bdf_atol( value, 0, 10 );
break;
case BDF_CARDINAL:
fp->value.card32 = _bdf_atoul( value, 0, 10 );
fp->value.ul = _bdf_atoul( value, 0, 10 );
break;
}
@ -1387,11 +1387,11 @@
/* present, and the SPACING property should override the default */
/* spacing. */
if ( ft_memcmp( name, "DEFAULT_CHAR", 12 ) == 0 )
font->default_char = fp->value.int32;
font->default_char = fp->value.l;
else if ( ft_memcmp( name, "FONT_ASCENT", 11 ) == 0 )
font->font_ascent = fp->value.int32;
font->font_ascent = fp->value.l;
else if ( ft_memcmp( name, "FONT_DESCENT", 12 ) == 0 )
font->font_descent = fp->value.int32;
font->font_descent = fp->value.l;
else if ( ft_memcmp( name, "SPACING", 7 ) == 0 )
{
if ( !fp->value.atom )