summaryrefslogtreecommitdiff
path: root/src/sfnt
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2014-02-08 13:55:38 +0100
committerWerner Lemberg <wl@gnu.org>2014-02-08 13:55:38 +0100
commit7be2a94a50109773459414687151d70a99a1b6bd (patch)
tree2609ae858ef354bbd42c019440692529764ee3d5 /src/sfnt
parentab98c5e73b4c4a6eed88dbc6338225012cd72a3e (diff)
downloadfreetype2-7be2a94a50109773459414687151d70a99a1b6bd.tar.gz
Fix clang static analyzer and compiler warnings.
* src/autofit/afhints.c (af_glyph_hints_align_weak_points), src/autofit/afloader (af_loader_load_g) <FT_GLYPH_FORMAT_COMPOSITE>, src/base/ftcalc.c (FT_MSB), src/base/ftoutln.c (FT_Outline_Decompose), src/bdf/bdfdrivr.c (bdf_interpret_style), src/cff/cffparse.c (cff_parse_integer), src/cid/cidparse.c (cid_parser_new), src/pfr/pfrload.c (pfr_phy_font_load), src/raster/ftraster.c (Decompose_Curve), src/sfnt/sfdriver.c (sfnt_get_ps_name), src/sfnt/ttcmap.c (tt_cmap12_next, tt_cmap13_next), src/smooth/ftgrays.c (gray_hline): Remove dead code. * src/autofit/afmodule.c (af_property_get_face_globals, af_property_set, af_property_get), src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Make functions static. * src/base/ftobjs.c (ft_remove_renderer): Protect against library == NULL. (ft_property_do): Make function static. * src/base/ftrfork.c: Include `ftbase.h'. * src/sfnt/ttsbit.c (tt_face_load_sbix_image) [!FT_CONFIG_OPTION_USE_PNG], src/type1/t1gload.c (T1_Compute_Max_Advance): Avoid compiler warning. * src/truetype/ttinterp.c (TT_New_Context): Reduce scope of variable.
Diffstat (limited to 'src/sfnt')
-rw-r--r--src/sfnt/sfdriver.c4
-rw-r--r--src/sfnt/ttcmap.c6
-rw-r--r--src/sfnt/ttsbit.c13
3 files changed, 9 insertions, 14 deletions
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c
index e0132c920..e4fcda5ec 100644
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -4,7 +4,7 @@
/* */
/* High-level SFNT driver interface (body). */
/* */
-/* Copyright 1996-2007, 2009-2013 by */
+/* Copyright 1996-2007, 2009-2014 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -266,7 +266,7 @@
{
FT_Stream stream = face->name_table.stream;
FT_String* r = (FT_String*)result;
- FT_Byte* p = (FT_Byte*)name->string;
+ FT_Byte* p;
if ( FT_STREAM_SEEK( name->stringOffset ) ||
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c
index 9b7856ba5..f17ce59ae 100644
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -4,7 +4,7 @@
/* */
/* TrueType character mapping table (cmap) support (body). */
/* */
-/* Copyright 2002-2010, 2012, 2013 by */
+/* Copyright 2002-2010, 2012-2014 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -2110,8 +2110,6 @@
char_code = cmap->cur_charcode + 1;
- n = cmap->cur_group;
-
for ( n = cmap->cur_group; n < cmap->num_groups; n++ )
{
p = cmap->cmap.data + 16 + 12 * n;
@@ -2434,8 +2432,6 @@
char_code = cmap->cur_charcode + 1;
- n = cmap->cur_group;
-
for ( n = cmap->cur_group; n < cmap->num_groups; n++ )
{
p = cmap->cmap.data + 16 + 12 * n;
diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c
index c118894a4..8ff7b9d6a 100644
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -1247,11 +1247,11 @@
FT_Bitmap *map,
TT_SBit_MetricsRec *metrics )
{
- FT_UInt sbix_pos, strike_offset, glyph_start, glyph_end;
- FT_ULong table_size, data_size;
- FT_Int originOffsetX, originOffsetY;
- FT_Tag graphicType;
- FT_Int recurse_depth = 0;
+ FT_UInt sbix_pos, strike_offset, glyph_start, glyph_end;
+ FT_ULong table_size;
+ FT_Int originOffsetX, originOffsetY;
+ FT_Tag graphicType;
+ FT_Int recurse_depth = 0;
FT_Error error;
FT_Byte* p;
@@ -1302,7 +1302,6 @@
originOffsetY = FT_GET_SHORT();
graphicType = FT_GET_TAG4();
- data_size = glyph_end - glyph_start - 8;
switch ( graphicType )
{
@@ -1326,7 +1325,7 @@
metrics,
stream->memory,
stream->cursor,
- data_size,
+ glyph_end - glyph_start - 8,
TRUE );
#else
error = FT_THROW( Unimplemented_Feature );