summaryrefslogtreecommitdiff
path: root/pango/pango-renderer.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2008-12-26 02:31:47 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2008-12-26 02:31:47 +0000
commit1c53de263257039f23193fb389d9808fb212812a (patch)
treecfcf04a299c3472a5089a2e87ed6569510098a43 /pango/pango-renderer.c
parentaa841230aae629fffc9b94b3b1b1a4fa794c9d12 (diff)
downloadpango-1c53de263257039f23193fb389d9808fb212812a.tar.gz
Bug 469049 – Fix all compiler warnings
2008-12-25 Behdad Esfahbod <behdad@gnome.org> Bug 469049 – Fix all compiler warnings * pango-view/viewer-pangocairo.c (render_callback): * pango/fonts.c (append_field), (pango_font_description_to_string): * pango/opentype/harfbuzz-dump.c: * pango/pango-bidi-type.c (pango_log2vis_get_embedding_levels): * pango/pango-coverage.c (pango_coverage_set): * pango/pango-markup.c (span_parse_func): * pango/pango-renderer.c (pango_renderer_default_draw_error_underline): * pango/pango-utils.c (pango_scan_string): * pango/pangocairo-render.c (pango_cairo_renderer_draw_trapezoid), (draw_error_underline), (pango_cairo_renderer_class_init): Fix all the remaining warnings. svn path=/trunk/; revision=2767
Diffstat (limited to 'pango/pango-renderer.c')
-rw-r--r--pango/pango-renderer.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/pango/pango-renderer.c b/pango/pango-renderer.c
index d89d53f5..ac83388e 100644
--- a/pango/pango-renderer.c
+++ b/pango/pango-renderer.c
@@ -975,6 +975,7 @@ pango_renderer_default_draw_error_underline (PangoRenderer *renderer,
const PangoMatrix *matrix;
double dx, dx0, dy0;
PangoMatrix total;
+ int i;
x += (width - width_units * unit_width) / 2;
width = width_units * unit_width;
@@ -989,27 +990,25 @@ pango_renderer_default_draw_error_underline (PangoRenderer *renderer,
dx0 = (matrix->xx * dx) / PANGO_SCALE;
dy0 = (matrix->yx * dx) / PANGO_SCALE;
+ i = (width_units - 1) / 2;
while (TRUE)
{
-
draw_rectangle (renderer, &total, PANGO_RENDER_PART_UNDERLINE, /* A */
0, 0,
HEIGHT_SQUARES * 2 - 1, 1);
- if (width_units > 2)
- {
- draw_rectangle (renderer, &total, PANGO_RENDER_PART_UNDERLINE, /* B */
- HEIGHT_SQUARES * 2 - 2, - (HEIGHT_SQUARES * 2 - 3),
- 1, HEIGHT_SQUARES * 2 - 3);
- width_units -= 2;
+ if (i <= 0)
+ break;
+ i--;
- total.x0 += dx0;
- total.y0 += dy0;
- }
- else
- break;
+ draw_rectangle (renderer, &total, PANGO_RENDER_PART_UNDERLINE, /* B */
+ HEIGHT_SQUARES * 2 - 2, - (HEIGHT_SQUARES * 2 - 3),
+ 1, HEIGHT_SQUARES * 2 - 3);
+
+ total.x0 += dx0;
+ total.y0 += dy0;
}
- if (width_units == 2)
+ if (width_units % 2 == 0)
{
draw_rectangle (renderer, &total, PANGO_RENDER_PART_UNDERLINE, /* C */
HEIGHT_SQUARES * 2 - 2, - (HEIGHT_SQUARES * 2 - 2),