summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-04-11 08:31:44 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-04-11 08:31:44 +0000
commit2fc8c1c04664645ed397c034ee532c41d0f3941e (patch)
tree0aa9bbb653bbfc1eb68bfad4971c169fb6a7b216 /pango
parent834d6435a8c91dcbebc7665b84811725a74f8b54 (diff)
downloadpango-2fc8c1c04664645ed397c034ee532c41d0f3941e.tar.gz
Bug 337924 – cleanups for issues reported by various compilers Patch
2006-04-11 Behdad Esfahbod <behdad@gnome.org> Bug 337924 – cleanups for issues reported by various compilers Patch from Kjartan Maraas. * examples/viewer-x.c (update): * modules/arabic/arabic-fc.c (fallback_shape), (arabic_engine_shape): * modules/basic/basic-fc.c (fallback_shape), (basic_engine_shape): * modules/basic/basic-x.c: * modules/hangul/hangul-fc.c: * modules/hebrew/hebrew-fc.c (hebrew_engine_shape): * modules/indic/indic-fc.c: * modules/khmer/khmer-fc.c: * modules/syriac/syriac-fc.c: * modules/thai/thai-fc.c: * modules/tibetan/tibetan-fc.c: * pango/break.c: * pango/modules.c: * pango/opentype/ftglue.c (_hb_ftglue_face_goto_table): * pango/pango-attributes.c (pango_attr_list_filter): * pango/pango-engine.c: * pango/pango-fontset.c: * pango/pango-layout.c (pango_layout_set_text), (pango_layout_xy_to_index), (pango_layout_get_cursor_pos): * pango/pango-markup.c (text_handler): * pango/pango-utils.c (read_alias_file): * pango/pangocairo-fcfont.c (G_DEFINE_TYPE_WITH_CODE): * pango/pangocairo-fcfontmap.c (G_DEFINE_TYPE_WITH_CODE): * pango/pangocairo-font.c (_pango_cairo_font_get_hex_box_info): * pango/pangox-fontmap.c (pango_x_make_matching_xlfd): * tests/dump-boundaries.c (fail): Remove unused variables. Remove excess semicolon after DEFINE_TYPE macros.
Diffstat (limited to 'pango')
-rw-r--r--pango/break.c2
-rw-r--r--pango/modules.c2
-rw-r--r--pango/opentype/ftglue.c2
-rw-r--r--pango/pango-attributes.c2
-rw-r--r--pango/pango-engine.c8
-rw-r--r--pango/pango-fontset.c4
-rw-r--r--pango/pango-layout.c8
-rw-r--r--pango/pango-markup.c2
-rw-r--r--pango/pango-utils.c20
-rw-r--r--pango/pangocairo-fcfont.c2
-rw-r--r--pango/pangocairo-fcfontmap.c2
-rw-r--r--pango/pangocairo-font.c8
-rw-r--r--pango/pangox-fontmap.c3
13 files changed, 23 insertions, 42 deletions
diff --git a/pango/break.c b/pango/break.c
index eea7efa5..2006074f 100644
--- a/pango/break.c
+++ b/pango/break.c
@@ -394,7 +394,7 @@ typedef struct _CharJamoProps
/* Map from JamoType to CharJamoProps that hold only simple
* JamoTypes (no LV or LVT) or none.
*/
-const CharJamoProps HangulJamoProps[] = {
+static const CharJamoProps HangulJamoProps[] = {
{JAMO_L, JAMO_L}, /* JAMO_L */
{JAMO_V, JAMO_V}, /* JAMO_V */
{JAMO_T, JAMO_T}, /* JAMO_T */
diff --git a/pango/modules.c b/pango/modules.c
index 4c272098..af0b9b68 100644
--- a/pango/modules.c
+++ b/pango/modules.c
@@ -247,7 +247,7 @@ pango_module_class_init (PangoModuleClass *class)
static PANGO_DEFINE_TYPE (PangoModule, pango_module,
pango_module_class_init, NULL,
- G_TYPE_TYPE_MODULE);
+ G_TYPE_TYPE_MODULE)
static PangoEngine *
pango_engine_pair_get_engine (PangoEnginePair *pair)
diff --git a/pango/opentype/ftglue.c b/pango/opentype/ftglue.c
index 5bb72745..31214b3e 100644
--- a/pango/opentype/ftglue.c
+++ b/pango/opentype/ftglue.c
@@ -243,8 +243,6 @@ _hb_ftglue_face_goto_table( FT_Face face,
if ( face->num_faces > 1 )
{
/* deal with TrueType collections */
- FT_ULong offset;
-
LOG(( ">> This is a TrueType Collection\n" ));
if ( FILE_Seek( 12 + face->face_index*4 ) ||
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index 06bc75f7..08353219 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -1840,13 +1840,11 @@ pango_attr_list_filter (PangoAttrList *list,
PangoAttrList *new = NULL;
GSList *tmp_list;
GSList *prev;
- GSList *new_attrs;
g_return_val_if_fail (list != NULL, NULL);
tmp_list = list->attributes;
prev = NULL;
- new_attrs = NULL;
while (tmp_list)
{
GSList *next = tmp_list->next;
diff --git a/pango/pango-engine.c b/pango/pango-engine.c
index da06a516..50699857 100644
--- a/pango/pango-engine.c
+++ b/pango/pango-engine.c
@@ -27,11 +27,11 @@
PANGO_DEFINE_TYPE_ABSTRACT (PangoEngine, pango_engine,
NULL, NULL,
- G_TYPE_OBJECT);
+ G_TYPE_OBJECT)
PANGO_DEFINE_TYPE_ABSTRACT (PangoEngineLang, pango_engine_lang,
NULL, NULL,
- PANGO_TYPE_ENGINE);
+ PANGO_TYPE_ENGINE)
static PangoCoverageLevel
pango_engine_shape_real_covers (PangoEngineShape *engine,
@@ -56,7 +56,7 @@ pango_engine_shape_class_init (PangoEngineShapeClass *class)
PANGO_DEFINE_TYPE_ABSTRACT (PangoEngineShape, pango_engine_shape,
pango_engine_shape_class_init, NULL,
- PANGO_TYPE_ENGINE);
+ PANGO_TYPE_ENGINE)
void
_pango_engine_shape_shape (PangoEngineShape *engine,
@@ -148,7 +148,7 @@ fallback_engine_class_init (PangoEngineShapeClass *class)
static PANGO_DEFINE_TYPE (PangoFallbackEngine, pango_fallback_engine,
fallback_engine_class_init, NULL,
- PANGO_TYPE_ENGINE_SHAPE);
+ PANGO_TYPE_ENGINE_SHAPE)
PangoEngineShape *
_pango_get_fallback_shaper (void)
diff --git a/pango/pango-fontset.c b/pango/pango-fontset.c
index b437e14a..29dedb31 100644
--- a/pango/pango-fontset.c
+++ b/pango/pango-fontset.c
@@ -39,7 +39,7 @@ pango_fontset_class_init (PangoFontsetClass *class)
}
PANGO_DEFINE_TYPE_ABSTRACT (PangoFontset, pango_fontset,
- pango_fontset_class_init, NULL, G_TYPE_OBJECT);
+ pango_fontset_class_init, NULL, G_TYPE_OBJECT)
/**
* pango_fontset_get_font:
@@ -272,7 +272,7 @@ pango_fontset_simple_init (PangoFontsetSimple *fontset)
PANGO_DEFINE_TYPE (PangoFontsetSimple, pango_fontset_simple,
pango_fontset_simple_class_init, pango_fontset_simple_init,
- PANGO_TYPE_FONTSET);
+ PANGO_TYPE_FONTSET)
static void
pango_fontset_simple_finalize (GObject *object)
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 558180f9..754a625d 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -866,7 +866,7 @@ pango_layout_set_text (PangoLayout *layout,
for (;;) {
gboolean valid;
- valid = g_utf8_validate (start, -1, &end);
+ valid = g_utf8_validate (start, -1, (const char *)&end);
if (!*end)
break;
@@ -1533,7 +1533,6 @@ pango_layout_xy_to_index (PangoLayout *layout,
PangoLayoutLine *prev_line = NULL;
PangoLayoutLine *found = NULL;
int found_line_x = 0;
- int prev_first = 0;
int prev_last = 0;
int prev_line_x = 0;
gboolean retval = FALSE;
@@ -1575,7 +1574,6 @@ pango_layout_xy_to_index (PangoLayout *layout,
}
prev_line = pango_layout_iter_get_line (iter);
- prev_first = first_y;
prev_last = last_y;
prev_line_x = x - line_logical.x;
@@ -1854,7 +1852,7 @@ pango_layout_get_cursor_pos (PangoLayout *layout,
PangoRectangle *strong_pos,
PangoRectangle *weak_pos)
{
- PangoDirection dir1, dir2;
+ PangoDirection dir1;
PangoRectangle line_rect;
PangoLayoutLine *layout_line = NULL; /* Quiet GCC */
int x1_trailing;
@@ -1887,7 +1885,6 @@ pango_layout_get_cursor_pos (PangoLayout *layout,
/* Examine the leading edge of the character after the cursor */
if (index >= layout_line->start_index + layout_line->length)
{
- dir2 = layout_line->resolved_dir;
if (layout_line->resolved_dir == PANGO_DIRECTION_LTR)
x2 = line_rect.width;
else
@@ -1895,7 +1892,6 @@ pango_layout_get_cursor_pos (PangoLayout *layout,
}
else
{
- dir2 = pango_layout_line_get_char_direction (layout_line, index);
pango_layout_line_index_to_x (layout_line, index, FALSE, &x2);
}
diff --git a/pango/pango-markup.c b/pango/pango-markup.c
index 48ce6ce6..5a5b67e0 100644
--- a/pango/pango-markup.c
+++ b/pango/pango-markup.c
@@ -436,7 +436,6 @@ text_handler (GMarkupParseContext *context,
const gchar *end;
const gchar *range_start;
const gchar *range_end;
- gboolean just_saw_marker;
gssize uline_index = -1;
gsize uline_len = 0; /* Quiet GCC */
@@ -444,7 +443,6 @@ text_handler (GMarkupParseContext *context,
range_start = text;
p = text;
end = text + text_len;
- just_saw_marker = FALSE;
while (p != end)
{
diff --git a/pango/pango-utils.c b/pango/pango-utils.c
index 0367796e..3f1b0cb0 100644
--- a/pango/pango-utils.c
+++ b/pango/pango-utils.c
@@ -1577,7 +1577,6 @@ read_alias_file (const char *filename)
while (pango_read_line (file, line_buffer))
{
- gboolean empty = FALSE;
gboolean append = FALSE;
line++;
@@ -1604,22 +1603,15 @@ read_alias_file (const char *filename)
goto error;
}
- if (!pango_skip_space (&pos))
+ if (!pango_scan_string (&pos, tmp_buffer2))
{
- empty = TRUE;
+ errstring = g_strdup ("Error parsing value string");
+ goto error;
}
- else
+ if (pango_skip_space (&pos))
{
- if (!pango_scan_string (&pos, tmp_buffer2))
- {
- errstring = g_strdup ("Error parsing value string");
- goto error;
- }
- if (pango_skip_space (&pos))
- {
- errstring = g_strdup ("Junk after value string");
- goto error;
- }
+ errstring = g_strdup ("Junk after value string");
+ goto error;
}
alias_key.alias = g_ascii_strdown (tmp_buffer1->str, -1);
diff --git a/pango/pangocairo-fcfont.c b/pango/pangocairo-fcfont.c
index 69cd4823..af4647c1 100644
--- a/pango/pangocairo-fcfont.c
+++ b/pango/pangocairo-fcfont.c
@@ -207,7 +207,7 @@ cairo_font_iface_init (PangoCairoFontIface *iface)
}
G_DEFINE_TYPE_WITH_CODE (PangoCairoFcFont, pango_cairo_fc_font, PANGO_TYPE_FC_FONT,
- { G_IMPLEMENT_INTERFACE (PANGO_TYPE_CAIRO_FONT, cairo_font_iface_init) });
+ { G_IMPLEMENT_INTERFACE (PANGO_TYPE_CAIRO_FONT, cairo_font_iface_init) })
static void
pango_cairo_fc_font_finalize (GObject *object)
diff --git a/pango/pangocairo-fcfontmap.c b/pango/pangocairo-fcfontmap.c
index fe4780c2..f6e96aa5 100644
--- a/pango/pangocairo-fcfontmap.c
+++ b/pango/pangocairo-fcfontmap.c
@@ -72,7 +72,7 @@ cairo_font_map_iface_init (PangoCairoFontMapIface *iface)
}
G_DEFINE_TYPE_WITH_CODE (PangoCairoFcFontMap, pango_cairo_fc_font_map, PANGO_TYPE_FC_FONT_MAP,
- { G_IMPLEMENT_INTERFACE (PANGO_TYPE_CAIRO_FONT_MAP, cairo_font_map_iface_init) });
+ { G_IMPLEMENT_INTERFACE (PANGO_TYPE_CAIRO_FONT_MAP, cairo_font_map_iface_init) })
static void
pango_cairo_fc_font_map_finalize (GObject *object)
diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c
index 8c68922c..bc5e6057 100644
--- a/pango/pangocairo-font.c
+++ b/pango/pangocairo-font.c
@@ -131,8 +131,10 @@ _pango_cairo_font_get_hex_box_info (PangoCairoFont *cfont)
double height = 0;
cairo_font_extents_t font_extents;
PangoFontDescription *mini_desc, *desc;
- cairo_scaled_font_t *scaled_font, *scaled_mini_font;
-#ifndef HAVE_CAIRO_SCALED_FONT_TEXT_EXTENTS
+ cairo_scaled_font_t *scaled_font;
+#ifdef HAVE_CAIRO_SCALED_FONT_TEXT_EXTENTS
+ cairo_scaled_font_t *scaled_mini_font;
+#else
cairo_surface_t *surface;
cairo_t *cr;
#endif
@@ -224,7 +226,6 @@ _pango_cairo_font_get_hex_box_info (PangoCairoFont *cfont)
mini_cfont = (PangoCairoFont *) mini_font;
- scaled_mini_font = _pango_cairo_font_get_scaled_font (mini_cfont);
#ifndef HAVE_CAIRO_SCALED_FONT_TEXT_EXTENTS
surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, 1, 1);
@@ -239,6 +240,7 @@ _pango_cairo_font_get_hex_box_info (PangoCairoFont *cfont)
c[0] = hexdigits[i];
#ifdef HAVE_CAIRO_SCALED_FONT_TEXT_EXTENTS
+ scaled_mini_font = _pango_cairo_font_get_scaled_font (mini_cfont);
cairo_scaled_font_text_extents (scaled_mini_font, c, &extents);
#else
cairo_text_extents (cr, c, &extents);
diff --git a/pango/pangox-fontmap.c b/pango/pangox-fontmap.c
index 4593a36c..01c0de54 100644
--- a/pango/pangox-fontmap.c
+++ b/pango/pangox-fontmap.c
@@ -1291,7 +1291,6 @@ pango_x_make_matching_xlfd (PangoFontMap *fontmap, char *xlfd, const char *chars
if (match_scaleable)
{
char *prefix_end, *p;
- char *size_end;
int n_dashes = 0;
int target_size;
char *prefix;
@@ -1315,8 +1314,6 @@ pango_x_make_matching_xlfd (PangoFontMap *fontmap, char *xlfd, const char *chars
p++;
}
- size_end = p - 1;
-
target_size = (int)((double)size / xfontmap->resolution + 0.5);
prefix = g_strndup (closest_match, prefix_end - closest_match);
result = g_strdup_printf ("%s--%d-*-*-*-*-*-%s", prefix, target_size, charset);