freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] Fix compilation errors and (some) warni


From: Werner Lemberg (@wl)
Subject: [Git][freetype/freetype][master] Fix compilation errors and (some) warnings for clang++.
Date: Sat, 29 May 2021 09:02:17 +0000

Werner Lemberg pushed to branch master at FreeType / FreeType

Commits:

13 changed files:

Changes:

  • ChangeLog
    1
    +2021-05-29  Werner Lemberg  <wl@gnu.org>
    
    2
    +
    
    3
    +	Fix compilation errors and (some) warnings for clang++.
    
    4
    +
    
    5
    +	* src/autofit/afmodule.c (AF_GlyphHintsRec): Make it static.
    
    6
    +
    
    7
    +	* src/cache/ftcache.c (FTC_Cache_NewNode), src/cache/ftcsbits.c
    
    8
    +	(ftc_snode_compare): Remove semicolon.
    
    9
    +
    
    10
    +	* src/cff/cffparse.c (cff_parser_run): Add `break` statement.
    
    11
    +
    
    12
    +	* src/cid/cidload.c (cid_hex_to_binary): Add cast.
    
    13
    +
    
    14
    +	* src/sdf/ftbsdf.c (CHECK_NEIGHBOR): Use `do {} while(0)` loop.
    
    15
    +	(bsdf_init_distance_map, finalize_sdf, bsdf_raster_render): Add
    
    16
    +	casts.
    
    17
    +	* src/sdf/ftsdf.c (sdf_generate_bounding_box,
    
    18
    +	sdf_generate_with_overlaps): Ditto.
    
    19
    +	* src/sdf/ftsdfcommon.h (square_root): Ditto.
    
    20
    +	* src/sdf/ftsdfrend.c (sdf_property_get, ft_sdf_render,
    
    21
    +	ft_bsdf_render): Ditto.
    
    22
    +
    
    23
    +	* src/sfnt/ttcolr.c (find_base_glyph_record,
    
    24
    +	find_base_glyph_v1_record): Fix variable signedness.
    
    25
    +	(read_color_line): Add cast.
    
    26
    +	(read_paint): Add casts.
    
    27
    +	Fix signedness issue.
    
    28
    +	(tt_face_get_colorline_stops) Fix signedness issues.
    
    29
    +
    
    30
    +	* src/sfnt/ttpost.c (load_format_20): Add casts.
    
    31
    +
    
    32
    +	* src/truetype/ttsubpix.c (TWEAK_RULES, TWEAK_RULES_EXCEPTIONS):
    
    33
    +	Remove final semicolons.
    
    34
    +
    
    1 35
     2021-05-29  Werner Lemberg  <wl@gnu.org>
    
    2 36
     
    
    3 37
     	[build] Allow overriding of `ANSIFLAGS` for GNU make build.
    

  • src/autofit/afmodule.c
    ... ... @@ -48,7 +48,7 @@
    48 48
       int  _af_debug_disable_blue_hints;
    
    49 49
     
    
    50 50
       /* we use a global object instead of a local one for debugging */
    
    51
    -  AF_GlyphHintsRec  _af_debug_hints_rec[1];
    
    51
    +  static AF_GlyphHintsRec  _af_debug_hints_rec[1];
    
    52 52
     
    
    53 53
       void*  _af_debug_hints = _af_debug_hints_rec;
    
    54 54
     #endif
    

  • src/cache/ftccache.c
    ... ... @@ -459,7 +459,7 @@
    459 459
         {
    
    460 460
           error = cache->clazz.node_new( &node, query, cache );
    
    461 461
         }
    
    462
    -    FTC_CACHE_TRYLOOP_END( NULL );
    
    462
    +    FTC_CACHE_TRYLOOP_END( NULL )
    
    463 463
     
    
    464 464
         if ( error )
    
    465 465
           node = NULL;
    

  • src/cache/ftcsbits.c
    ... ... @@ -395,7 +395,7 @@
    395 395
             {
    
    396 396
               error = ftc_snode_load( snode, cache->manager, gindex, &size );
    
    397 397
             }
    
    398
    -        FTC_CACHE_TRYLOOP_END( list_changed );
    
    398
    +        FTC_CACHE_TRYLOOP_END( list_changed )
    
    399 399
     
    
    400 400
             ftcsnode->ref_count--;  /* unlock the node */
    
    401 401
     
    

  • src/cff/cffparse.c
    ... ... @@ -1516,6 +1516,7 @@
    1516 1516
     
    
    1517 1517
                   case cff_kind_fixed_thousand:
    
    1518 1518
                     FT_TRACE4(( " %f\n", (double)val / 65536 / 1000 ));
    
    1519
    +                break;
    
    1519 1520
     
    
    1520 1521
                   default:
    
    1521 1522
                     ; /* never reached */
    

  • src/cid/cidload.c
    ... ... @@ -758,7 +758,7 @@
    758 758
         error = FT_Err_Ok;
    
    759 759
     
    
    760 760
       Exit:
    
    761
    -    *data_written = d - data;
    
    761
    +    *data_written = FT_ULong( d - data );
    
    762 762
         return error;
    
    763 763
       }
    
    764 764
     
    

  • src/sdf/ftbsdf.c
    ... ... @@ -289,19 +289,22 @@
    289 289
     #undef CHECK_NEIGHBOR
    
    290 290
     #endif
    
    291 291
     
    
    292
    -#define CHECK_NEIGHBOR( x_offset, y_offset )            \
    
    293
    -          if ( x + x_offset >= 0 && x + x_offset < w && \
    
    294
    -               y + y_offset >= 0 && y + y_offset < r )  \
    
    295
    -          {                                             \
    
    296
    -            num_neighbors++;                            \
    
    297
    -                                                        \
    
    298
    -            to_check = dm + y_offset * w + x_offset;    \
    
    299
    -            if ( to_check->alpha == 0 )                 \
    
    300
    -            {                                           \
    
    301
    -              is_edge = 1;                              \
    
    302
    -              goto Done;                                \
    
    303
    -            }                                           \
    
    304
    -          }
    
    292
    +#define CHECK_NEIGHBOR( x_offset, y_offset )              \
    
    293
    +          do                                              \
    
    294
    +          {                                               \
    
    295
    +            if ( x + x_offset >= 0 && x + x_offset < w && \
    
    296
    +                 y + y_offset >= 0 && y + y_offset < r )  \
    
    297
    +            {                                             \
    
    298
    +              num_neighbors++;                            \
    
    299
    +                                                          \
    
    300
    +              to_check = dm + y_offset * w + x_offset;    \
    
    301
    +              if ( to_check->alpha == 0 )                 \
    
    302
    +              {                                           \
    
    303
    +                is_edge = 1;                              \
    
    304
    +                goto Done;                                \
    
    305
    +              }                                           \
    
    306
    +            }                                             \
    
    307
    +          } while ( 0 )
    
    305 308
     
    
    306 309
       static FT_Bool
    
    307 310
       bsdf_is_edge( ED*     dm,   /* distance map              */
    
    ... ... @@ -693,8 +696,8 @@
    693 696
     
    
    694 697
         /* Calculate the width and row differences */
    
    695 698
         /* between target and source.              */
    
    696
    -    x_diff = worker->width - source->width;
    
    697
    -    y_diff = worker->rows - source->rows;
    
    699
    +    x_diff = worker->width - (int)source->width;
    
    700
    +    y_diff = worker->rows - (int)source->rows;
    
    698 701
     
    
    699 702
         x_diff /= 2;
    
    700 703
         y_diff /= 2;
    
    ... ... @@ -716,8 +719,8 @@
    716 719
           {
    
    717 720
             FT_Int  t_width = worker->width;
    
    718 721
             FT_Int  t_rows  = worker->rows;
    
    719
    -        FT_Int  s_width = source->width;
    
    720
    -        FT_Int  s_rows  = source->rows;
    
    722
    +        FT_Int  s_width = (int)source->width;
    
    723
    +        FT_Int  s_rows  = (int)source->rows;
    
    721 724
     
    
    722 725
     
    
    723 726
             for ( t_j = 0; t_j < t_rows; t_j++ )
    
    ... ... @@ -750,7 +753,7 @@
    750 753
                 mod = 7 - s_i % 8;
    
    751 754
     
    
    752 755
                 pixel = s[div];
    
    753
    -            byte  = 1 << mod;
    
    756
    +            byte  = (FT_Byte)( 1 << mod );
    
    754 757
     
    
    755 758
                 t[t_index].alpha = pixel & byte ? 255 : 0;
    
    756 759
     
    
    ... ... @@ -764,8 +767,8 @@
    764 767
           {
    
    765 768
             FT_Int  t_width = worker->width;
    
    766 769
             FT_Int  t_rows  = worker->rows;
    
    767
    -        FT_Int  s_width = source->width;
    
    768
    -        FT_Int  s_rows  = source->rows;
    
    770
    +        FT_Int  s_width = (int)source->width;
    
    771
    +        FT_Int  s_rows  = (int)source->rows;
    
    769 772
     
    
    770 773
     
    
    771 774
             /* loop over all pixels and assign pixel values from source */
    
    ... ... @@ -1103,8 +1106,8 @@
    1103 1106
           goto Exit;
    
    1104 1107
         }
    
    1105 1108
     
    
    1106
    -    w        = target->width;
    
    1107
    -    r        = target->rows;
    
    1109
    +    w        = (int)target->width;
    
    1110
    +    r        = (int)target->rows;
    
    1108 1111
         t_buffer = (FT_6D10*)target->buffer;
    
    1109 1112
     
    
    1110 1113
         if ( w != worker->width ||
    
    ... ... @@ -1222,8 +1225,8 @@
    1222 1225
         FT_Error   error  = FT_Err_Ok;
    
    1223 1226
         FT_Memory  memory = NULL;
    
    1224 1227
     
    
    1225
    -    const FT_Bitmap*  source      = NULL;
    
    1226
    -    const FT_Bitmap*  target      = NULL;
    
    1228
    +    const FT_Bitmap*  source = NULL;
    
    1229
    +    const FT_Bitmap*  target = NULL;
    
    1227 1230
     
    
    1228 1231
         BSDF_TRaster*  bsdf_raster = (BSDF_TRaster*)raster;
    
    1229 1232
         BSDF_Worker    worker;
    
    ... ... @@ -1247,8 +1250,8 @@
    1247 1250
           goto Exit;
    
    1248 1251
         }
    
    1249 1252
     
    
    1250
    -    source = sdf_params->root.source;
    
    1251
    -    target = sdf_params->root.target;
    
    1253
    +    source = (const FT_Bitmap*)sdf_params->root.source;
    
    1254
    +    target = (const FT_Bitmap*)sdf_params->root.target;
    
    1252 1255
     
    
    1253 1256
         /* check source and target bitmap */
    
    1254 1257
         if ( !source || !target )
    
    ... ... @@ -1298,8 +1301,8 @@
    1298 1301
                              target->width * sizeof ( *worker.distance_map ) ) )
    
    1299 1302
           goto Exit;
    
    1300 1303
     
    
    1301
    -    worker.width  = target->width;
    
    1302
    -    worker.rows   = target->rows;
    
    1304
    +    worker.width  = (int)target->width;
    
    1305
    +    worker.rows   = (int)target->rows;
    
    1303 1306
         worker.params = *sdf_params;
    
    1304 1307
     
    
    1305 1308
         FT_CALL( bsdf_init_distance_map( source, &worker ) );
    
    ... ... @@ -1309,7 +1312,7 @@
    1309 1312
     
    
    1310 1313
         FT_TRACE0(( "bsdf_raster_render: Total memory used = %ld\n",
    
    1311 1314
                     worker.width * worker.rows *
    
    1312
    -                  sizeof ( *worker.distance_map ) ));
    
    1315
    +                  (long)sizeof ( *worker.distance_map ) ));
    
    1313 1316
     
    
    1314 1317
       Exit:
    
    1315 1318
         if ( worker.distance_map )
    

  • src/sdf/ftsdf.c
    ... ... @@ -3222,18 +3222,19 @@
    3222 3222
           goto Exit;
    
    3223 3223
         }
    
    3224 3224
     
    
    3225
    +    if ( FT_ALLOC( dists,
    
    3226
    +                   bitmap->width * bitmap->rows * sizeof ( *dists ) ) )
    
    3227
    +      goto Exit;
    
    3228
    +
    
    3225 3229
         contours = shape->contours;
    
    3226 3230
         width    = (FT_Int)bitmap->width;
    
    3227 3231
         rows     = (FT_Int)bitmap->rows;
    
    3228 3232
         buffer   = (FT_Short*)bitmap->buffer;
    
    3229 3233
     
    
    3230
    -    if ( FT_ALLOC( dists, width * rows * sizeof ( *dists ) ) )
    
    3231
    -      goto Exit;
    
    3232
    -
    
    3233 3234
         if ( USE_SQUARED_DISTANCES )
    
    3234
    -      sp_sq = FT_INT_16D16( spread * spread );
    
    3235
    +      sp_sq = (FT_Int)FT_INT_16D16( spread * spread );
    
    3235 3236
         else
    
    3236
    -      sp_sq = FT_INT_16D16( spread );
    
    3237
    +      sp_sq = (FT_Int)FT_INT_16D16( spread );
    
    3237 3238
     
    
    3238 3239
         if ( width == 0 || rows == 0 )
    
    3239 3240
         {
    
    ... ... @@ -3307,9 +3308,9 @@
    3307 3308
                   dist.distance = square_root( dist.distance );
    
    3308 3309
     
    
    3309 3310
                 if ( internal_params.flip_y )
    
    3310
    -              index = y * width + x;
    
    3311
    +              index = FT_UInt( y * width + x );
    
    3311 3312
                 else
    
    3312
    -              index = ( rows - y - 1 ) * width + x;
    
    3313
    +              index = FT_UInt( ( rows - y - 1 ) * width + x );
    
    3313 3314
     
    
    3314 3315
                 /* check whether the pixel is set or not */
    
    3315 3316
                 if ( dists[index].sign == 0 )
    
    ... ... @@ -3341,7 +3342,7 @@
    3341 3342
     
    
    3342 3343
           for ( i = 0; i < width; i++ )
    
    3343 3344
           {
    
    3344
    -        index = j * width + i;
    
    3345
    +        index = (FT_UInt)( j * width + i );
    
    3345 3346
     
    
    3346 3347
             /* if the pixel is not set                     */
    
    3347 3348
             /* its shortest distance is more than `spread` */
    
    ... ... @@ -3527,11 +3528,13 @@
    3527 3528
         }
    
    3528 3529
     
    
    3529 3530
         /* allocate the bitmaps to generate SDF for separate contours */
    
    3530
    -    if ( FT_ALLOC( bitmaps, num_contours * sizeof ( *bitmaps ) ) )
    
    3531
    +    if ( FT_ALLOC( bitmaps,
    
    3532
    +                   (FT_UInt)num_contours * sizeof ( *bitmaps ) ) )
    
    3531 3533
           goto Exit;
    
    3532 3534
     
    
    3533 3535
         /* allocate array to hold orientation for all contours */
    
    3534
    -    if ( FT_ALLOC( orientations, num_contours * sizeof ( *orientations ) ) )
    
    3536
    +    if ( FT_ALLOC( orientations,
    
    3537
    +                   (FT_UInt)num_contours * sizeof ( *orientations ) ) )
    
    3535 3538
           goto Exit;
    
    3536 3539
     
    
    3537 3540
         /* Disable `flip_sign` to avoid extra complication */
    
    ... ... @@ -3554,7 +3557,8 @@
    3554 3557
           bitmaps[i].pixel_mode = bitmap->pixel_mode;
    
    3555 3558
     
    
    3556 3559
           /* allocate memory for the buffer */
    
    3557
    -      if ( FT_ALLOC( bitmaps[i].buffer, bitmap->rows * bitmap->pitch ) )
    
    3560
    +      if ( FT_ALLOC( bitmaps[i].buffer,
    
    3561
    +                     bitmap->rows * (FT_UInt)bitmap->pitch ) )
    
    3558 3562
             goto Exit;
    
    3559 3563
     
    
    3560 3564
           /* determine the orientation */
    

  • src/sdf/ftsdfcommon.h
    ... ... @@ -139,7 +139,7 @@ FT_BEGIN_HEADER
    139 139
         FT_ULong  t, q, b, r;
    
    140 140
     
    
    141 141
     
    
    142
    -    r = val;
    
    142
    +    r = (FT_ULong)val;
    
    143 143
         b = 0x40000000L;
    
    144 144
         q = 0;
    
    145 145
     
    
    ... ... @@ -159,7 +159,7 @@ FT_BEGIN_HEADER
    159 159
     
    
    160 160
         q >>= 8;
    
    161 161
     
    
    162
    -    return q;
    
    162
    +    return (FT_16D16)q;
    
    163 163
       }
    
    164 164
     
    
    165 165
     
    

  • src/sdf/ftsdfrend.c
    ... ... @@ -142,7 +142,7 @@
    142 142
     
    
    143 143
         if ( ft_strcmp( property_name, "spread" ) == 0 )
    
    144 144
         {
    
    145
    -      FT_Int*  val = (FT_Int*)value;
    
    145
    +      FT_UInt*  val = (FT_UInt*)value;
    
    146 146
     
    
    147 147
     
    
    148 148
           *val = render->spread;
    
    ... ... @@ -314,7 +314,7 @@
    314 314
     
    
    315 315
         /* ignore the pitch, pixel mode and set custom */
    
    316 316
         bitmap->pixel_mode = FT_PIXEL_MODE_GRAY16;
    
    317
    -    bitmap->pitch      = bitmap->width * 2;
    
    317
    +    bitmap->pitch      = (int)( bitmap->width * 2 );
    
    318 318
         bitmap->num_grays  = 65535;
    
    319 319
     
    
    320 320
         /* allocate new buffer */
    
    ... ... @@ -525,7 +525,7 @@
    525 525
     
    
    526 526
         /* set up the target bitmap */
    
    527 527
         target.pixel_mode = FT_PIXEL_MODE_GRAY16;
    
    528
    -    target.pitch      = target.width * 2;
    
    528
    +    target.pitch      = (int)( target.width * 2 );
    
    529 529
         target.num_grays  = 65535;
    
    530 530
     
    
    531 531
         if ( FT_ALLOC_MULT( target.buffer, target.rows, target.pitch ) )
    

  • src/sfnt/ttcolr.c
    ... ... @@ -228,17 +228,17 @@
    228 228
     
    
    229 229
       static FT_Bool
    
    230 230
       find_base_glyph_record( FT_Byte*          base_glyph_begin,
    
    231
    -                          FT_Int            num_base_glyph,
    
    231
    +                          FT_UInt           num_base_glyph,
    
    232 232
                               FT_UInt           glyph_id,
    
    233 233
                               BaseGlyphRecord*  record )
    
    234 234
       {
    
    235
    -    FT_Int  min = 0;
    
    236
    -    FT_Int  max = num_base_glyph - 1;
    
    235
    +    FT_UInt  min = 0;
    
    236
    +    FT_UInt  max = num_base_glyph - 1;
    
    237 237
     
    
    238 238
     
    
    239 239
         while ( min <= max )
    
    240 240
         {
    
    241
    -      FT_Int    mid = min + ( max - min ) / 2;
    
    241
    +      FT_UInt   mid = min + ( max - min ) / 2;
    
    242 242
           FT_Byte*  p   = base_glyph_begin + mid * BASE_GLYPH_SIZE;
    
    243 243
     
    
    244 244
           FT_UShort  gid = FT_NEXT_USHORT( p );
    
    ... ... @@ -327,7 +327,7 @@
    327 327
         FT_PaintExtend  paint_extend;
    
    328 328
     
    
    329 329
     
    
    330
    -    paint_extend = FT_NEXT_BYTE( p );
    
    330
    +    paint_extend = (FT_PaintExtend)FT_NEXT_BYTE( p );
    
    331 331
         if ( paint_extend > FT_COLR_PAINT_EXTEND_REFLECT )
    
    332 332
           return 0;
    
    333 333
     
    
    ... ... @@ -392,7 +392,7 @@
    392 392
              p >= ( (FT_Byte*)colr->table + colr->table_size ) )
    
    393 393
           return 0;
    
    394 394
     
    
    395
    -    apaint->format = FT_NEXT_BYTE( p );
    
    395
    +    apaint->format = (FT_PaintFormat)FT_NEXT_BYTE( p );
    
    396 396
     
    
    397 397
         if ( apaint->format >= FT_COLR_PAINT_FORMAT_MAX )
    
    398 398
           return 0;
    
    ... ... @@ -425,8 +425,8 @@
    425 425
     
    
    426 426
         else if ( apaint->format == FT_COLR_PAINTFORMAT_SOLID )
    
    427 427
         {
    
    428
    -      apaint->u.solid.color.palette_index = FT_NEXT_USHORT ( p );
    
    429
    -      apaint->u.solid.color.alpha         = FT_NEXT_USHORT ( p );
    
    428
    +      apaint->u.solid.color.palette_index = FT_NEXT_USHORT( p );
    
    429
    +      apaint->u.solid.color.alpha         = FT_NEXT_SHORT( p );
    
    430 430
     
    
    431 431
           return 1;
    
    432 432
         }
    
    ... ... @@ -454,12 +454,12 @@
    454 454
                                  &apaint->u.linear_gradient.colorline ) )
    
    455 455
             return 0;
    
    456 456
     
    
    457
    -      apaint->u.linear_gradient.p0.x = FT_NEXT_SHORT ( p );
    
    458
    -      apaint->u.linear_gradient.p0.y = FT_NEXT_SHORT ( p );
    
    459
    -      apaint->u.linear_gradient.p1.x = FT_NEXT_SHORT ( p );
    
    460
    -      apaint->u.linear_gradient.p1.y = FT_NEXT_SHORT ( p );
    
    461
    -      apaint->u.linear_gradient.p2.x = FT_NEXT_SHORT ( p );
    
    462
    -      apaint->u.linear_gradient.p2.y = FT_NEXT_SHORT ( p );
    
    457
    +      apaint->u.linear_gradient.p0.x = FT_NEXT_SHORT( p );
    
    458
    +      apaint->u.linear_gradient.p0.y = FT_NEXT_SHORT( p );
    
    459
    +      apaint->u.linear_gradient.p1.x = FT_NEXT_SHORT( p );
    
    460
    +      apaint->u.linear_gradient.p1.y = FT_NEXT_SHORT( p );
    
    461
    +      apaint->u.linear_gradient.p2.x = FT_NEXT_SHORT( p );
    
    462
    +      apaint->u.linear_gradient.p2.y = FT_NEXT_SHORT( p );
    
    463 463
     
    
    464 464
           return 1;
    
    465 465
         }
    
    ... ... @@ -470,15 +470,15 @@
    470 470
                                  &apaint->u.radial_gradient.colorline ) )
    
    471 471
             return 0;
    
    472 472
     
    
    473
    -      apaint->u.radial_gradient.c0.x = FT_NEXT_SHORT ( p );
    
    474
    -      apaint->u.radial_gradient.c0.y = FT_NEXT_SHORT ( p );
    
    473
    +      apaint->u.radial_gradient.c0.x = FT_NEXT_SHORT( p );
    
    474
    +      apaint->u.radial_gradient.c0.y = FT_NEXT_SHORT( p );
    
    475 475
     
    
    476
    -      apaint->u.radial_gradient.r0 = FT_NEXT_USHORT ( p );
    
    476
    +      apaint->u.radial_gradient.r0 = FT_NEXT_USHORT( p );
    
    477 477
     
    
    478
    -      apaint->u.radial_gradient.c1.x = FT_NEXT_SHORT ( p );
    
    479
    -      apaint->u.radial_gradient.c1.y = FT_NEXT_SHORT ( p );
    
    478
    +      apaint->u.radial_gradient.c1.x = FT_NEXT_SHORT( p );
    
    479
    +      apaint->u.radial_gradient.c1.y = FT_NEXT_SHORT( p );
    
    480 480
     
    
    481
    -      apaint->u.radial_gradient.r1 = FT_NEXT_USHORT ( p );
    
    481
    +      apaint->u.radial_gradient.r1 = FT_NEXT_USHORT( p );
    
    482 482
     
    
    483 483
           return 1;
    
    484 484
         }
    
    ... ... @@ -489,8 +489,8 @@
    489 489
                                  &apaint->u.sweep_gradient.colorline ) )
    
    490 490
             return 0;
    
    491 491
     
    
    492
    -      apaint->u.sweep_gradient.center.x = FT_NEXT_SHORT ( p );
    
    493
    -      apaint->u.sweep_gradient.center.y = FT_NEXT_SHORT ( p );
    
    492
    +      apaint->u.sweep_gradient.center.x = FT_NEXT_SHORT( p );
    
    493
    +      apaint->u.sweep_gradient.center.y = FT_NEXT_SHORT( p );
    
    494 494
     
    
    495 495
           apaint->u.sweep_gradient.start_angle = FT_NEXT_LONG( p );
    
    496 496
           apaint->u.sweep_gradient.end_angle = FT_NEXT_LONG( p );
    
    ... ... @@ -572,7 +572,7 @@
    572 572
           if ( composite_mode >= FT_COLR_COMPOSITE_MAX )
    
    573 573
             return 0;
    
    574 574
     
    
    575
    -      apaint->u.composite.composite_mode = composite_mode;
    
    575
    +      apaint->u.composite.composite_mode = (FT_Composite_Mode)composite_mode;
    
    576 576
     
    
    577 577
           if ( !get_child_table_pointer( colr, paint_base, &p, &child_table_p ) )
    
    578 578
              return 0;
    
    ... ... @@ -591,17 +591,17 @@
    591 591
     
    
    592 592
       static FT_Bool
    
    593 593
       find_base_glyph_v1_record ( FT_Byte *           base_glyph_begin,
    
    594
    -                              FT_Int              num_base_glyph,
    
    594
    +                              FT_UInt             num_base_glyph,
    
    595 595
                                   FT_UInt             glyph_id,
    
    596 596
                                   BaseGlyphV1Record  *record )
    
    597 597
       {
    
    598
    -    FT_Int  min = 0;
    
    599
    -    FT_Int  max = num_base_glyph - 1;
    
    598
    +    FT_UInt  min = 0;
    
    599
    +    FT_UInt  max = num_base_glyph - 1;
    
    600 600
     
    
    601 601
     
    
    602 602
         while ( min <= max )
    
    603 603
         {
    
    604
    -      FT_Int  mid = min + ( max - min ) / 2;
    
    604
    +      FT_UInt  mid = min + ( max - min ) / 2;
    
    605 605
     
    
    606 606
           /*
    
    607 607
            * `base_glyph_begin` is the beginning of `BaseGlyphV1List`;
    
    ... ... @@ -763,11 +763,11 @@
    763 763
         /* Iterator points at first `ColorStop` of `ColorLine`. */
    
    764 764
         p = iterator->p;
    
    765 765
     
    
    766
    -    color_stop->stop_offset = FT_NEXT_USHORT ( p );
    
    766
    +    color_stop->stop_offset = FT_NEXT_SHORT( p );
    
    767 767
     
    
    768
    -    color_stop->color.palette_index = FT_NEXT_USHORT ( p );
    
    768
    +    color_stop->color.palette_index = FT_NEXT_USHORT( p );
    
    769 769
     
    
    770
    -    color_stop->color.alpha = FT_NEXT_USHORT ( p );
    
    770
    +    color_stop->color.alpha = FT_NEXT_SHORT( p );
    
    771 771
     
    
    772 772
         iterator->p = p;
    
    773 773
         iterator->current_color_stop++;
    

  • src/sfnt/ttpost.c
    ... ... @@ -180,8 +180,8 @@
    180 180
         /* There already exist fonts which have more than 32768 glyph names */
    
    181 181
         /* in this table, so the test for this threshold has been dropped.  */
    
    182 182
     
    
    183
    -    if ( num_glyphs > face->max_profile.numGlyphs ||
    
    184
    -         num_glyphs * 2UL > post_len - 2          )
    
    183
    +    if ( num_glyphs > face->max_profile.numGlyphs  ||
    
    184
    +         (FT_ULong)num_glyphs * 2UL > post_len - 2 )
    
    185 185
         {
    
    186 186
           error = FT_THROW( Invalid_File_Format );
    
    187 187
           goto Exit;
    
    ... ... @@ -231,7 +231,7 @@
    231 231
           FT_ULong   p;
    
    232 232
     
    
    233 233
     
    
    234
    -      post_len -= num_glyphs * 2UL + 2;
    
    234
    +      post_len -= (FT_ULong)num_glyphs * 2UL + 2;
    
    235 235
     
    
    236 236
           if ( FT_QALLOC( strings, post_len + 1 )       ||
    
    237 237
                FT_STREAM_READ( strings, post_len )      ||
    

  • src/truetype/ttsubpix.c
    ... ... @@ -891,12 +891,12 @@
    891 891
     #define TWEAK_RULES( x )                                       \
    
    892 892
       if ( sph_test_tweak( face, family, ppem, style, glyph_index, \
    
    893 893
                            x##_Rules, x##_RULES_SIZE ) )           \
    
    894
    -    loader->exec->sph_tweak_flags |= SPH_TWEAK_##x;
    
    894
    +    loader->exec->sph_tweak_flags |= SPH_TWEAK_##x
    
    895 895
     
    
    896 896
     #define TWEAK_RULES_EXCEPTIONS( x )                                        \
    
    897 897
       if ( sph_test_tweak( face, family, ppem, style, glyph_index,             \
    
    898 898
                            x##_Rules_Exceptions, x##_RULES_EXCEPTIONS_SIZE ) ) \
    
    899
    -    loader->exec->sph_tweak_flags &= ~SPH_TWEAK_##x;
    
    899
    +    loader->exec->sph_tweak_flags &= ~SPH_TWEAK_##x
    
    900 900
     
    
    901 901
     
    
    902 902
       FT_LOCAL_DEF( void )
    


  • reply via email to

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