Re: Partial fix for 687029, Different results on Alpha, 2nd installment
"Igor V. Melichev" <[email protected]>
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Message-ID | <[email protected]> |
Alex, > ----- Original Message ----- > From: "Alex Cherepanov" <[email protected]> > To: <[email protected]> > Cc: <[email protected]> > Sent: Saturday, November 15, 2003 10:55 PM > Subject: Re: Partial fix for 687029, Different results on Alpha, 2nd installment > Igor V. Melichev wrote: > > > Also please explain, why the change is needed at all. > The structures in ttfsfnt.h describe the data blocks in TTF file, > assuming that they are tightly packed. The size of types as they > were defined was platform-dependent. > ttfmain.c uses the size of the structure to access the file: > r->Seek(r, this->t_head.nPos + offset_of(sfnt_FontHeader, flags)); > On 64-bit platform it seeks to wrong places resulting in a > selection of SEGV's and /rangecheck's. > > There may be other places where the structures are read from the > file directly. Using the platform-independent types fixes this > bug and saves from future ones. All this is known. I'd like to understand the reason for the folllowing changes : 1. -typedef unsigned char uint8; /* 8-bit unsigned integer */ -typedef signed char int8; /* 8-bit signed integer */ They look unused, because you don't add a new definition. What is the reason for removing them from Apples's source ? 2. -typedef unsigned short int uint16; /* 16-bit unsigned integer */ -typedef signed short int int16; /* 16-bit signed integer */ Do we have a platform, on which short isn't a 2 byte integer ? With no dependence on that, why not +typedef uint16_t uint16; /* 16-bit unsigned integer */ +typedef int16_t int16; /* 16-bit signed integer */ ? This should minimize consequences. 3. -typedef unsigned long int uint32; /* 32-bit unsigned integer */ -typedef signed long int int32; /* 32-bit signed integer */ Same as above. > Do you still want to keep old types? I want to minimize changes to 3d party sources. Therefore ORIGINAL names are preferrable. I don't want to repeat your work after 3 years when a new version of Apple's or Free Type sources appear. Also after all lines had changed, the 'diff' utility won't work. Igor.