Apply reports from clang static analyzer.

* src/lzw/ftlzw.c (ft_lzw_file_init), src/base/ftstroke.c
(FT_Stroker_ParseOutline), src/base/ftsynth.c
(FT_GlyphSlot_Embolden): Remove dead code.

* src/base/ftpatent.c (_tt_check_patents_in_table): Initialize
`offset_i'.
This commit is contained in:
Werner Lemberg 2010-01-05 20:00:35 +01:00
parent bc0082d512
commit fc58155afc
5 changed files with 25 additions and 20 deletions

View File

@ -1,3 +1,14 @@
2010-01-05 Werner Lemberg <wl@gnu.org>
Apply reports from clang static analyzer.
* src/lzw/ftlzw.c (ft_lzw_file_init), src/base/ftstroke.c
(FT_Stroker_ParseOutline), src/base/ftsynth.c
(FT_GlyphSlot_Embolden): Remove dead code.
* src/base/ftpatent.c (_tt_check_patents_in_table): Initialize
`offset_i'.
2010-01-05 Ralph Giles <giles@ghostscript.com>
Enable the incremental font interface by default.

View File

@ -5,7 +5,7 @@
/* FreeType API for checking patented TrueType bytecode instructions */
/* (body). */
/* */
/* Copyright 2007, 2008 by David Turner. */
/* Copyright 2007, 2008, 2010 by David Turner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@ -114,7 +114,7 @@
FT_ULong tag )
{
FT_Stream stream = face->stream;
FT_Error error = FT_Err_Ok;
FT_Error error = FT_Err_Ok;
FT_Service_SFNT_Table service;
FT_Bool result = FALSE;
@ -124,13 +124,14 @@
if ( service )
{
FT_UInt i = 0;
FT_ULong tag_i = 0, offset_i, length_i;
FT_ULong tag_i = 0, offset_i = 0, length_i;
for ( i = 0; !error && tag_i != tag ; i++ )
error = service->table_info( face, i,
&tag_i, &offset_i, &length_i );
if ( error ||
if ( error ||
FT_STREAM_SEEK( offset_i ) )
goto Exit;

View File

@ -4,7 +4,7 @@
/* */
/* FreeType path stroker (body). */
/* */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009 by */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -1736,13 +1736,10 @@
}
else
{
/* if both first and last points are conic, */
/* start at their middle and record its position */
/* for closure */
/* if both first and last points are conic, */
/* start at their middle */
v_start.x = ( v_start.x + v_last.x ) / 2;
v_start.y = ( v_start.y + v_last.y ) / 2;
v_last = v_start;
}
point--;
tags--;

View File

@ -4,7 +4,7 @@
/* */
/* FreeType synthesizing code for emboldening and slanting (body). */
/* */
/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006 by */
/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -100,8 +100,8 @@
if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
{
error = FT_Outline_Embolden( &slot->outline, xstr );
/* ignore error */
(void)FT_Outline_Embolden( &slot->outline, xstr );
/* this is more than enough for most glyphs; if you need accurate */
/* values, you have to call FT_Outline_Get_CBox */

View File

@ -8,7 +8,7 @@
/* be used to parse compressed PCF fonts, as found with many X11 server */
/* distributions. */
/* */
/* Copyright 2004, 2005, 2006, 2009 by */
/* Copyright 2004, 2005, 2006, 2009, 2010 by */
/* Albert Chin-A-Young. */
/* */
/* Based on code in src/gzip/ftgzip.c, Copyright 2004 by */
@ -122,13 +122,9 @@
zip->pos = 0;
/* check and skip .Z header */
{
stream = source;
error = ft_lzw_check_header( source );
if ( error )
goto Exit;
}
error = ft_lzw_check_header( source );
if ( error )
goto Exit;
/* initialize internal lzw variable */
ft_lzwstate_init( lzw, source );