[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Devel] BUGREPORT: ATARI-PureC-Compiler with FT_SIZEOF_INT=2
From: |
PORTHOS |
Subject: |
[Devel] BUGREPORT: ATARI-PureC-Compiler with FT_SIZEOF_INT=2 |
Date: |
Thu, 19 Sep 2002 13:20:42 +0200 |
Hallo,
i have a big problem with psh_globals_new in pshglob.c
static FT_Error
psh_globals_new( FT_Memory memory,
T1_Private* priv,
PSH_Globals *aglobals )
{
PSH_Globals globals;
FT_Error error;
if ( !FT_NEW( globals ) )
{
FT_UInt count;
FT_Short* read;
globals->memory = memory;
/* copy standard widths */
{
PSH_Dimension dim = &globals->dimension[1];
PSH_Width write = dim->stdw.widths;
write->org = priv->standard_width[0];
write++;
read = priv->snap_widths;
for ( count = priv->num_snap_widths; count > 0; count-- )
2: ----->just for safety, count should be limited to PS_GLOBALS_MAX_STD_WIDTH
{
write->org = *read;
write++;
read++;
}
dim->stdw.count = (FT_UInt) (write - dim->stdw.widths);
1: ----->My compiler does this wrong. dim->stdw.count is set to 18 but
1: ----->the array has only PS_GLOBALS_MAX_STD_WIDTH = 16 records!
}
3: ----->it would be easier to calculate:
dim->stdw.count = priv->num_snap_widths;
So, all together I would prefer:
/* copy standard widths */
{
PSH_Dimension dim = &globals->dimension[1];
PSH_Width write = dim->stdw.widths;
write->org = priv->standard_width[0];
write++;
read = priv->snap_widths;
count =
(priv->num_snap_widths>PS_GLOBALS_MAX_STD_WIDTH) ?
PS_GLOBALS_MAX_STD_WIDTH : priv->num_snap_widths;
dim->stdw.count = count;
for ( ; count > 0; count-- )
{
write->org = *read;
write++;
read++;
}
}
--
Mit freundlichen Grüßen,
Wolfgang Domröse
mailto:address@hidden