Commit Graph

28 Commits

Author SHA1 Message Date
Werner Lemberg 695d606ae5 Whitespace. 2022-04-01 08:50:33 +02:00
Werner Lemberg d0cfb4e1b2 Update all copyright notices. 2022-01-11 10:54:10 +01:00
Werner Lemberg b6e8a71266 Update all copyright notices. 2021-01-17 07:18:48 +01:00
Werner Lemberg 1658685967 Remove redundant inclusion of `ft2build.h'.
* */*: Remove `#include <ft2build.h>' where possible.

* include/freetype/freetype.h: Remove cpp error about missing
inclusion of `ft2build.h'.
2020-06-13 21:15:45 +02:00
Werner Lemberg e5038be704 Update all copyright notices. 2020-01-19 17:05:19 +01:00
Werner Lemberg 7585997024 Update all copyright notices. 2019-02-23 10:07:09 +01:00
Werner Lemberg f686ad46a3 Update copyright years. 2019-01-22 20:31:44 +01:00
Werner Lemberg 9ac9060df0 [GSoC] src/*.*: Convert block comments to `light' style.
This monster commit was created by applying Nikhil's scripts
`docconverter.py' and `markify.py' to all C header and source files,
followed up by minor manual clean-up.

No change in functionality, of course.

I used commit f7419907bc6044b9b7057f9789866426c804ba82 from
https://github.com/nikramakrishnan/freetype-docs.git.
2018-06-03 09:08:41 +02:00
Werner Lemberg 0a0c22569d Update copyright year. 2018-01-02 09:33:57 +01:00
Werner Lemberg 563ae78022 Update copyright year. 2017-01-04 20:16:34 +01:00
Werner Lemberg 9adeab6452 Update copyright year. 2016-01-13 11:54:10 +01:00
Werner Lemberg 2e9d2660b3 Don't use macro names that contain `__' [2/2].
Such macro names are reserved for both C and C++.

* src/cache/*: s/__/_/.
2016-01-12 21:40:53 +01:00
Werner Lemberg 37412ff9f4 Don't use macro names that contain `__' [1/2].
Such macro names are reserved for both C and C++.

*/*: Replace macros of the form `__XXX_H__' with `XXX_H_'.
2016-01-12 21:37:13 +01:00
Werner Lemberg 3aaebe3a91 [cache] Replace `FT_PtrDist' with `FT_Offset'.
* src/cache/ftccache.h (FTC_NodeRec): `FT_Offset' (a.k.a. `size_t')
is a better choice for `hash' to hold a pointer than `FT_PtrDist'
(a.k.a. `ptrdiff_t'), especially since the latter is signed,
causing zillions of signedness warnings.  [Note that `hash' was of
type `FT_UInt32' before the change to `FT_PtrDist.]
Update all users.

* src/cache/ftcbasic.c, src/cache/ftccache.c, src/cache/ftccmap.c,
src/cache/ftcglyph.c, src/cache/ftcglyph.h: Updated.
2015-02-23 08:20:27 +01:00
Werner Lemberg f57fc59e01 Run `src/tools/update-copyright'. 2015-01-17 20:41:43 +01:00
Werner Lemberg 3757b1e1c1 Cleanup/formatting. 2011-01-13 10:33:04 +01:00
suzuki toshiya 38b272ffbb [cache] Notice if a cache query induced the node list change.
Some node comparators (comparing the cache node content and
the properties specified by the query) can flush the cache
node to prevent the cache inflation.  The change may
invalidate the pointers to the node obtained before the node
comparison, so the change should be noticed to the caller.
The problem caused by the cache node changing is reported by
Harsha, see Savannah bug #31923.

* src/cache/ftccache.h (FTC_Node_CompareFunc): Add new
argument `FT_Bool* list_changed' to indicate the change of
the cached nodes to the caller.
(FTC_CACHE_LOOKUP_CMP): Watch the change of the cached nodes
by `_list_changed'.
(FTC_CACHE_TRYLOOP_END): Take new macro argument `_list_changed'
and update it when FTC_Manager_FlushN() flushes any nodes.

* src/cache/ftccback.h (ftc_snode_compare): Updated to fit
with new FTC_Node_CompareFunc type.  (ftc_gnode_compare): Ditto.

* src/cache/ftcbasic.c: Include FT_INTERNAL_OBJECTS_H to
use TRUE/FALSE macros.  (ftc_basic_gnode_compare_faceid):
New argument `FT_Bool* list_changed' to indicate the change
of the cache nodes, anyway, it is always FALSE.

* src/cache/ftccmap.c: Include FT_INTERNAL_OBJECTS_H to
use TRUE/FALSE macros.  (ftc_cmap_node_compare):
New argument `FT_Bool* list_changed' to indicate the change
of the cache nodes, anyway, it is always FALSE.
(ftc_cmap_node_remove_faceid): Ditto.

* src/cache/ftccache.c (FTC_Cache_NewNode): Pass a NULL
pointer to FTC_CACHE_TRYLOOP_END(), because the result is
not needed.  (FTC_Cache_Lookup): Watch the change of the cache
nodes by `list_changed'.  (FTC_Cache_RemoveFaceID): Ditto.

* src/cache/ftcglyph.c: Include FT_INTERNAL_OBJECTS_H to
use TRUE/FALSE macros.  (ftc_gnode_compare): New argument
`FT_Bool* list_changed' to indicate the change of the cache
nodes, anyway, it is always FALSE.  (FTC_GNode_Compare):
New argument `FT_Bool* list_changed' to be passed to
ftc_gnode_compare().
* src/cache/ftcglyph.h (FTC_GNode_Compare): Ditto.

* src/cache/ftcsbits.c (ftc_snode_compare): New argument
`FT_Bool* list_changed' to indicate the change of the cache
nodes, anyway. It is updated by FTC_CACHE_TRYLOOP().
(FTC_SNode_Compare): New argument `FT_Bool* list_changed'
to be passed to ftc_snode_compare().
* src/cache/ftcsbits.h (FTC_SNode_Compare): Ditto.
2011-01-09 22:52:24 +09:00
suzuki toshiya 62d116f8d6 [cache] Fit FTC_GNode_Compare() to FTC_Node_CompareFunc.
* src/cache/ftcglyph.h (FTC_GNode_Compare): Add the 3rd
argument `FTC_Cache  cache' to fit FTC_Node_CompareFunc
prototype.
* src/cache/ftcglyph.c (FTC_GNode_Compare): Ditto. Anyway,
`cache' is not used by its child ftc_gnode_compare().
2011-01-09 22:38:10 +09:00
suzuki toshiya 52a1e47a5c [cache] inline-specific functions are conditionalized.
* src/cache/ftcglyph.c (FTC_GNode_Compare): Conditionalized
for inlined config.  This function is a thin wrapper of
ftc_gnode_compare() for inlined FTC_CACHE_LOOKUP_CMP()
(see `nodecmp' argument).  Under non-inlined config,
ftc_gnode_compare() is invoked by FTC_Cache_Lookup(),
via FTC_Cache->clazz.node_compare().

* src/cache/ftcglyph.h (FTC_GNode_Compare): Ditto.
* src/cache/ftcsbits.c (FTC_SNode_Compare): Ditto,
for ftc_snode_compare().
* src/cache/ftcsbits.h (FTC_SNode_Compare): Ditto.
2011-01-09 20:49:21 +09:00
suzuki toshiya 0de5b376d7 [cache] Correct a type mismatch under non-inlined config.
* src/cache/ftcglyph.h (FTC_GCACHE_LOOKUP_CMP):
FTC_GCache_Lookup() takes the node via a pointer `FTC_Node*',
differently from cpp-macro FTC_CACHE_LOOKUP_CMP().
2011-01-09 20:31:22 +09:00
suzuki toshiya 3512a71269 [cache] Change the hash types to FT_PtrDist.
On LLP64 platforms (e.g. Win64), FT_ULong (32-bit)
variables are inappropriate to calculate hash values
from the memory address (64-bit).  The hash variables
are extended from FT_ULong to FT_PtrDist and new
hashing macro functions are introduced.  The hash
values on 16-bit memory platforms are changed, but
ILP32 and LP64 are not changed.  The hash value in
the cache subsystem is not reverted to the memory
address, so using signed type FT_PtrDist is safe.

* src/cache/ftccache.h (_FTC_FACE_ID_HASH): New hash
function to replace FTC_FACE_ID_HASH() for portability.
* src/cache/ftcmanag.h (FTC_SCALER_HASH): Replace
FTC_FACE_ID_HASH() by _FTC_FACE_ID_HASH().
* src/cache/ftccmap.c (FTC_CMAP_HASH): Ditto.

* src/cache/ftccache.h (FTC_NodeRec): The type of the
member `hash' is changed from FT_UInt32 to FT_PtrDist.

* src/cache/ftccache.h (FTC_Cache_Lookup): The type of the
argument `hash' is changed from FT_UInt32 to FT_PtrDist.
(FTC_Cache_NewNode): Ditto.
* src/cache/ftccache.c (ftc_cache_add): Ditto.
(FTC_Cache_Lookup): Ditto.  (FTC_Cache_NewNode): Ditto.
* src/cache/ftcglyph.h (FTC_GCache_Lookup): Ditto.
* src/cache/ftcglyph.c (FTC_GCache_Lookup): Ditto.

* src/cache/ftcbasic.c (FTC_ImageCache_Lookup): The type
of the internal variable `hash' is changed to FT_PtrDist
from FT_UInt32.  (FTC_ImageCache_LookupScaler): Ditto.
(FTC_SBitCache_Lookup): Ditto.
(FTC_SBitCache_LookupScaler): Ditto.
* src/cache/ftccmap.c (FTC_CMapCache_Lookup): Ditto.
* src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Ditto.
Also the type of the internal variable `_idx' is changed to
FT_PtrDist from FT_UInt32 for better pointer calculation.
2010-10-25 02:08:56 +09:00
suzuki toshiya 82633a2440 [cache] Fix Savannah bug #27441, cleanup Redhat bugzilla #513582. 2009-09-27 16:55:44 +09:00
Werner Lemberg 95bc9d3a07 * src/cache/ftccache.c (ftc_node_mru_link, ftc_node_mru_unlink),
src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP), src/cache/ftcglyph.h
(FTC_GCACHE_LOOKUP_CMP), src/pshinter/pshmod.c (ps_hinter_init),
src/sfnt/ttmtx.c (tt_face_load_hmtx, tt_face_load_hhea,
tt_face_get_metrics): Fix type-punning issues.
2007-05-16 15:19:42 +00:00
Werner Lemberg af16820a12 Normalize quotation to `...'. 2006-03-24 12:46:49 +00:00
Werner Lemberg 6c5b617c59 * src/cache/ftccache.c, (ftc_node_mru_up, FTC_Cache_Lookup)
[!FTC_INLINE]: Compile conditionally.
* src/cache/ftccache.h: Updated.

* src/cache/ftcglyph.c (FTC_GNode_Init, FTC_GNode_UnselectFamily,
FTC_GNode_Done, FTC_GNode_Compare, FTC_Family_Init, FTC_GCache_New):
s/FT_EXPORT/FT_LOCAL/.
(FTC_GCache_Init, FTC_GCache_Done): Commented out.
(FTC_GCache_Lookup) [!FTC_INLINE]: Compile conditionally.
s/FT_EXPORT/FT_LOCAL/.
* src/cache/ftcglyph.h: Updated.

* src/cache/ftcimage.c (FTC_INode_Free, FTC_INode_New):
s/FT_EXPORT/FT_LOCAL/.
(FTC_INode_Weight): Commented out.
* src/cache/ftcimage.h: Updated.

* src/cache/ftmanag.c (FTC_Manager_Compress,
FTC_Manager_RegisterCache, FTC_Manager_FlushN):
s/FT_EXPORT/FT_LOCAL/.
* src/cache/ftmanag.h: Updated.

* src/cache/ftcsbits.c (FTC_SNode_Free, FTC_SNode_New,
FTC_SNode_Compare): s/FT_EXPORT/FT_LOCAL/.
(FTC_SNode_Weight): Commented out.
* src/cache/ftcsbits.h: Updated.
2006-03-22 15:30:41 +00:00
Werner Lemberg 5a73d8d20f * builds/freetype.mk (CACHE_DIR, CACHE_H): Remove.
(FREETYPE_H): Updated.

* src/cache/rules.mk (CACHE_H_DIR): Remove.
(CACHE_DRV_H): Updated.

Formatting, copyright years.
2006-03-20 16:55:32 +00:00
David Turner 256de4b18f * include/freetype/cache/ftccache.h,
include/freetype/cache/ftccmap.h,
    include/freetype/cache/ftcglyph.h
    include/freetype/cache/ftcimage.h
    include/freetype/cache/ftcmanag.h
    include/freetype/cache/ftcmru.h
    include/freetype/cache/ftcsbits.h:
      removing these header files from the public include directory.

    * include/freetype/config/ftheader.h:
      changing the definition of FT_CACHE_INTERNAL_XXX_H macros to
      redirect to FT_CACHE_H instead

    * src/cache/ftcbasic.c, src/cache/ftccache.c, src/cache/ftccache.h,
    src/cache/ftccback.h, src/cache/ftccmap.c, src/cache/ftcglyph.c,
    src/cache/ftcglyph.h, src/cache/ftcimage.c, src/cache/ftcimage.h,
    src/cache/ftcmanag.c, src/cache/ftcmanag.h, src/cache/ftcmru.c,
    src/cache/ftcmru.h, src/cache/ftcsbits.c, src/cache/ftcsbits.h:
      modifications to prevent using the FT_CACHE_INTERNAL_XXX_H macros,
      and grab the headers in 'src/cache' instead (see below).
2006-03-20 12:10:24 +00:00
David Turner dad2a2de01 * src/cache/ftccache.h, src/cache/ftcglyph.h, src/cache/ftcimage.h,
src/cache/ftcsbits.h, src/cache/ftcmanag.h, src/cache/ftccmap.h,
    src/cache/ftcmru.h: copying the cache's internal header files which
    were located in 'include/freetype/cache' to the 'src/cache' directory
    instead.

    Note that these files are not used by FreeType clients, all cache
    public APIs have been already moved to include/freetype/ftcache.h,
    and the FT_CACHE_INTERNAL_XXXX_H macros all resolve to it.

    the move is to allow us to modify the internals without intereference
    from rogue clients. Note that there are no known client that accesses
    the cache internals at the moment.
2006-03-20 11:48:13 +00:00