Commit Graph

4 Commits

Author SHA1 Message Date
Werner Lemberg e8ed2d621e Another round of cppcheck nitpicks.
The call was (from the top-level of the FreeType tree):

  cppcheck --force \
           --enable=all \
           -I /usr/include \
           -I /usr/local/include \
           -I /usr/lib/gcc/i586-suse-linux/4.7/include \
           -I include \
           -I include/freetype \
           -I include/freetype/config \
           -I include/freetype/internal \
           -DFT2_BUILD_LIBRARY \
           . &> cppcheck.log

using cppcheck git commit f7e93f99.

Note that cppcheck still can't handle `#include FOO' (with `FOO' a
macro).

*/* Improve variable scopes.
*/* Remove redundant initializations which get overwritten.

* src/gxvalid/*: Comment out redundant code or guard it with
FT_DEBUG_LEVEL_TRACE.
2013-08-01 12:20:20 +02:00
Werner Lemberg 77c39b1deb [cff] Make Adobe CFF engine work correctly on 64bit hosts.
Reported by numerous people on the `freetype-devel' list.  Without
this fix, glyphs aren't properly aligned on a common baseline.

On 64bit systems, `FT_Pos' expands to `long int', having a width of
64bit.  `CF2_Fixed' expands to `int' which is normally 32bit wide on
64bit hosts also.  Wrong casts filled up the blues arrays with
incorrect values.  Note that all blues values are accessed with the
`cf2_blueToFixed' macro which handles the 64bit to 32bit conversion.

* src/cff/cf2ft.h (cf2_getBlueValues, cf2_getOtherBlues,
cf2_getFamilyBlues, cf2_getFamilyOtherBlues): Use `FT_Pos' for
`data', not `CF2_Fixed'.
* src/cff/cf2ft.c (cf2_getBlueValues, cf2_getOtherBlues,
cf2_getFamilyBlues, cf2_getFamilyOtherBlues): Updated.
* src/cff/cf2blues.c (cf2_blues_init): Updated.
2013-05-04 18:04:07 +02:00
Werner Lemberg 99033fefb6 * src/cff/cf2blues.c: Remove dead code. 2013-05-03 17:39:24 +02:00
Werner Lemberg 283c8ed817 [cff] New files for Adobe's Type 2 interpreter and hinting engine. 2013-04-13 15:02:31 +02:00