freetype-devel
[Top][All Lists]
Advanced

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

[Devel] bug in FT_Library_Version ?


From: Emmanuel Beffara
Subject: [Devel] bug in FT_Library_Version ?
Date: Sat, 14 Sep 2002 00:36:19 +0200
User-agent: Mutt/1.4i

Hello,

I just discovered quite a surprising behaviour in FreeType 2 (I tried
with versions 2.1.2 and 2.1.3): when calling function
FT_Library_Version, by writing

    FT_Library_Version(lib, &major, &minor, &pitch);

the variables major, minor and pitch only get the expected value if they
contained something else than zero before the call. It took me some time
to discover this behaviour, and I finally had a look in the source code
of version 2.1.2. The code of the function (line 2425 in ftobks.c)
contains this:

    if ( *amajor )
      *amajor = major;

    if ( *aminor )
      *aminor = minor;

    if ( *apatch )
      *apatch = patch;

which obviously explains this behaviour. I think what you meant was

    if ( amajor )
      *amajor = major;

and so on, testing that the pointers are not null.

While I'm at it, let me explain the whole story: I'm currently writing a
binding for FreeType 2 for the functional programming language Haskell
(I believed I had something wrong until I discovered the above bug). Is
there something particular that I should know in order to make things
well ? Or do you know if, by chance, someone would have started the same
thing ?

Best regards,
-- 
Emmanuel Beffara



reply via email to

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