[base, autofit, psaux] Remove unnecessary casting.

* src/autofit/afhints.c (af_glyph_hints_reload): Remove (short) casting.
* src/base/ftgloadr.c (FT_GlyphLoader_Add): Ditto.
* src/psaux/psobjs.c ({t1,cff,ps}_builder_{add,close}_contour): Ditto.
adjust
Alexei Podtelezhnikov 6 months ago
parent deba7feb57
commit 93a067e312
  1. 4
      src/autofit/afhints.c
  2. 22
      src/base/ftgloadr.c
  3. 18
      src/psaux/psobjs.c

@ -1049,13 +1049,13 @@
AF_Point* contour = hints->contours;
AF_Point* contour_limit = contour + hints->num_contours;
short* end = outline->contours;
short idx = 0;
FT_Int idx = 0;
for ( ; contour < contour_limit; contour++, end++ )
{
contour[0] = points + idx;
idx = (short)( end[0] + 1 );
idx = *end + 1;
}
}

@ -357,9 +357,6 @@
{
FT_GlyphLoad base;
FT_GlyphLoad current;
FT_Int n_curr_contours;
FT_Int n_base_points;
FT_Int n;
@ -369,20 +366,13 @@
base = &loader->base;
current = &loader->current;
n_curr_contours = current->outline.n_contours;
n_base_points = base->outline.n_points;
base->outline.n_points =
(short)( base->outline.n_points + current->outline.n_points );
base->outline.n_contours =
(short)( base->outline.n_contours + current->outline.n_contours );
base->num_subglyphs += current->num_subglyphs;
/* adjust contours count in newest outline */
for ( n = 0; n < n_curr_contours; n++ )
current->outline.contours[n] =
(short)( current->outline.contours[n] + n_base_points );
for ( n = 0; n < current->outline.n_contours; n++ )
current->outline.contours[n] += base->outline.n_points;
base->outline.n_points += current->outline.n_points;
base->outline.n_contours += current->outline.n_contours;
base->num_subglyphs += current->num_subglyphs;
/* prepare for another new glyph image */
FT_GlyphLoader_Prepare( loader );

@ -1677,8 +1677,7 @@
if ( !error )
{
if ( outline->n_contours > 0 )
outline->contours[outline->n_contours - 1] =
(short)( outline->n_points - 1 );
outline->contours[outline->n_contours - 1] = outline->n_points - 1;
outline->n_contours++;
}
@ -1760,8 +1759,7 @@
outline->n_points--;
}
else
outline->contours[outline->n_contours - 1] =
(short)( outline->n_points - 1 );
outline->contours[outline->n_contours - 1] = outline->n_points - 1;
}
}
@ -1959,8 +1957,7 @@
if ( !error )
{
if ( outline->n_contours > 0 )
outline->contours[outline->n_contours - 1] =
(short)( outline->n_points - 1 );
outline->contours[outline->n_contours - 1] = outline->n_points - 1;
outline->n_contours++;
}
@ -2039,8 +2036,7 @@
outline->n_points--;
}
else
outline->contours[outline->n_contours - 1] =
(short)( outline->n_points - 1 );
outline->contours[outline->n_contours - 1] = outline->n_points - 1;
}
}
@ -2267,8 +2263,7 @@
if ( !error )
{
if ( outline->n_contours > 0 )
outline->contours[outline->n_contours - 1] =
(short)( outline->n_points - 1 );
outline->contours[outline->n_contours - 1] = outline->n_points - 1;
outline->n_contours++;
}
@ -2347,8 +2342,7 @@
outline->n_points--;
}
else
outline->contours[outline->n_contours - 1] =
(short)( outline->n_points - 1 );
outline->contours[outline->n_contours - 1] = outline->n_points - 1;
}
}

Loading…
Cancel
Save