diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2011-06-17 17:08:35 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2011-06-17 17:08:35 -0400 |
commit | a0296ccbdd570b66a36bf4226760aed312d020d4 (patch) | |
tree | 950a42281d637512381f147eccf01d4f05ffc19f | |
parent | 26092c20b0936ff669513fbd64537123b99d036e (diff) | |
download | pango-a0296ccbdd570b66a36bf4226760aed312d020d4.tar.gz |
Bug 652841 - Various pieces of dead code found by gcc/clang static analyzer
-rw-r--r-- | examples/cairoshape.c | 4 | ||||
-rw-r--r-- | modules/indic/indic-ot.c | 1 | ||||
-rw-r--r-- | pango-view/viewer-pangoft2.c | 4 | ||||
-rw-r--r-- | pango/opentype/hb-common.h | 2 | ||||
-rw-r--r-- | pango/pango-gravity.c | 4 | ||||
-rw-r--r-- | pango/pango-layout.c | 7 | ||||
-rw-r--r-- | pango/pango-ot-info.c | 2 | ||||
-rw-r--r-- | pango/pango-renderer.c | 1 | ||||
-rw-r--r-- | pango/pangocairo-font.c | 4 | ||||
-rw-r--r-- | pango/pangocairo-render.c | 1 | ||||
-rw-r--r-- | pango/pangofc-fontmap.c | 5 |
11 files changed, 8 insertions, 27 deletions
diff --git a/examples/cairoshape.c b/examples/cairoshape.c index f668e92d..d288db14 100644 --- a/examples/cairoshape.c +++ b/examples/cairoshape.c @@ -58,12 +58,12 @@ mini_svg_render (MiniSvg *shape, double x, y; const char *p; char op[2]; - int items, len; + int len; cairo_get_current_point (cr, &x, &y); cairo_translate (cr, x, y); - for (p = shape->path; (items = sscanf (p, "%1s %n", op, &len)), p += len, *p;) + for (p = shape->path; sscanf (p, "%1s %n", op, &len), p += len, *p;) switch (*op) { case 'M': diff --git a/modules/indic/indic-ot.c b/modules/indic/indic-ot.c index 7a72d34b..60f253b6 100644 --- a/modules/indic/indic-ot.c +++ b/modules/indic/indic-ot.c @@ -315,7 +315,6 @@ glong indic_ot_reorder(const gunichar *chars, const glong *utf8_offsets, glong c postBaseLimit = class_table->scriptFlags & SF_POST_BASE_LIMIT_MASK; seenVattu = false; seenBelowBaseForm = false; - supressVattu = true; while (baseConsonant > baseLimit) { IndicOTCharClass charClass = indic_ot_get_char_class(class_table, chars[baseConsonant]); diff --git a/pango-view/viewer-pangoft2.c b/pango-view/viewer-pangoft2.c index 2699b740..87973c80 100644 --- a/pango-view/viewer-pangoft2.c +++ b/pango-view/viewer-pangoft2.c @@ -133,7 +133,7 @@ pangoft2_view_write (gpointer instance G_GNUC_UNUSED, int width, int height) { - int row, bytes; + int row; FT_Bitmap *bitmap = (FT_Bitmap *) surface; /* Write it as pgm to output */ @@ -142,7 +142,7 @@ pangoft2_view_write (gpointer instance G_GNUC_UNUSED, "%d %d\n" "255\n", width, height); for (row = 0; row < height; row++) - bytes = fwrite(bitmap->buffer + row * bitmap->pitch, 1, width, stream); + fwrite (bitmap->buffer + row * bitmap->pitch, 1, width, stream); } const PangoViewer pangoft2_viewer = { diff --git a/pango/opentype/hb-common.h b/pango/opentype/hb-common.h index a6be6ba5..15396ab2 100644 --- a/pango/opentype/hb-common.h +++ b/pango/opentype/hb-common.h @@ -29,7 +29,7 @@ # ifdef HAVE_STDINT_H # include <stdint.h> -# else ifdef HAVE_INTTYPES_H +# elif defined(HAVE_INTTYPES_H) # include <inttypes.h> # endif diff --git a/pango/pango-gravity.c b/pango/pango-gravity.c index 7553a07e..603c3776 100644 --- a/pango/pango-gravity.c +++ b/pango/pango-gravity.c @@ -256,14 +256,10 @@ pango_gravity_get_for_script (PangoScript script, PangoGravityHint hint) { PangoScriptProperties props = get_script_properties (script); - gboolean vertical; - if (G_UNLIKELY (base_gravity == PANGO_GRAVITY_AUTO)) base_gravity = props.preferred_gravity; - vertical = PANGO_GRAVITY_IS_VERTICAL (base_gravity); - return pango_gravity_get_for_script_and_width (script, props.wide, base_gravity, hint); } diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 40f92fae..e6ed96e1 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -4406,13 +4406,6 @@ pango_layout_get_empty_extents_at_index (PangoLayout *layout, if (start <= index && index < end) { - PangoFontDescription *base_font_desc; - - if (layout->font_desc) - base_font_desc = layout->font_desc; - else - base_font_desc = pango_context_get_font_description (layout->context); - if (!free_font_desc) { font_desc = pango_font_description_copy_static (font_desc); diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c index be7d53a3..7bc249b0 100644 --- a/pango/pango-ot-info.c +++ b/pango/pango-ot-info.c @@ -513,14 +513,12 @@ _pango_ot_info_substitute (const PangoOTInfo *info, for (i = 0; i < ruleset->rules->len; i++) { PangoOTRule *rule = &g_array_index (ruleset->rules, PangoOTRule, i); - hb_mask_t mask; unsigned int lookup_count, j; unsigned int lookup_indexes[1000]; if (rule->table_type != PANGO_OT_TABLE_GSUB) continue; - mask = rule->property_bit; lookup_count = G_N_ELEMENTS (lookup_indexes); hb_ot_layout_feature_get_lookup_indexes (info->hb_face, HB_OT_TAG_GSUB, diff --git a/pango/pango-renderer.c b/pango/pango-renderer.c index 1565e640..e17bcbe7 100644 --- a/pango/pango-renderer.c +++ b/pango/pango-renderer.c @@ -985,7 +985,6 @@ pango_renderer_default_draw_error_underline (PangoRenderer *renderer, int i; x += (width - width_units * unit_width) / 2; - width = width_units * unit_width; if (renderer->matrix) matrix = renderer->matrix; diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c index 8dc8df04..2d5ee7fb 100644 --- a/pango/pangocairo-font.c +++ b/pango/pangocairo-font.c @@ -378,7 +378,7 @@ _pango_cairo_font_private_get_hex_box_info (PangoCairoFontPrivate *cf_priv) cairo_scaled_font_t *scaled_font, *scaled_mini_font; PangoMatrix pango_ctm; cairo_matrix_t cairo_ctm; - PangoGravity gravity; + /*PangoGravity gravity;*/ if (!cf_priv) return NULL; @@ -395,7 +395,7 @@ _pango_cairo_font_private_get_hex_box_info (PangoCairoFontPrivate *cf_priv) font_options = cairo_font_options_create (); desc = pango_font_describe_with_absolute_size ((PangoFont *)cf_priv->cfont); size = pango_font_description_get_size (desc) / (1.*PANGO_SCALE); - gravity = pango_font_description_get_gravity (desc); + /*gravity = pango_font_description_get_gravity (desc);*/ cairo_scaled_font_get_ctm (scaled_font, &cairo_ctm); cairo_scaled_font_get_font_options (scaled_font, font_options); diff --git a/pango/pangocairo-render.c b/pango/pangocairo-render.c index 2706fd20..f91c85f2 100644 --- a/pango/pangocairo-render.c +++ b/pango/pangocairo-render.c @@ -573,7 +573,6 @@ draw_error_underline (cairo_t *cr, int i; x += (width - width_units * unit_width) / 2; - width = width_units * unit_width; y_top = y; y_bottom = y + height; diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c index 23489684..e4641f5d 100644 --- a/pango/pangofc-fontmap.c +++ b/pango/pangofc-fontmap.c @@ -956,7 +956,7 @@ pango_fc_fontset_get_font (PangoFontset *fontset, unsigned int i; for (i = 0; - (font = pango_fc_fontset_get_font_at (fcfontset, i)); + pango_fc_fontset_get_font_at (fcfontset, i); i++) { coverage = g_ptr_array_index (fcfontset->coverages, i); @@ -1827,7 +1827,6 @@ PangoFcCmapCache * _pango_fc_font_map_get_cmap_cache (PangoFcFontMap *fcfontmap, PangoFcFont *fcfont) { - PangoFcFontMapPrivate *priv; PangoFcFontFaceData *data; if (G_UNLIKELY (fcfontmap == NULL)) @@ -1836,8 +1835,6 @@ _pango_fc_font_map_get_cmap_cache (PangoFcFontMap *fcfontmap, if (G_UNLIKELY (!fcfont->font_pattern)) return NULL; - priv = fcfontmap->priv; - data = pango_fc_font_map_get_font_face_data (fcfontmap, fcfont->font_pattern); if (G_UNLIKELY (!data)) return NULL; |