Branch: refs/heads/master Author: Lex Trotman elextr@gmail.com Committer: Lex Trotman elextr@gmail.com Date: Tue, 09 Oct 2012 02:56:13 Commit: 42b3629aafb223e66695a8079397c16ec39760b0 https://github.com/geany/geany/commit/42b3629aafb223e66695a8079397c16ec39760...
Log Message: ----------- Fix sign comparison warnings
GTK uses a signed page_nr parameter to callback draw_page despite describing it as 0 based, cast it to unsigned for comparisons to array len which is also unsigned.
Modified Paths: -------------- src/printing.c
Modified: src/printing.c 4 files changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -399,7 +399,7 @@ static void draw_page(GtkPrintOperation *operation, GtkPrintContext *context, gdouble width, height;
g_return_if_fail(dinfo != NULL); - g_return_if_fail(page_nr < dinfo->pages->len); + g_return_if_fail((guint)page_nr < dinfo->pages->len);
if (dinfo->pages->len > 0) { @@ -418,7 +418,7 @@ static void draw_page(GtkPrintOperation *operation, GtkPrintContext *context, add_page_header(dinfo, cr, width, page_nr);
dinfo->fr.chrg.cpMin = g_array_index(dinfo->pages, gint, page_nr); - if (page_nr + 1 < dinfo->pages->len) + if ((guint)page_nr + 1 < dinfo->pages->len) dinfo->fr.chrg.cpMax = g_array_index(dinfo->pages, gint, page_nr + 1) - 1; else /* it's the last page, print 'til the end */ dinfo->fr.chrg.cpMax = sci_get_length(dinfo->sci);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).