freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] Discrepancy in FT_MulFix macros and int sizes


From: Behdad Esfahbod
Subject: Re: [ft-devel] Discrepancy in FT_MulFix macros and int sizes
Date: Wed, 19 Nov 2014 16:18:36 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

On 14-11-18 09:32 PM, Werner LEMBERG wrote:
>> > I was also wondering if FT_Long should be defined synonymous to
>> > FT_Int32, etc.
>> > 
>> >   typedef FT_Long FT_Int32
> Hmm.  FT_Int32 is *exactly* 32bit, while FT_Long is simply a typedef
> to `long' and thus *at least* 32bit, depending on the compiler and/or
> platform.
> 
> On 64bit platforms I think that compilers produce more efficient code
> for the latter.

My understanding is that on 64bit platforms, 65bit operations are not
significantly slower than 32bit (unlike other platforms), but still, int maps
to the type that is fastest on the CPU.

At any rate, I'm guessing that the use of FT_Long in FreeType is a relic of
times when int could mean 16bit.  We should move towards using FT_Int or
FT_Int32 where it makes sense and there's no API change implications.

Thanks,

-- 
behdad
http://behdad.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]