diff options
Diffstat (limited to 'src/3rdparty/freetype/src/cache')
19 files changed, 193 insertions, 153 deletions
diff --git a/src/3rdparty/freetype/src/cache/Jamfile b/src/3rdparty/freetype/src/cache/Jamfile index 1d2bb29392..53f4c7b603 100644 --- a/src/3rdparty/freetype/src/cache/Jamfile +++ b/src/3rdparty/freetype/src/cache/Jamfile @@ -1,6 +1,6 @@ # FreeType 2 src/cache Jamfile # -# Copyright 2001-2015 by +# Copyright 2001-2018 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/src/3rdparty/freetype/src/cache/ftcache.c b/src/3rdparty/freetype/src/cache/ftcache.c index 8de527acab..1b425af911 100644 --- a/src/3rdparty/freetype/src/cache/ftcache.c +++ b/src/3rdparty/freetype/src/cache/ftcache.c @@ -4,7 +4,7 @@ /* */ /* The FreeType Caching sub-system (body only). */ /* */ -/* Copyright 2000-2015 by */ +/* Copyright 2000-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -17,15 +17,16 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT - #include <ft2build.h> -#include "ftcmru.c" -#include "ftcmanag.c" + +#include "ftcbasic.c" #include "ftccache.c" #include "ftccmap.c" #include "ftcglyph.c" #include "ftcimage.c" +#include "ftcmanag.c" +#include "ftcmru.c" #include "ftcsbits.c" -#include "ftcbasic.c" + /* END */ diff --git a/src/3rdparty/freetype/src/cache/ftcbasic.c b/src/3rdparty/freetype/src/cache/ftcbasic.c index ac3290cef4..994aa12286 100644 --- a/src/3rdparty/freetype/src/cache/ftcbasic.c +++ b/src/3rdparty/freetype/src/cache/ftcbasic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType basic cache interface (body). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -237,12 +237,14 @@ { { sizeof ( FTC_BasicFamilyRec ), - ftc_basic_family_compare, - ftc_basic_family_init, - 0, /* FTC_MruNode_ResetFunc */ - 0 /* FTC_MruNode_DoneFunc */ + + ftc_basic_family_compare, /* FTC_MruNode_CompareFunc node_compare */ + ftc_basic_family_init, /* FTC_MruNode_InitFunc node_init */ + NULL, /* FTC_MruNode_ResetFunc node_reset */ + NULL /* FTC_MruNode_DoneFunc node_done */ }, - ftc_basic_family_load_glyph + + ftc_basic_family_load_glyph /* FTC_IFamily_LoadGlyphFunc family_load_glyph */ }; @@ -250,16 +252,17 @@ const FTC_GCacheClassRec ftc_basic_image_cache_class = { { - ftc_inode_new, - ftc_inode_weight, - ftc_gnode_compare, - ftc_basic_gnode_compare_faceid, - ftc_inode_free, + ftc_inode_new, /* FTC_Node_NewFunc node_new */ + ftc_inode_weight, /* FTC_Node_WeightFunc node_weight */ + ftc_gnode_compare, /* FTC_Node_CompareFunc node_compare */ + ftc_basic_gnode_compare_faceid, /* FTC_Node_CompareFunc node_remove_faceid */ + ftc_inode_free, /* FTC_Node_FreeFunc node_free */ sizeof ( FTC_GCacheRec ), - ftc_gcache_init, - ftc_gcache_done + ftc_gcache_init, /* FTC_Cache_InitFunc cache_init */ + ftc_gcache_done /* FTC_Cache_DoneFunc cache_done */ }, + (FTC_MruListClass)&ftc_basic_image_family_class }; @@ -301,10 +304,18 @@ if ( anode ) *anode = NULL; - if ( (FT_ULong)( type->flags - FT_INT_MIN ) > FT_UINT_MAX ) + /* + * Internal `FTC_BasicAttr->load_flags' is of type `FT_UInt', + * but public `FT_ImageType->flags' is of type `FT_Int32'. + * + * On 16bit systems, higher bits of type->flags cannot be handled. + */ +#if 0xFFFFFFFFUL > FT_UINT_MAX + if ( (type->flags & (FT_ULong)FT_UINT_MAX) ) FT_TRACE1(( "FTC_ImageCache_Lookup:" " higher bits in load_flags 0x%x are dropped\n", (FT_ULong)type->flags & ~((FT_ULong)FT_UINT_MAX) )); +#endif query.attrs.scaler.face_id = type->face_id; query.attrs.scaler.width = type->width; @@ -374,11 +385,18 @@ if ( anode ) *anode = NULL; - /* `FT_Load_Glyph' and `FT_Load_Char' take FT_UInt flags */ + /* + * Internal `FTC_BasicAttr->load_flags' is of type `FT_UInt', + * but public `FT_Face->face_flags' is of type `FT_Long'. + * + * On long > int systems, higher bits of load_flags cannot be handled. + */ +#if FT_ULONG_MAX > FT_UINT_MAX if ( load_flags > FT_UINT_MAX ) FT_TRACE1(( "FTC_ImageCache_LookupScaler:" " higher bits in load_flags 0x%x are dropped\n", load_flags & ~((FT_ULong)FT_UINT_MAX) )); +#endif query.attrs.scaler = scaler[0]; query.attrs.load_flags = (FT_UInt)load_flags; @@ -419,11 +437,12 @@ { { sizeof ( FTC_BasicFamilyRec ), - ftc_basic_family_compare, - ftc_basic_family_init, - 0, /* FTC_MruNode_ResetFunc */ - 0 /* FTC_MruNode_DoneFunc */ + ftc_basic_family_compare, /* FTC_MruNode_CompareFunc node_compare */ + ftc_basic_family_init, /* FTC_MruNode_InitFunc node_init */ + NULL, /* FTC_MruNode_ResetFunc node_reset */ + NULL /* FTC_MruNode_DoneFunc node_done */ }, + ftc_basic_family_get_count, ftc_basic_family_load_bitmap }; @@ -433,16 +452,17 @@ const FTC_GCacheClassRec ftc_basic_sbit_cache_class = { { - ftc_snode_new, - ftc_snode_weight, - ftc_snode_compare, - ftc_basic_gnode_compare_faceid, - ftc_snode_free, + ftc_snode_new, /* FTC_Node_NewFunc node_new */ + ftc_snode_weight, /* FTC_Node_WeightFunc node_weight */ + ftc_snode_compare, /* FTC_Node_CompareFunc node_compare */ + ftc_basic_gnode_compare_faceid, /* FTC_Node_CompareFunc node_remove_faceid */ + ftc_snode_free, /* FTC_Node_FreeFunc node_free */ sizeof ( FTC_GCacheRec ), - ftc_gcache_init, - ftc_gcache_done + ftc_gcache_init, /* FTC_Cache_InitFunc cache_init */ + ftc_gcache_done /* FTC_Cache_DoneFunc cache_done */ }, + (FTC_MruListClass)&ftc_basic_sbit_family_class }; @@ -482,10 +502,18 @@ *ansbit = NULL; - if ( (FT_ULong)( type->flags - FT_INT_MIN ) > FT_UINT_MAX ) + /* + * Internal `FTC_BasicAttr->load_flags' is of type `FT_UInt', + * but public `FT_ImageType->flags' is of type `FT_Int32'. + * + * On 16bit systems, higher bits of type->flags cannot be handled. + */ +#if 0xFFFFFFFFUL > FT_UINT_MAX + if ( (type->flags & (FT_ULong)FT_UINT_MAX) ) FT_TRACE1(( "FTC_ImageCache_Lookup:" " higher bits in load_flags 0x%x are dropped\n", (FT_ULong)type->flags & ~((FT_ULong)FT_UINT_MAX) )); +#endif query.attrs.scaler.face_id = type->face_id; query.attrs.scaler.width = type->width; @@ -557,11 +585,18 @@ *ansbit = NULL; - /* `FT_Load_Glyph' and `FT_Load_Char' take FT_UInt flags */ + /* + * Internal `FTC_BasicAttr->load_flags' is of type `FT_UInt', + * but public `FT_Face->face_flags' is of type `FT_Long'. + * + * On long > int systems, higher bits of load_flags cannot be handled. + */ +#if FT_ULONG_MAX > FT_UINT_MAX if ( load_flags > FT_UINT_MAX ) FT_TRACE1(( "FTC_ImageCache_LookupScaler:" " higher bits in load_flags 0x%x are dropped\n", load_flags & ~((FT_ULong)FT_UINT_MAX) )); +#endif query.attrs.scaler = scaler[0]; query.attrs.load_flags = (FT_UInt)load_flags; diff --git a/src/3rdparty/freetype/src/cache/ftccache.c b/src/3rdparty/freetype/src/cache/ftccache.c index d8c5b99681..12ec585a25 100644 --- a/src/3rdparty/freetype/src/cache/ftccache.c +++ b/src/3rdparty/freetype/src/cache/ftccache.c @@ -4,7 +4,7 @@ /* */ /* The FreeType internal cache interface (body). */ /* */ -/* Copyright 2000-2015 by */ +/* Copyright 2000-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -85,7 +85,7 @@ /* get a top bucket for specified hash from cache, - * body for FTC_NODE__TOP_FOR_HASH( cache, hash ) + * body for FTC_NODE_TOP_FOR_HASH( cache, hash ) */ FT_LOCAL_DEF( FTC_Node* ) ftc_get_top_node_for_hash( FTC_Cache cache, @@ -147,7 +147,7 @@ for (;;) { node = *pnode; - if ( node == NULL ) + if ( !node ) break; if ( node->hash & ( mask + 1 ) ) @@ -224,7 +224,7 @@ ftc_node_hash_unlink( FTC_Node node0, FTC_Cache cache ) { - FTC_Node *pnode = FTC_NODE__TOP_FOR_HASH( cache, node0->hash ); + FTC_Node *pnode = FTC_NODE_TOP_FOR_HASH( cache, node0->hash ); for (;;) @@ -232,7 +232,7 @@ FTC_Node node = *pnode; - if ( node == NULL ) + if ( !node ) { FT_TRACE0(( "ftc_node_hash_unlink: unknown node\n" )); return; @@ -257,7 +257,7 @@ ftc_node_hash_link( FTC_Node node, FTC_Cache cache ) { - FTC_Node *pnode = FTC_NODE__TOP_FOR_HASH( cache, node->hash ); + FTC_Node *pnode = FTC_NODE_TOP_FOR_HASH( cache, node->hash ); node->link = *pnode; @@ -288,7 +288,7 @@ cache = manager->caches[node->cache_index]; #ifdef FT_DEBUG_ERROR - if ( cache == NULL ) + if ( !cache ) { FT_TRACE0(( "ftc_node_destroy: invalid node handle\n" )); return; @@ -494,18 +494,18 @@ FTC_Node_CompareFunc compare = cache->clazz.node_compare; - if ( cache == NULL || anode == NULL ) + if ( !cache || !anode ) return FT_THROW( Invalid_Argument ); /* Go to the `top' node of the list sharing same masked hash */ - bucket = pnode = FTC_NODE__TOP_FOR_HASH( cache, hash ); + bucket = pnode = FTC_NODE_TOP_FOR_HASH( cache, hash ); /* Lookup a node with exactly same hash and queried properties. */ /* NOTE: _nodcomp() may change the linked list to reduce memory. */ for (;;) { node = *pnode; - if ( node == NULL ) + if ( !node ) goto NewNode; if ( node->hash == hash && @@ -518,12 +518,12 @@ if ( list_changed ) { /* Update bucket by modified linked list */ - bucket = pnode = FTC_NODE__TOP_FOR_HASH( cache, hash ); + bucket = pnode = FTC_NODE_TOP_FOR_HASH( cache, hash ); /* Update pnode by modified linked list */ while ( *pnode != node ) { - if ( *pnode == NULL ) + if ( !*pnode ) { FT_ERROR(( "FTC_Cache_Lookup: oops!!! node missing\n" )); goto NewNode; @@ -576,13 +576,13 @@ FTC_Node* pnode = bucket; - for ( ;; ) + for (;;) { FTC_Node node = *pnode; FT_Bool list_changed = FALSE; - if ( node == NULL ) + if ( !node ) break; if ( cache->clazz.node_remove_faceid( node, face_id, diff --git a/src/3rdparty/freetype/src/cache/ftccache.h b/src/3rdparty/freetype/src/cache/ftccache.h index 4e17c7afef..859c547e46 100644 --- a/src/3rdparty/freetype/src/cache/ftccache.h +++ b/src/3rdparty/freetype/src/cache/ftccache.h @@ -4,7 +4,7 @@ /* */ /* FreeType internal cache interface (specification). */ /* */ -/* Copyright 2000-2015 by */ +/* Copyright 2000-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -16,16 +16,16 @@ /***************************************************************************/ -#ifndef __FTCCACHE_H__ -#define __FTCCACHE_H__ +#ifndef FTCCACHE_H_ +#define FTCCACHE_H_ #include "ftcmru.h" FT_BEGIN_HEADER -#define _FTC_FACE_ID_HASH( i ) \ - ( ( (FT_Offset)(i) >> 3 ) ^ ( (FT_Offset)(i) << 7 ) ) +#define FTC_FACE_ID_HASH( i ) \ + ( ( (FT_Offset)(i) >> 3 ) ^ ( (FT_Offset)(i) << 7 ) ) /* handle to cache object */ typedef struct FTC_CacheRec_* FTC_Cache; @@ -69,11 +69,11 @@ FT_BEGIN_HEADER #define FTC_NODE( x ) ( (FTC_Node)(x) ) #define FTC_NODE_P( x ) ( (FTC_Node*)(x) ) -#define FTC_NODE__NEXT( x ) FTC_NODE( (x)->mru.next ) -#define FTC_NODE__PREV( x ) FTC_NODE( (x)->mru.prev ) +#define FTC_NODE_NEXT( x ) FTC_NODE( (x)->mru.next ) +#define FTC_NODE_PREV( x ) FTC_NODE( (x)->mru.prev ) #ifdef FTC_INLINE -#define FTC_NODE__TOP_FOR_HASH( cache, hash ) \ +#define FTC_NODE_TOP_FOR_HASH( cache, hash ) \ ( ( cache )->buckets + \ ( ( ( ( hash ) & ( cache )->mask ) < ( cache )->p ) \ ? ( ( hash ) & ( ( cache )->mask * 2 + 1 ) ) \ @@ -82,7 +82,7 @@ FT_BEGIN_HEADER FT_LOCAL( FTC_Node* ) ftc_get_top_node_for_hash( FTC_Cache cache, FT_Offset hash ); -#define FTC_NODE__TOP_FOR_HASH( cache, hash ) \ +#define FTC_NODE_TOP_FOR_HASH( cache, hash ) \ ftc_get_top_node_for_hash( ( cache ), ( hash ) ) #endif @@ -220,15 +220,15 @@ FT_BEGIN_HEADER node = NULL; \ \ /* Go to the `top' node of the list sharing same masked hash */ \ - _bucket = _pnode = FTC_NODE__TOP_FOR_HASH( _cache, _hash ); \ + _bucket = _pnode = FTC_NODE_TOP_FOR_HASH( _cache, _hash ); \ \ /* Look up a node with identical hash and queried properties. */ \ /* NOTE: _nodcomp() may change the linked list to reduce memory. */ \ for (;;) \ { \ _node = *_pnode; \ - if ( _node == NULL ) \ - goto _NewNode; \ + if ( !_node ) \ + goto NewNode_; \ \ if ( _node->hash == _hash && \ _nodcomp( _node, query, _cache, &_list_changed ) ) \ @@ -240,15 +240,15 @@ FT_BEGIN_HEADER if ( _list_changed ) \ { \ /* Update _bucket by possibly modified linked list */ \ - _bucket = _pnode = FTC_NODE__TOP_FOR_HASH( _cache, _hash ); \ + _bucket = _pnode = FTC_NODE_TOP_FOR_HASH( _cache, _hash ); \ \ /* Update _pnode by possibly modified linked list */ \ while ( *_pnode != _node ) \ { \ - if ( *_pnode == NULL ) \ + if ( !*_pnode ) \ { \ FT_ERROR(( "FTC_CACHE_LOOKUP_CMP: oops!!! node missing\n" )); \ - goto _NewNode; \ + goto NewNode_; \ } \ else \ _pnode = &((*_pnode)->link); \ @@ -273,12 +273,12 @@ FT_BEGIN_HEADER FTC_MruNode_Up( (FTC_MruNode*)_nl, \ (FTC_MruNode)_node ); \ } \ - goto _Ok; \ + goto Ok_; \ \ - _NewNode: \ + NewNode_: \ error = FTC_Cache_NewNode( _cache, _hash, query, &_node ); \ \ - _Ok: \ + Ok_: \ node = _node; \ FT_END_STMNT @@ -325,7 +325,7 @@ FT_BEGIN_HEADER break; \ \ _try_done = FTC_Manager_FlushN( _try_manager, _try_count ); \ - if ( _try_done > 0 && ( list_changed ) ) \ + if ( _try_done > 0 && list_changed != NULL ) \ *(FT_Bool*)( list_changed ) = TRUE; \ \ if ( _try_done == 0 ) \ @@ -346,7 +346,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __FTCCACHE_H__ */ +#endif /* FTCCACHE_H_ */ /* END */ diff --git a/src/3rdparty/freetype/src/cache/ftccback.h b/src/3rdparty/freetype/src/cache/ftccback.h index b3237d5a3f..e51d8d6e55 100644 --- a/src/3rdparty/freetype/src/cache/ftccback.h +++ b/src/3rdparty/freetype/src/cache/ftccback.h @@ -4,7 +4,7 @@ /* */ /* Callback functions of the caching sub-system (specification only). */ /* */ -/* Copyright 2004-2015 by */ +/* Copyright 2004-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -15,8 +15,8 @@ /* */ /***************************************************************************/ -#ifndef __FTCCBACK_H__ -#define __FTCCBACK_H__ +#ifndef FTCCBACK_H_ +#define FTCCBACK_H_ #include <ft2build.h> #include FT_CACHE_H @@ -86,6 +86,7 @@ FTC_Manager manager ); -#endif /* __FTCCBACK_H__ */ +#endif /* FTCCBACK_H_ */ + /* END */ diff --git a/src/3rdparty/freetype/src/cache/ftccmap.c b/src/3rdparty/freetype/src/cache/ftccmap.c index b8262220c4..d20b0f48fe 100644 --- a/src/3rdparty/freetype/src/cache/ftccmap.c +++ b/src/3rdparty/freetype/src/cache/ftccmap.c @@ -4,7 +4,7 @@ /* */ /* FreeType CharMap cache (body) */ /* */ -/* Copyright 2000-2015 by */ +/* Copyright 2000-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -50,7 +50,7 @@ /* compute a query/node hash */ #define FTC_CMAP_HASH( faceid, index, charcode ) \ - ( _FTC_FACE_ID_HASH( faceid ) + 211 * (index) + \ + ( FTC_FACE_ID_HASH( faceid ) + 211 * (index) + \ ( (charcode) / FTC_CMAP_INDICES_MAX ) ) /* the charmap query */ @@ -201,15 +201,15 @@ static const FTC_CacheClassRec ftc_cmap_cache_class = { - ftc_cmap_node_new, - ftc_cmap_node_weight, - ftc_cmap_node_compare, - ftc_cmap_node_remove_faceid, - ftc_cmap_node_free, + ftc_cmap_node_new, /* FTC_Node_NewFunc node_new */ + ftc_cmap_node_weight, /* FTC_Node_WeightFunc node_weight */ + ftc_cmap_node_compare, /* FTC_Node_CompareFunc node_compare */ + ftc_cmap_node_remove_faceid, /* FTC_Node_CompareFunc node_remove_faceid */ + ftc_cmap_node_free, /* FTC_Node_FreeFunc node_free */ sizeof ( FTC_CacheRec ), - ftc_cache_init, - ftc_cache_done, + ftc_cache_init, /* FTC_Cache_InitFunc cache_init */ + ftc_cache_done, /* FTC_Cache_DoneFunc cache_done */ }; @@ -259,9 +259,6 @@ return 0; } - if ( !face_id ) - return 0; - query.face_id = face_id; query.cmap_index = (FT_UInt)cmap_index; query.char_code = char_code; diff --git a/src/3rdparty/freetype/src/cache/ftcerror.h b/src/3rdparty/freetype/src/cache/ftcerror.h index 15adec58de..a26cd5935b 100644 --- a/src/3rdparty/freetype/src/cache/ftcerror.h +++ b/src/3rdparty/freetype/src/cache/ftcerror.h @@ -4,7 +4,7 @@ /* */ /* Caching sub-system error codes (specification only). */ /* */ -/* Copyright 2001-2015 by */ +/* Copyright 2001-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -23,12 +23,12 @@ /* */ /*************************************************************************/ -#ifndef __FTCERROR_H__ -#define __FTCERROR_H__ +#ifndef FTCERROR_H_ +#define FTCERROR_H_ #include FT_MODULE_ERRORS_H -#undef __FTERRORS_H__ +#undef FTERRORS_H_ #undef FT_ERR_PREFIX #define FT_ERR_PREFIX FTC_Err_ @@ -36,6 +36,7 @@ #include FT_ERRORS_H -#endif /* __FTCERROR_H__ */ +#endif /* FTCERROR_H_ */ + /* END */ diff --git a/src/3rdparty/freetype/src/cache/ftcglyph.c b/src/3rdparty/freetype/src/cache/ftcglyph.c index 343b8a7793..782cc0ed09 100644 --- a/src/3rdparty/freetype/src/cache/ftcglyph.c +++ b/src/3rdparty/freetype/src/cache/ftcglyph.c @@ -4,7 +4,7 @@ /* */ /* FreeType Glyph Image (FT_Glyph) cache (body). */ /* */ -/* Copyright 2000-2015 by */ +/* Copyright 2000-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -106,7 +106,7 @@ FTC_Family_Init( FTC_Family family, FTC_Cache cache ) { - FTC_GCacheClass clazz = FTC_CACHE__GCACHE_CLASS( cache ); + FTC_GCacheClass clazz = FTC_CACHE_GCACHE_CLASS( cache ); family->clazz = clazz->family_class; diff --git a/src/3rdparty/freetype/src/cache/ftcglyph.h b/src/3rdparty/freetype/src/cache/ftcglyph.h index 6cadbe2c10..23c24d223f 100644 --- a/src/3rdparty/freetype/src/cache/ftcglyph.h +++ b/src/3rdparty/freetype/src/cache/ftcglyph.h @@ -4,7 +4,7 @@ /* */ /* FreeType abstract glyph cache (specification). */ /* */ -/* Copyright 2000-2015 by */ +/* Copyright 2000-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -113,8 +113,8 @@ /*************************************************************************/ -#ifndef __FTCGLYPH_H__ -#define __FTCGLYPH_H__ +#ifndef FTCGLYPH_H_ +#define FTCGLYPH_H_ #include <ft2build.h> @@ -245,10 +245,10 @@ FT_BEGIN_HEADER #define FTC_GCACHE_CLASS( x ) ((FTC_GCacheClass)(x)) -#define FTC_CACHE__GCACHE_CLASS( x ) \ +#define FTC_CACHE_GCACHE_CLASS( x ) \ FTC_GCACHE_CLASS( FTC_CACHE(x)->org_class ) -#define FTC_CACHE__FAMILY_CLASS( x ) \ - ( (FTC_MruListClass)FTC_CACHE__GCACHE_CLASS( x )->family_class ) +#define FTC_CACHE_FAMILY_CLASS( x ) \ + ( (FTC_MruListClass)FTC_CACHE_GCACHE_CLASS( x )->family_class ) /* convenience function; use it instead of FTC_Manager_Register_Cache */ @@ -323,7 +323,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __FTCGLYPH_H__ */ +#endif /* FTCGLYPH_H_ */ /* END */ diff --git a/src/3rdparty/freetype/src/cache/ftcimage.c b/src/3rdparty/freetype/src/cache/ftcimage.c index f519a6179c..77a100153e 100644 --- a/src/3rdparty/freetype/src/cache/ftcimage.c +++ b/src/3rdparty/freetype/src/cache/ftcimage.c @@ -4,7 +4,7 @@ /* */ /* FreeType Image cache (body). */ /* */ -/* Copyright 2000-2015 by */ +/* Copyright 2000-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -70,7 +70,7 @@ FTC_GNode gnode = FTC_GNODE( inode ); FTC_Family family = gquery->family; FT_UInt gindex = gquery->gindex; - FTC_IFamilyClass clazz = FTC_CACHE__IFAMILY_CLASS( cache ); + FTC_IFamilyClass clazz = FTC_CACHE_IFAMILY_CLASS( cache ); /* initialize its inner fields */ diff --git a/src/3rdparty/freetype/src/cache/ftcimage.h b/src/3rdparty/freetype/src/cache/ftcimage.h index b312eaa3d9..24a221053b 100644 --- a/src/3rdparty/freetype/src/cache/ftcimage.h +++ b/src/3rdparty/freetype/src/cache/ftcimage.h @@ -4,7 +4,7 @@ /* */ /* FreeType Generic Image cache (specification) */ /* */ -/* Copyright 2000-2015 by */ +/* Copyright 2000-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -32,8 +32,8 @@ /*************************************************************************/ -#ifndef __FTCIMAGE_H__ -#define __FTCIMAGE_H__ +#ifndef FTCIMAGE_H_ +#define FTCIMAGE_H_ #include <ft2build.h> @@ -72,8 +72,8 @@ FT_BEGIN_HEADER #define FTC_IFAMILY_CLASS( x ) ((FTC_IFamilyClass)(x)) -#define FTC_CACHE__IFAMILY_CLASS( x ) \ - FTC_IFAMILY_CLASS( FTC_CACHE__GCACHE_CLASS(x)->family_class ) +#define FTC_CACHE_IFAMILY_CLASS( x ) \ + FTC_IFAMILY_CLASS( FTC_CACHE_GCACHE_CLASS(x)->family_class ) /* can be used as a @FTC_Node_FreeFunc */ @@ -101,7 +101,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __FTCIMAGE_H__ */ +#endif /* FTCIMAGE_H_ */ /* END */ diff --git a/src/3rdparty/freetype/src/cache/ftcmanag.c b/src/3rdparty/freetype/src/cache/ftcmanag.c index 658614c8db..2bcd9df502 100644 --- a/src/3rdparty/freetype/src/cache/ftcmanag.c +++ b/src/3rdparty/freetype/src/cache/ftcmanag.c @@ -4,7 +4,7 @@ /* */ /* FreeType Cache Manager (body). */ /* */ -/* Copyright 2000-2015 by */ +/* Copyright 2000-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -156,10 +156,11 @@ const FTC_MruListClassRec ftc_size_list_class = { sizeof ( FTC_SizeNodeRec ), - ftc_size_node_compare, - ftc_size_node_init, - ftc_size_node_reset, - ftc_size_node_done + + ftc_size_node_compare, /* FTC_MruNode_CompareFunc node_compare */ + ftc_size_node_init, /* FTC_MruNode_InitFunc node_init */ + ftc_size_node_reset, /* FTC_MruNode_ResetFunc node_reset */ + ftc_size_node_done /* FTC_MruNode_DoneFunc node_done */ }; @@ -296,10 +297,10 @@ { sizeof ( FTC_FaceNodeRec), - ftc_face_node_compare, - ftc_face_node_init, - 0, /* FTC_MruNode_ResetFunc */ - ftc_face_node_done + ftc_face_node_compare, /* FTC_MruNode_CompareFunc node_compare */ + ftc_face_node_init, /* FTC_MruNode_InitFunc node_init */ + NULL, /* FTC_MruNode_ResetFunc node_reset */ + ftc_face_node_done /* FTC_MruNode_DoneFunc node_done */ }; @@ -314,7 +315,7 @@ FTC_MruNode mrunode; - if ( !aface || !face_id ) + if ( !aface ) return FT_THROW( Invalid_Argument ); *aface = NULL; @@ -494,7 +495,7 @@ else weight += cache->clazz.node_weight( node, cache ); - node = FTC_NODE__NEXT( node ); + node = FTC_NODE_NEXT( node ); } while ( node != first ); @@ -513,7 +514,7 @@ do { count++; - node = FTC_NODE__NEXT( node ); + node = FTC_NODE_NEXT( node ); } while ( node != first ); @@ -552,17 +553,17 @@ manager->num_nodes )); #endif - if ( manager->cur_weight < manager->max_weight || first == NULL ) + if ( manager->cur_weight < manager->max_weight || !first ) return; /* go to last node -- it's a circular list */ - node = FTC_NODE__PREV( first ); + node = FTC_NODE_PREV( first ); do { FTC_Node prev; - prev = ( node == first ) ? NULL : FTC_NODE__PREV( node ); + prev = ( node == first ) ? NULL : FTC_NODE_PREV( node ); if ( node->ref_count <= 0 ) ftc_node_destroy( node, manager ); @@ -637,14 +638,14 @@ /* try to remove `count' nodes from the list */ - if ( first == NULL ) /* empty list! */ + if ( !first ) /* empty list! */ return 0; /* go to last node - it's a circular list */ - node = FTC_NODE__PREV(first); + node = FTC_NODE_PREV(first); for ( result = 0; result < count; ) { - FTC_Node prev = FTC_NODE__PREV( node ); + FTC_Node prev = FTC_NODE_PREV( node ); /* don't touch locked nodes */ @@ -672,7 +673,7 @@ FT_UInt nn; - if ( !manager || !face_id ) + if ( !manager ) return; /* this will remove all FTC_SizeNode that correspond to diff --git a/src/3rdparty/freetype/src/cache/ftcmanag.h b/src/3rdparty/freetype/src/cache/ftcmanag.h index c6787b72c5..b4b4755356 100644 --- a/src/3rdparty/freetype/src/cache/ftcmanag.h +++ b/src/3rdparty/freetype/src/cache/ftcmanag.h @@ -4,7 +4,7 @@ /* */ /* FreeType Cache Manager (specification). */ /* */ -/* Copyright 2000-2015 by */ +/* Copyright 2000-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -59,8 +59,8 @@ /*************************************************************************/ -#ifndef __FTCMANAG_H__ -#define __FTCMANAG_H__ +#ifndef FTCMANAG_H_ +#define FTCMANAG_H_ #include <ft2build.h> @@ -161,7 +161,7 @@ FT_BEGIN_HEADER (a)->y_res == (b)->y_res ) ) ) #define FTC_SCALER_HASH( q ) \ - ( _FTC_FACE_ID_HASH( (q)->face_id ) + \ + ( FTC_FACE_ID_HASH( (q)->face_id ) + \ (q)->width + (q)->height*7 + \ ( (q)->pixel ? 0 : ( (q)->x_res*33 ^ (q)->y_res*61 ) ) ) @@ -169,7 +169,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __FTCMANAG_H__ */ +#endif /* FTCMANAG_H_ */ /* END */ diff --git a/src/3rdparty/freetype/src/cache/ftcmru.c b/src/3rdparty/freetype/src/cache/ftcmru.c index 10ce4f301e..1087be4d89 100644 --- a/src/3rdparty/freetype/src/cache/ftcmru.c +++ b/src/3rdparty/freetype/src/cache/ftcmru.c @@ -4,7 +4,7 @@ /* */ /* FreeType MRU support (body). */ /* */ -/* Copyright 2003-2015 by */ +/* Copyright 2003-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -76,7 +76,7 @@ FTC_MruNode first = *plist; - FT_ASSERT( first != NULL ); + FT_ASSERT( first ); if ( first != node ) { @@ -126,7 +126,7 @@ FTC_MruNode prev, next; - FT_ASSERT( first != NULL ); + FT_ASSERT( first ); #ifdef FT_DEBUG_ERROR { @@ -238,7 +238,7 @@ FTC_MruNode *anode ) { FT_Error error; - FTC_MruNode node = NULL; + FTC_MruNode node = NULL; FT_Memory memory = list->memory; @@ -296,7 +296,7 @@ node = FTC_MruList_Find( list, key ); - if ( node == NULL ) + if ( !node ) return FTC_MruList_New( list, key, anode ); *anode = node; @@ -332,7 +332,7 @@ first = list->nodes; - while ( first && ( selection == NULL || selection( first, key ) ) ) + while ( first && ( !selection || selection( first, key ) ) ) { FTC_MruList_Remove( list, first ); first = list->nodes; diff --git a/src/3rdparty/freetype/src/cache/ftcmru.h b/src/3rdparty/freetype/src/cache/ftcmru.h index c0c35f934b..82396b917d 100644 --- a/src/3rdparty/freetype/src/cache/ftcmru.h +++ b/src/3rdparty/freetype/src/cache/ftcmru.h @@ -4,7 +4,7 @@ /* */ /* Simple MRU list-cache (specification). */ /* */ -/* Copyright 2000-2015 by */ +/* Copyright 2000-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -40,8 +40,8 @@ /*************************************************************************/ -#ifndef __FTCMRU_H__ -#define __FTCMRU_H__ +#ifndef FTCMRU_H_ +#define FTCMRU_H_ #include <ft2build.h> @@ -108,6 +108,7 @@ FT_BEGIN_HEADER typedef struct FTC_MruListClassRec_ { FT_Offset node_size; + FTC_MruNode_CompareFunc node_compare; FTC_MruNode_InitFunc node_init; FTC_MruNode_ResetFunc node_reset; @@ -115,6 +116,7 @@ FT_BEGIN_HEADER } FTC_MruListClassRec; + typedef struct FTC_MruListRec_ { FT_UInt num_nodes; @@ -181,15 +183,15 @@ FT_BEGIN_HEADER FTC_MruNode_Up( _pfirst, _node ); \ \ node = _node; \ - goto _MruOk; \ + goto MruOk_; \ } \ _node = _node->next; \ \ - } while ( _node != _first) ; \ + } while ( _node != _first); \ } \ \ error = FTC_MruList_New( (list), (key), (FTC_MruNode*)(void*)&(node) ); \ - _MruOk: \ + MruOk_: \ ; \ FT_END_STMNT @@ -240,7 +242,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __FTCMRU_H__ */ +#endif /* FTCMRU_H_ */ /* END */ diff --git a/src/3rdparty/freetype/src/cache/ftcsbits.c b/src/3rdparty/freetype/src/cache/ftcsbits.c index 8141719167..018f1ecdb7 100644 --- a/src/3rdparty/freetype/src/cache/ftcsbits.c +++ b/src/3rdparty/freetype/src/cache/ftcsbits.c @@ -4,7 +4,7 @@ /* */ /* FreeType sbits manager (body). */ /* */ -/* Copyright 2000-2015 by */ +/* Copyright 2000-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -53,6 +53,8 @@ pitch = -pitch; size = (FT_ULong)pitch * bitmap->rows; + if ( !size ) + return FT_Err_Ok; if ( !FT_ALLOC( sbit->buffer, size ) ) FT_MEM_COPY( sbit->buffer, bitmap->buffer, size ); @@ -215,7 +217,7 @@ FT_UInt gindex = gquery->gindex; FTC_Family family = gquery->family; - FTC_SFamilyClass clazz = FTC_CACHE__SFAMILY_CLASS( cache ); + FTC_SFamilyClass clazz = FTC_CACHE_SFAMILY_CLASS( cache ); FT_UInt total; FT_UInt node_count; @@ -376,7 +378,7 @@ * */ - if ( sbit->buffer == NULL && sbit->width == 255 ) + if ( !sbit->buffer && sbit->width == 255 ) { FT_ULong size; FT_Error error; diff --git a/src/3rdparty/freetype/src/cache/ftcsbits.h b/src/3rdparty/freetype/src/cache/ftcsbits.h index 5a2fa1ac80..206a1bb3fc 100644 --- a/src/3rdparty/freetype/src/cache/ftcsbits.h +++ b/src/3rdparty/freetype/src/cache/ftcsbits.h @@ -4,7 +4,7 @@ /* */ /* A small-bitmap cache (specification). */ /* */ -/* Copyright 2000-2015 by */ +/* Copyright 2000-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -16,8 +16,8 @@ /***************************************************************************/ -#ifndef __FTCSBITS_H__ -#define __FTCSBITS_H__ +#ifndef FTCSBITS_H_ +#define FTCSBITS_H_ #include <ft2build.h> @@ -64,8 +64,8 @@ FT_BEGIN_HEADER #define FTC_SFAMILY_CLASS( x ) ((FTC_SFamilyClass)(x)) -#define FTC_CACHE__SFAMILY_CLASS( x ) \ - FTC_SFAMILY_CLASS( FTC_CACHE__GCACHE_CLASS( x )->family_class ) +#define FTC_CACHE_SFAMILY_CLASS( x ) \ + FTC_SFAMILY_CLASS( FTC_CACHE_GCACHE_CLASS( x )->family_class ) FT_LOCAL( void ) @@ -97,7 +97,7 @@ FT_BEGIN_HEADER FT_END_HEADER -#endif /* __FTCSBITS_H__ */ +#endif /* FTCSBITS_H_ */ /* END */ diff --git a/src/3rdparty/freetype/src/cache/rules.mk b/src/3rdparty/freetype/src/cache/rules.mk index 6d5cf344b3..558935976d 100644 --- a/src/3rdparty/freetype/src/cache/rules.mk +++ b/src/3rdparty/freetype/src/cache/rules.mk @@ -3,7 +3,7 @@ # -# Copyright 2000-2015 by +# Copyright 2000-2018 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, |