shithub: freetype+ttf2subf

Download patch

ref: 2e9d2660b386c1e1df799c0007d4b34711aaba69
parent: 37412ff9f42212bcf4dd29d9762f3c35b5735768
author: Werner Lemberg <[email protected]>
date: Tue Jan 12 16:40:53 EST 2016

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

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

* src/cache/*: s/__/_/.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,18 @@
 2016-01-12  Werner Lemberg  <[email protected]>
 
+	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  <[email protected]>
+
 	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  <[email protected]>
 
--- a/src/cache/ftccache.c
+++ b/src/cache/ftccache.c
@@ -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 )
--- a/src/cache/ftccache.h
+++ b/src/cache/ftccache.h
@@ -69,11 +69,11 @@
 #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_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 @@
     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 @@
     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 )                                         \
--- a/src/cache/ftcglyph.c
+++ b/src/cache/ftcglyph.c
@@ -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;
--- a/src/cache/ftcglyph.h
+++ b/src/cache/ftcglyph.h
@@ -245,10 +245,10 @@
 
 #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 */
--- a/src/cache/ftcimage.c
+++ b/src/cache/ftcimage.c
@@ -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 */
--- a/src/cache/ftcimage.h
+++ b/src/cache/ftcimage.h
@@ -72,8 +72,8 @@
 
 #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 */
--- a/src/cache/ftcmanag.c
+++ b/src/cache/ftcmanag.c
@@ -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 */
--- a/src/cache/ftcsbits.c
+++ b/src/cache/ftcsbits.c
@@ -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;
 
--- a/src/cache/ftcsbits.h
+++ b/src/cache/ftcsbits.h
@@ -64,8 +64,8 @@
 
 #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 )