freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype][master] 2 commits: [cache] Minor casting and co


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] 2 commits: [cache] Minor casting and cosmetic updates.
Date: Sat, 13 May 2023 02:30:29 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

  • 771ff8bd
    by Alexei Podtelezhnikov at 2023-05-12T22:21:47-04:00
    [cache] Minor casting and cosmetic updates.
    
    * src/cache/ftcglyph.c (ftc_gcache_{init,done}): Remove casting.
    (FTC_GCache_Lookup): Cosmetic variable renaming.
    * src/cache/ftcsbits.c (ftc_snode_compare): Formatting.
    
  • e1a4e081
    by Alexei Podtelezhnikov at 2023-05-12T22:27:08-04:00
    [cache] Merge functions.
    
    * src/cache/ftccache.c (FTC_Cache_Init): Merge into...
    (ftc_cache_done): ... this function, with unnecessary checks removed.
    

3 changed files:

Changes:

  • src/cache/ftccache.c
    ... ... @@ -318,13 +318,6 @@
    318 318
       /*************************************************************************/
    
    319 319
     
    
    320 320
     
    
    321
    -  FT_LOCAL_DEF( FT_Error )
    
    322
    -  FTC_Cache_Init( FTC_Cache  cache )
    
    323
    -  {
    
    324
    -    return ftc_cache_init( cache );
    
    325
    -  }
    
    326
    -
    
    327
    -
    
    328 321
       FT_LOCAL_DEF( FT_Error )
    
    329 322
       ftc_cache_init( FTC_Cache  cache )
    
    330 323
       {
    
    ... ... @@ -341,10 +334,20 @@
    341 334
       }
    
    342 335
     
    
    343 336
     
    
    344
    -  static void
    
    345
    -  FTC_Cache_Clear( FTC_Cache  cache )
    
    337
    +  FT_LOCAL_DEF( FT_Error )
    
    338
    +  FTC_Cache_Init( FTC_Cache  cache )
    
    339
    +  {
    
    340
    +    return ftc_cache_init( cache );
    
    341
    +  }
    
    342
    +
    
    343
    +
    
    344
    +  FT_LOCAL_DEF( void )
    
    345
    +  ftc_cache_done( FTC_Cache  cache )
    
    346 346
       {
    
    347
    -    if ( cache && cache->buckets )
    
    347
    +    FT_Memory  memory = cache->memory;
    
    348
    +
    
    349
    +
    
    350
    +    if ( cache->buckets )
    
    348 351
         {
    
    349 352
           FTC_Manager  manager = cache->manager;
    
    350 353
           FT_UFast     count   = cache->p;
    
    ... ... @@ -370,30 +373,14 @@
    370 373
               cache->clazz.node_free( node, cache );
    
    371 374
               node = next;
    
    372 375
             }
    
    373
    -        cache->buckets[i] = NULL;
    
    374 376
           }
    
    375
    -      ftc_cache_resize( cache );
    
    376 377
         }
    
    377
    -  }
    
    378 378
     
    
    379
    +    FT_FREE( cache->buckets );
    
    379 380
     
    
    380
    -  FT_LOCAL_DEF( void )
    
    381
    -  ftc_cache_done( FTC_Cache  cache )
    
    382
    -  {
    
    383
    -    if ( cache->memory )
    
    384
    -    {
    
    385
    -      FT_Memory  memory = cache->memory;
    
    386
    -
    
    387
    -
    
    388
    -      FTC_Cache_Clear( cache );
    
    389
    -
    
    390
    -      FT_FREE( cache->buckets );
    
    391
    -      cache->mask  = 0;
    
    392
    -      cache->p     = 0;
    
    393
    -      cache->slack = 0;
    
    394
    -
    
    395
    -      cache->memory = NULL;
    
    396
    -    }
    
    381
    +    cache->p     = 0;
    
    382
    +    cache->mask  = 0;
    
    383
    +    cache->slack = 0;
    
    397 384
       }
    
    398 385
     
    
    399 386
     
    

  • src/cache/ftcglyph.c
    ... ... @@ -101,22 +101,22 @@
    101 101
     
    
    102 102
     
    
    103 103
       FT_LOCAL_DEF( FT_Error )
    
    104
    -  ftc_gcache_init( FTC_Cache  ftccache )
    
    104
    +  ftc_gcache_init( FTC_Cache  cache )
    
    105 105
       {
    
    106
    -    FTC_GCache  cache = (FTC_GCache)ftccache;
    
    106
    +    FTC_GCache  gcache = (FTC_GCache)cache;
    
    107 107
         FT_Error    error;
    
    108 108
     
    
    109 109
     
    
    110
    -    error = FTC_Cache_Init( FTC_CACHE( cache ) );
    
    110
    +    error = FTC_Cache_Init( cache );
    
    111 111
         if ( !error )
    
    112 112
         {
    
    113
    -      FTC_GCacheClass   clazz = (FTC_GCacheClass)FTC_CACHE( cache )->org_class;
    
    113
    +      FTC_GCacheClass   clazz = (FTC_GCacheClass)cache->org_class;
    
    114 114
     
    
    115
    -      FTC_MruList_Init( &cache->families,
    
    115
    +      FTC_MruList_Init( &gcache->families,
    
    116 116
                             clazz->family_class,
    
    117 117
                             0,  /* no maximum here! */
    
    118 118
                             cache,
    
    119
    -                        FTC_CACHE( cache )->memory );
    
    119
    +                        cache->memory );
    
    120 120
         }
    
    121 121
     
    
    122 122
         return error;
    
    ... ... @@ -126,31 +126,31 @@
    126 126
     #if 0
    
    127 127
     
    
    128 128
       FT_LOCAL_DEF( FT_Error )
    
    129
    -  FTC_GCache_Init( FTC_GCache  cache )
    
    129
    +  FTC_GCache_Init( FTC_GCache  gcache )
    
    130 130
       {
    
    131
    -    return ftc_gcache_init( FTC_CACHE( cache ) );
    
    131
    +    return ftc_gcache_init( FTC_CACHE( gcache ) );
    
    132 132
       }
    
    133 133
     
    
    134 134
     #endif /* 0 */
    
    135 135
     
    
    136 136
     
    
    137 137
       FT_LOCAL_DEF( void )
    
    138
    -  ftc_gcache_done( FTC_Cache  ftccache )
    
    138
    +  ftc_gcache_done( FTC_Cache  cache )
    
    139 139
       {
    
    140
    -    FTC_GCache  cache = (FTC_GCache)ftccache;
    
    140
    +    FTC_GCache  gcache = (FTC_GCache)cache;
    
    141 141
     
    
    142 142
     
    
    143
    -    FTC_Cache_Done( (FTC_Cache)cache );
    
    144
    -    FTC_MruList_Done( &cache->families );
    
    143
    +    FTC_Cache_Done( cache );
    
    144
    +    FTC_MruList_Done( &gcache->families );
    
    145 145
       }
    
    146 146
     
    
    147 147
     
    
    148 148
     #if 0
    
    149 149
     
    
    150 150
       FT_LOCAL_DEF( void )
    
    151
    -  FTC_GCache_Done( FTC_GCache  cache )
    
    151
    +  FTC_GCache_Done( FTC_GCache  gcache )
    
    152 152
       {
    
    153
    -    ftc_gcache_done( FTC_CACHE( cache ) );
    
    153
    +    ftc_gcache_done( FTC_CACHE( gcache ) );
    
    154 154
       }
    
    155 155
     
    
    156 156
     #endif /* 0 */
    
    ... ... @@ -169,7 +169,7 @@
    169 169
     #ifndef FTC_INLINE
    
    170 170
     
    
    171 171
       FT_LOCAL_DEF( FT_Error )
    
    172
    -  FTC_GCache_Lookup( FTC_GCache   cache,
    
    172
    +  FTC_GCache_Lookup( FTC_GCache   gcache,
    
    173 173
                          FT_Offset    hash,
    
    174 174
                          FT_UInt      gindex,
    
    175 175
                          FTC_GQuery   query,
    
    ... ... @@ -190,7 +190,7 @@
    190 190
           /* out-of-memory condition occurs during glyph node initialization. */
    
    191 191
           family->num_nodes++;
    
    192 192
     
    
    193
    -      error = FTC_Cache_Lookup( FTC_CACHE( cache ), hash, query, anode );
    
    193
    +      error = FTC_Cache_Lookup( FTC_CACHE( gcache ), hash, query, anode );
    
    194 194
     
    
    195 195
           if ( --family->num_nodes == 0 )
    
    196 196
             FTC_FAMILY_FREE( family, cache );
    

  • src/cache/ftcsbits.c
    ... ... @@ -342,7 +342,7 @@
    342 342
         FT_Bool     result;
    
    343 343
     
    
    344 344
     
    
    345
    -    if (list_changed)
    
    345
    +    if ( list_changed )
    
    346 346
           *list_changed = FALSE;
    
    347 347
         result = FT_BOOL( gnode->family == gquery->family       &&
    
    348 348
                           gindex - gnode->gindex < snode->count );
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]