[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Freetype] Freetype 2.04: One problem and one minor complaint.
From: |
Pedriana, Paul |
Subject: |
[Freetype] Freetype 2.04: One problem and one minor complaint. |
Date: |
Thu, 12 Jul 2001 10:44:59 -0700 |
I just yesterday updated from my old beta Freetype 2 to
Freetype 2.04. In doing so, I noticed what appears to be
an include file bug in ftsynth.c. Here is a snippet of the
problem:
#ifdef FT_CONFIG_OPTION_OLD_CALCS
#include <freetype/internal/ftcalc.h>
...
#else /* FT_CONFIG_OPTION_OLD_CALCS */
...
return ( FT_Sqrt32( L ) << shift );
...
#endif
The problem here is that FT_Sqrt32 is declared in ftcalc.h
but is used without ftcalc.h being #included. My C++ compiler
rightly gives me a warning that FT_Sqrt32 has not been
declared and thus it can only guess that the parameters
are those being passed and the return type is int. I would
guess that this would slip by a C compiler without warning
because I think there is something in the C standard (still?)
that says that an undeclared function is OK and presumed
to return int. This is of course a bad thing, but luckily the
fix is simple: move the ftcalc.h #include up by a couple
lines.
Also, in making my changes to the code I noticed that the
FTBitmap::num_grays variable is either 0 or 256. To be
consistent, shouldn't it be *2* or 256? It has 2 grays, black
and white. If black and white don't count as grays, then
256 should be changed to 254, right? Also, in being 0
instead of 2, I can't use a simple log function to calculate
the bit depth. As it stands, I simply check for 0 and
change it to 2 when I see it, and then everything is consistent
mathematically and logically, but as it stands it seems
inconsistent to me.
Thanks. Freetype is great.
- [Freetype] Freetype 2.04: One problem and one minor complaint.,
Pedriana, Paul <=