Don't use macro names that contain `__' [2/2].

Such macro names are reserved for both C and C++.

* src/cache/*: s/__/_/.
This commit is contained in:
Werner Lemberg 2016-01-12 21:40:53 +01:00
parent 37412ff9f4
commit 2e9d2660b3
10 changed files with 36 additions and 28 deletions

View File

@ -1,10 +1,18 @@
2016-01-12 Werner Lemberg <wl@gnu.org>
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 Werner Lemberg <wl@gnu.org>
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_'.
* */*: Replace macros of the form `__XXX_H__' with `XXX_H_'.
2016-01-10 Jered Gray <jegray@google.com>

10
src/cache/ftccache.c vendored
View File

@ -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,
@ -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 (;;)
@ -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;
@ -498,7 +498,7 @@
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. */
@ -518,7 +518,7 @@
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 )

12
src/cache/ftccache.h vendored
View File

@ -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,7 +220,7 @@ 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. */ \
@ -240,7 +240,7 @@ 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 ) \

View File

@ -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;

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

12
src/cache/ftcmanag.c vendored
View File

@ -494,7 +494,7 @@
else
weight += cache->clazz.node_weight( node, cache );
node = FTC_NODE__NEXT( node );
node = FTC_NODE_NEXT( node );
} while ( node != first );
@ -513,7 +513,7 @@
do
{
count++;
node = FTC_NODE__NEXT( node );
node = FTC_NODE_NEXT( node );
} while ( node != first );
@ -556,13 +556,13 @@
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 );
@ -641,10 +641,10 @@
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 */

View File

@ -215,7 +215,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;

View File

@ -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 )