Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /src/printing.c [1bad15] .. [d2a8a1] Maximize Restore

  Switch to side-by-side view

--- a/src/printing.c
+++ b/src/printing.c
@@ -15,9 +15,9 @@
  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *      GNU General Public License for more details.
  *
- *      You should have received a copy of the GNU General Public License
- *      along with this program; if not, write to the Free Software
- *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *      You should have received a copy of the GNU General Public License along
+ *      with this program; if not, write to the Free Software Foundation, Inc.,
+ *      51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 
@@ -420,7 +420,7 @@
 	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)
 	{
@@ -439,7 +439,7 @@
 		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);
@@ -492,7 +492,8 @@
 	GtkPrintOperation *op;
 	GtkPrintOperationResult res = GTK_PRINT_OPERATION_RESULT_ERROR;
 	GError *error = NULL;
-	DocInfo dinfo = { 0 };
+	static const DocInfo dinfo0;
+	DocInfo dinfo = dinfo0;
 	PrintWidgets *widgets;
 
 	/** TODO check for monospace font, detect the widest character in the font and