summaryrefslogtreecommitdiff
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
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.
-rw-r--r--ChangeLog35
-rw-r--r--examples/viewer-x.c4
-rw-r--r--modules/arabic/arabic-fc.c8
-rw-r--r--modules/basic/basic-fc.c8
-rw-r--r--modules/basic/basic-x.c2
-rw-r--r--modules/hangul/hangul-fc.c2
-rw-r--r--modules/hebrew/hebrew-fc.c5
-rw-r--r--modules/indic/indic-fc.c2
-rw-r--r--modules/khmer/khmer-fc.c2
-rw-r--r--modules/syriac/syriac-fc.c2
-rw-r--r--modules/thai/thai-fc.c2
-rw-r--r--modules/tibetan/tibetan-fc.c2
-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
-rw-r--r--tests/dump-boundaries.c4
26 files changed, 71 insertions, 72 deletions
diff --git a/ChangeLog b/ChangeLog
index 9035e94f..e1d74384 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,38 @@
+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.
+
2006-04-10 Behdad Esfahbod <behdad@gnome.org>
* config.h.win32, examples/makefile.msc: Removed. Have not been
diff --git a/examples/viewer-x.c b/examples/viewer-x.c
index 772dd719..e79c6eaf 100644
--- a/examples/viewer-x.c
+++ b/examples/viewer-x.c
@@ -91,13 +91,9 @@ update (Display *display,
{
GC gc;
XRectangle extents;
- int width, height;
XClipBox (*update_region, &extents);
- width = extents.width;
- height = extents.height;
-
gc = XCreateGC (display, pixmap, 0, NULL);
XCopyArea (display, pixmap, window, gc,
diff --git a/modules/arabic/arabic-fc.c b/modules/arabic/arabic-fc.c
index e6fc5ef4..260d1096 100644
--- a/modules/arabic/arabic-fc.c
+++ b/modules/arabic/arabic-fc.c
@@ -193,18 +193,15 @@ fallback_shape (PangoEngineShape *engine,
gunichar mirrored_ch;
PangoGlyph index;
char buf[6];
- const char *input;
wc = g_utf8_get_char (p);
- input = p;
if (analysis->level % 2)
if (pango_get_mirror_char (wc, &mirrored_ch))
{
wc = mirrored_ch;
g_unichar_to_utf8 (wc, buf);
- input = buf;
}
if (pango_is_zero_width (wc))
@@ -302,18 +299,15 @@ arabic_engine_shape (PangoEngineShape *engine,
gunichar mirrored_ch;
PangoGlyph index;
char buf[6];
- const char *input;
wc = g_utf8_get_char (p);
- input = p;
if (analysis->level % 2)
if (pango_get_mirror_char (wc, &mirrored_ch))
{
wc = mirrored_ch;
g_unichar_to_utf8 (wc, buf);
- input = buf;
}
if (pango_is_zero_width (wc)) /* Zero-width characters */
@@ -370,7 +364,7 @@ arabic_engine_fc_class_init (PangoEngineShapeClass *class)
}
PANGO_ENGINE_SHAPE_DEFINE_TYPE (ArabicEngineFc, arabic_engine_fc,
- arabic_engine_fc_class_init, NULL);
+ arabic_engine_fc_class_init, NULL)
void
PANGO_MODULE_ENTRY(init) (GTypeModule *module)
diff --git a/modules/basic/basic-fc.c b/modules/basic/basic-fc.c
index 626608be..08776f3b 100644
--- a/modules/basic/basic-fc.c
+++ b/modules/basic/basic-fc.c
@@ -147,18 +147,15 @@ fallback_shape (PangoEngineShape *engine,
gunichar mirrored_ch;
PangoGlyph index;
char buf[6];
- const char *input;
wc = g_utf8_get_char (p);
- input = p;
if (analysis->level % 2)
if (pango_get_mirror_char (wc, &mirrored_ch))
{
wc = mirrored_ch;
g_unichar_to_utf8 (wc, buf);
- input = buf;
}
if (wc == 0xa0) /* non-break-space */
@@ -368,17 +365,14 @@ basic_engine_shape (PangoEngineShape *engine,
gunichar mirrored_ch;
PangoGlyph index;
char buf[6];
- const char *input;
wc = g_utf8_get_char (p);
- input = p;
if (analysis->level % 2)
if (pango_get_mirror_char (wc, &mirrored_ch))
{
wc = mirrored_ch;
g_unichar_to_utf8 (wc, buf);
- input = buf;
}
if (pango_is_zero_width (wc)) /* Zero-width characters */
@@ -425,7 +419,7 @@ basic_engine_fc_class_init (PangoEngineShapeClass *class)
}
PANGO_ENGINE_SHAPE_DEFINE_TYPE (BasicEngineFc, basic_engine_fc,
- basic_engine_fc_class_init, NULL);
+ basic_engine_fc_class_init, NULL)
void
PANGO_MODULE_ENTRY(init) (GTypeModule *module)
diff --git a/modules/basic/basic-x.c b/modules/basic/basic-x.c
index 1f23291c..70455a64 100644
--- a/modules/basic/basic-x.c
+++ b/modules/basic/basic-x.c
@@ -691,7 +691,7 @@ basic_engine_x_class_init (PangoEngineShapeClass *class)
}
PANGO_ENGINE_SHAPE_DEFINE_TYPE (BasicEngineX, basic_engine_x,
- basic_engine_x_class_init, NULL);
+ basic_engine_x_class_init, NULL)
void
PANGO_MODULE_ENTRY(init) (GTypeModule *module)
diff --git a/modules/hangul/hangul-fc.c b/modules/hangul/hangul-fc.c
index 39e0d5ba..64966648 100644
--- a/modules/hangul/hangul-fc.c
+++ b/modules/hangul/hangul-fc.c
@@ -397,7 +397,7 @@ hangul_engine_fc_class_init (PangoEngineShapeClass *class)
}
PANGO_ENGINE_SHAPE_DEFINE_TYPE (HangulEngineFc, hangul_engine_fc,
- hangul_engine_fc_class_init, NULL);
+ hangul_engine_fc_class_init, NULL)
void
PANGO_MODULE_ENTRY(init) (GTypeModule *module)
diff --git a/modules/hebrew/hebrew-fc.c b/modules/hebrew/hebrew-fc.c
index af80ed94..da776d5d 100644
--- a/modules/hebrew/hebrew-fc.c
+++ b/modules/hebrew/hebrew-fc.c
@@ -340,17 +340,14 @@ hebrew_engine_shape (PangoEngineShape *engine,
gunichar mirrored_ch;
PangoGlyph index;
char buf[6];
- const char *input;
wc = g_utf8_get_char (p);
- input = p;
if (analysis->level % 2)
if (pango_get_mirror_char (wc, &mirrored_ch))
{
wc = mirrored_ch;
g_unichar_to_utf8 (wc, buf);
- input = buf;
}
if (pango_is_zero_width (wc)) /* Zero-width characters */
@@ -396,7 +393,7 @@ hebrew_engine_fc_class_init (PangoEngineShapeClass *class)
}
PANGO_ENGINE_SHAPE_DEFINE_TYPE (HebrewEngineFc, hebrew_engine_fc,
- hebrew_engine_fc_class_init, NULL);
+ hebrew_engine_fc_class_init, NULL)
void
PANGO_MODULE_ENTRY(init) (GTypeModule *module)
diff --git a/modules/indic/indic-fc.c b/modules/indic/indic-fc.c
index 4947b5b5..daa2c23e 100644
--- a/modules/indic/indic-fc.c
+++ b/modules/indic/indic-fc.c
@@ -407,7 +407,7 @@ indic_engine_fc_class_init (PangoEngineShapeClass *class)
}
PANGO_ENGINE_SHAPE_DEFINE_TYPE (IndicEngineFc, indic_engine_fc,
- indic_engine_fc_class_init, NULL);
+ indic_engine_fc_class_init, NULL)
void
PANGO_MODULE_ENTRY(init) (GTypeModule *module)
diff --git a/modules/khmer/khmer-fc.c b/modules/khmer/khmer-fc.c
index 82541e44..82874624 100644
--- a/modules/khmer/khmer-fc.c
+++ b/modules/khmer/khmer-fc.c
@@ -741,7 +741,7 @@ khmer_engine_fc_class_init (PangoEngineShapeClass *class)
}
PANGO_ENGINE_SHAPE_DEFINE_TYPE (KhmerEngineFc, khmer_engine_fc,
- khmer_engine_fc_class_init, NULL);
+ khmer_engine_fc_class_init, NULL)
void
diff --git a/modules/syriac/syriac-fc.c b/modules/syriac/syriac-fc.c
index dab11efc..51260838 100644
--- a/modules/syriac/syriac-fc.c
+++ b/modules/syriac/syriac-fc.c
@@ -344,7 +344,7 @@ syriac_engine_fc_class_init (PangoEngineShapeClass *class)
}
PANGO_ENGINE_SHAPE_DEFINE_TYPE (SyriacEngineFc, syriac_engine_fc,
- syriac_engine_fc_class_init, NULL);
+ syriac_engine_fc_class_init, NULL)
void
PANGO_MODULE_ENTRY(init) (GTypeModule *module)
diff --git a/modules/thai/thai-fc.c b/modules/thai/thai-fc.c
index aaedbb3e..4414bd93 100644
--- a/modules/thai/thai-fc.c
+++ b/modules/thai/thai-fc.c
@@ -247,7 +247,7 @@ thai_engine_fc_class_init (PangoEngineShapeClass *class)
}
PANGO_ENGINE_SHAPE_DEFINE_TYPE (ThaiEngineFc, thai_engine_fc,
- thai_engine_fc_class_init, NULL);
+ thai_engine_fc_class_init, NULL)
void
PANGO_MODULE_ENTRY(init) (GTypeModule *module)
diff --git a/modules/tibetan/tibetan-fc.c b/modules/tibetan/tibetan-fc.c
index b4348c05..b2e12aff 100644
--- a/modules/tibetan/tibetan-fc.c
+++ b/modules/tibetan/tibetan-fc.c
@@ -597,7 +597,7 @@ tibetan_engine_fc_class_init (PangoEngineShapeClass *class)
}
PANGO_ENGINE_SHAPE_DEFINE_TYPE (TibetanEngineFc, tibetan_engine_fc,
- tibetan_engine_fc_class_init, NULL);
+ tibetan_engine_fc_class_init, NULL)
void
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);
diff --git a/tests/dump-boundaries.c b/tests/dump-boundaries.c
index 29efc522..ba4c343b 100644
--- a/tests/dump-boundaries.c
+++ b/tests/dump-boundaries.c
@@ -39,8 +39,10 @@ static void fail (const char *format, ...)
str = g_strdup_vprintf (format, args);
va_end (args);
- fprintf (stderr, "Error: %s\n", format);
+ fprintf (stderr, "Error: %s\n", str);
+ g_free (str);
+
exit (1);
}