pcf: Improve PCF_PropertyRec.value names on LP64 platforms.

This commit is contained in:
suzuki toshiya 2009-07-03 18:01:26 +09:00
parent 902cff743d
commit cf37b538d8
4 changed files with 33 additions and 10 deletions

View File

@ -1,3 +1,21 @@
2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
pcf: Improve PCF_PropertyRec.value names on LP64 platforms.
* src/pcf/pcf.h: In PCF_PropertyRec.value, the member
`integer' is replaced by `l', `cardinal' is replaced
by `ul', to fix the difference between the name and
the types on LP64 platforms.
* src/pcf/pcfdrivr.c (pcf_get_bdf_property): Reflect
PCF_PropertyRec.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/pcf/pcfread.c (pcf_get_properties, pcf_load_font):
Reflect PCF_PropertyRec.value change.
2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
pcf: Fix some data types mismatching with their sources.

View File

@ -72,8 +72,8 @@ FT_BEGIN_HEADER
union
{
FT_String* atom;
FT_Long integer;
FT_ULong cardinal;
FT_Long l;
FT_ULong ul;
} value;

View File

@ -585,12 +585,17 @@ THE SOFTWARE.
}
else
{
if ( prop->value.l > 0x7FFFFFFFL || prop->value.l < ( -1 - 0x7FFFFFFFL ) )
{
FT_TRACE1(( "pcf_get_bdf_property: " ));
FT_TRACE1(( "too large integer 0x%x is truncated\n" ));
}
/* Apparently, the PCF driver loads all properties as signed integers!
* This really doesn't seem to be a problem, because this is
* sufficient for any meaningful values.
*/
aproperty->type = BDF_PROPERTY_TYPE_INTEGER;
aproperty->u.integer = prop->value.integer;
aproperty->u.integer = (FT_Int32)prop->value.l;
}
return 0;
}

View File

@ -542,9 +542,9 @@ THE SOFTWARE.
}
else
{
properties[i].value.integer = props[i].value;
properties[i].value.l = props[i].value;
FT_TRACE4(( " %d\n", properties[i].value.integer ));
FT_TRACE4(( " %d\n", properties[i].value.l ));
}
}
@ -1201,7 +1201,7 @@ THE SOFTWARE.
prop = pcf_find_property( face, "AVERAGE_WIDTH" );
if ( prop )
bsize->width = (FT_Short)( ( prop->value.integer + 5 ) / 10 );
bsize->width = (FT_Short)( ( prop->value.l + 5 ) / 10 );
else
bsize->width = (FT_Short)( bsize->height * 2/3 );
@ -1209,19 +1209,19 @@ THE SOFTWARE.
if ( prop )
/* convert from 722.7 decipoints to 72 points per inch */
bsize->size =
(FT_Pos)( ( prop->value.integer * 64 * 7200 + 36135L ) / 72270L );
(FT_Pos)( ( prop->value.l * 64 * 7200 + 36135L ) / 72270L );
prop = pcf_find_property( face, "PIXEL_SIZE" );
if ( prop )
bsize->y_ppem = (FT_Short)prop->value.integer << 6;
bsize->y_ppem = (FT_Short)prop->value.l << 6;
prop = pcf_find_property( face, "RESOLUTION_X" );
if ( prop )
resolution_x = (FT_Short)prop->value.integer;
resolution_x = (FT_Short)prop->value.l;
prop = pcf_find_property( face, "RESOLUTION_Y" );
if ( prop )
resolution_y = (FT_Short)prop->value.integer;
resolution_y = (FT_Short)prop->value.l;
if ( bsize->y_ppem == 0 )
{