[Savannah bug #43682] Add/remove `void' casts to some functions.

We use a cast to indicate that we intentionally ignore a function's
return value.  However, this doesn't apply to API functions where
errors can only happen for trivially invalid input.

* src/base/ftstroke.c (FT_Glyph_Stroke, FT_Glyph_StrokeBorder),
src/base/ftsynth.c (FT_GlyphSlot_Embolden), src/cff/cffgload.c
(cff_slot_load), src/pfr/pfrdrivr.c (pfr_get_kerning),
src/type1/t1load.c (parse_encoding), src/type42/t42parse.c
(t42_parse_encoding): Do it.
This commit is contained in:
Werner Lemberg 2014-11-25 08:30:49 +01:00
parent ef439fd209
commit b24e8ba28a
8 changed files with 38 additions and 26 deletions

View File

@ -1,3 +1,17 @@
2014-11-24 Werner Lemberg <wl@gnu.org>
[Savannah bug #43682] Add/remove `void' casts to some functions.
We use a cast to indicate that we intentionally ignore a function's
return value. However, this doesn't apply to API functions where
errors can only happen for trivially invalid input.
* src/base/ftstroke.c (FT_Glyph_Stroke, FT_Glyph_StrokeBorder),
src/base/ftsynth.c (FT_GlyphSlot_Embolden), src/cff/cffgload.c
(cff_slot_load), src/pfr/pfrdrivr.c (pfr_get_kerning),
src/type1/t1load.c (parse_encoding), src/type42/t42parse.c
(t42_parse_encoding): Do it.
2014-11-24 Werner Lemberg <wl@gnu.org>
[Savannah bug #43682] Change some signatures to `void' return type.

View File

@ -2294,7 +2294,7 @@
if ( error )
goto Fail;
(void)FT_Stroker_GetCounts( stroker, &num_points, &num_contours );
FT_Stroker_GetCounts( stroker, &num_points, &num_contours );
FT_Outline_Done( glyph->library, outline );
@ -2380,8 +2380,8 @@
if ( error )
goto Fail;
(void)FT_Stroker_GetBorderCounts( stroker, border,
&num_points, &num_contours );
FT_Stroker_GetBorderCounts( stroker, border,
&num_points, &num_contours );
FT_Outline_Done( glyph->library, outline );

View File

@ -4,7 +4,7 @@
/* */
/* FreeType synthesizing code for emboldening and slanting (body). */
/* */
/* Copyright 2000-2006, 2010, 2012, 2013 by */
/* Copyright 2000-2006, 2010, 2012-2014 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -100,10 +100,8 @@
ystr = xstr;
if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
{
/* ignore error */
(void)FT_Outline_EmboldenXY( &slot->outline, xstr, ystr );
}
FT_Outline_EmboldenXY( &slot->outline, xstr, ystr );
else /* slot->format == FT_GLYPH_FORMAT_BITMAP */
{
/* round to full pixels */

View File

@ -4,7 +4,7 @@
/* */
/* OpenType Glyph Loader (body). */
/* */
/* Copyright 1996-2013 by */
/* Copyright 1996-2014 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -2711,10 +2711,10 @@
/* compute linear advance widths */
( (SFNT_Service)face->sfnt )->get_metrics( face, 0,
glyph_index,
&dummy,
&advance );
(void)( (SFNT_Service)face->sfnt )->get_metrics( face, 0,
glyph_index,
&dummy,
&advance );
glyph->root.linearHoriAdvance = advance;
has_vertical_info = FT_BOOL(
@ -2724,10 +2724,10 @@
/* get the vertical metrics from the vtmx table if we have one */
if ( has_vertical_info )
{
( (SFNT_Service)face->sfnt )->get_metrics( face, 1,
glyph_index,
&dummy,
&advance );
(void)( (SFNT_Service)face->sfnt )->get_metrics( face, 1,
glyph_index,
&dummy,
&advance );
glyph->root.linearVertAdvance = advance;
}
else
@ -2964,10 +2964,10 @@
FT_UShort vertAdvance = 0;
( (SFNT_Service)face->sfnt )->get_metrics( face, 1,
glyph_index,
&vertBearingY,
&vertAdvance );
(void)( (SFNT_Service)face->sfnt )->get_metrics( face, 1,
glyph_index,
&vertBearingY,
&vertAdvance );
metrics->vertBearingY = vertBearingY;
metrics->vertAdvance = vertAdvance;
}

View File

@ -37,7 +37,7 @@
PFR_PhyFont phys = &face->phy_font;
pfr_face_get_kerning( pfrface, left, right, avector );
(void)pfr_face_get_kerning( pfrface, left, right, avector );
/* convert from metrics to outline units when necessary */
if ( phys->outline_resolution != phys->metrics_resolution )

View File

@ -4,7 +4,7 @@
/* */
/* TrueType font driver implementation (body). */
/* */
/* Copyright 1996-2013 by */
/* Copyright 1996-2014 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -267,7 +267,7 @@
/* use the scaled metrics, even when tt_size_reset fails */
FT_Select_Metrics( size->face, strike_index );
tt_size_reset( ttsize );
tt_size_reset( ttsize ); /* ignore return value */
}
else
{

View File

@ -1211,7 +1211,7 @@
char* notdef = (char *)".notdef";
T1_Add_Table( char_table, n, notdef, 8 );
(void)T1_Add_Table( char_table, n, notdef, 8 );
}
/* Now we need to read records of the form */

View File

@ -366,7 +366,7 @@
char* notdef = (char *)".notdef";
T1_Add_Table( char_table, n, notdef, 8 );
(void)T1_Add_Table( char_table, n, notdef, 8 );
}
/* Now we need to read records of the form */