[poppler] 11 commits - configure.ac glib/demo

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Wed Nov 28 08:52:04 PST 2012


 configure.ac            |    3 ++-
 glib/demo/annots.c      |    4 +---
 glib/demo/attachments.c |    2 +-
 glib/demo/layers.c      |    1 -
 glib/demo/print.c       |    9 ++++++---
 glib/demo/render.c      |    2 +-
 glib/demo/selections.c  |    1 -
 glib/demo/text.c        |    8 ++++----
 glib/demo/utils.c       |    2 +-
 9 files changed, 16 insertions(+), 16 deletions(-)

New commits:
commit beff044e4fdf44e80ad7c75255cb71a83e70a293
Author: Hib Eris <hib at hiberis.nl>
Date:   Tue Nov 27 22:19:01 2012 +0100

    glib-demo: Fix warning on signedness
    
    Fixes:
    
      CC     attachments.o
    ../../../poppler/glib/demo/attachments.c: In function ‘attachment_save_callback’:
    ../../../poppler/glib/demo/attachments.c:190:2: warning: pointer targets in passing argument 2 of ‘g_checksum_update’ differ in signedness [-Wpointer-sign]
    /usr/include/glib-2.0/glib/gchecksum.h:69:23: note: expected ‘const guchar *’ but argument is of type ‘const gchar *’
    
    https://bugs.freedesktop.org/show_bug.cgi?id=57620

diff --git a/glib/demo/attachments.c b/glib/demo/attachments.c
index 1b74274..6fe7eda 100644
--- a/glib/demo/attachments.c
+++ b/glib/demo/attachments.c
@@ -187,7 +187,7 @@ attachment_save_callback (const gchar  *buf,
 {
 	GChecksum *cs = (GChecksum *)data;
 
-	g_checksum_update (cs, buf, count);
+	g_checksum_update (cs, (guchar *) buf, count);
 
 	return TRUE;
 }
commit b484749ffa58315e4b61738d652347d7a77da982
Author: Hib Eris <hib at hiberis.nl>
Date:   Tue Nov 27 19:38:59 2012 +0100

    glib-demo: Fix set but unused warning
    
    Fixes:
    
      CC     print.o
    ../../../poppler/glib/demo/print.c: In function ‘pgd_print_draw_page’:
    ../../../poppler/glib/demo/print.c:68:27: warning: variable ‘settings’ set but not used [-Wunused-but-set-variable]
    
    https://bugs.freedesktop.org/show_bug.cgi?id=57620

diff --git a/glib/demo/print.c b/glib/demo/print.c
index 8147036..f77b0a3 100644
--- a/glib/demo/print.c
+++ b/glib/demo/print.c
@@ -65,7 +65,9 @@ pgd_print_draw_page (GtkPrintOperation *op,
 {
 	PopplerPage      *page;
 	cairo_t          *cr;
+#if 0
         GtkPrintSettings *settings;
+#endif
         PgdPrintOptions   options;
         PopplerPrintFlags flags = 0;
 
@@ -73,13 +75,14 @@ pgd_print_draw_page (GtkPrintOperation *op,
 	if (!page)
 		return;
 
-        settings = gtk_print_operation_get_print_settings (op);
-        /* Workaround for gtk+ bug, we need to save the options ourselves */
-        options = demo->options;
 #if 0
+        settings = gtk_print_operation_get_print_settings (op);
         options = gtk_print_settings_get_int_with_default (settings,
                                                            PGD_PRINT_OPTIONS,
                                                            PRINT_DOCUMENT_MARKUPS);
+#else
+        /* Workaround for gtk+ bug, we need to save the options ourselves */
+        options = demo->options;
 #endif
         switch (options) {
         case PRINT_DOCUMENT:
commit 8438daf7bf7ab1b96c6899baab7e47d9c634cb3d
Author: Hib Eris <hib at hiberis.nl>
Date:   Sun Jun 24 14:54:31 2012 +0200

    glib-demo: pgd_text_view_query_tooltip(): return a gboolean
    
    https://bugs.freedesktop.org/show_bug.cgi?id=57620

diff --git a/glib/demo/text.c b/glib/demo/text.c
index c909473..af8428e 100644
--- a/glib/demo/text.c
+++ b/glib/demo/text.c
@@ -267,8 +267,10 @@ pgd_text_view_query_tooltip (GtkTextView   *textview,
                 gtk_tooltip_set_text (tooltip, text);
                 g_free (text);
                 g_object_unref (page);
+                return TRUE;
+        } else {
+                return FALSE;
         }
-
 }
 
 
commit ff9e211cfb60eb820b9b046da546352fa59d7df9
Author: Hib Eris <hib at hiberis.nl>
Date:   Sat Jun 23 22:56:02 2012 +0200

    glib-demo: Remove set but unused variable textinfo
    
    https://bugs.freedesktop.org/show_bug.cgi?id=57620

diff --git a/glib/demo/text.c b/glib/demo/text.c
index c53773a..c909473 100644
--- a/glib/demo/text.c
+++ b/glib/demo/text.c
@@ -285,7 +285,6 @@ pgd_text_create_widget (PopplerDocument *document)
 	PgdTextDemo      *demo;
 	GtkWidget        *label;
 	GtkWidget        *vbox, *vbox2;
-	GtkWidget	 *textinfo;
 	GtkWidget        *hbox, *page_selector;
 	GtkWidget        *button;
 	GtkWidget        *swindow, *textview, *treeview;
@@ -305,7 +304,6 @@ pgd_text_create_widget (PopplerDocument *document)
 
 	vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
 	vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
-	textinfo = gtk_label_new ("TextInfo");
 
 	hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
 
commit 8e5ae33bc63eca5297dea12fc281ba223f5be09a
Author: Hib Eris <hib at hiberis.nl>
Date:   Sat Jun 23 22:44:22 2012 +0200

    glib-demo: Fix warning "operation on 'page' may be undefined [-Wsequence-point]"
    
    https://bugs.freedesktop.org/show_bug.cgi?id=57620

diff --git a/glib/demo/text.c b/glib/demo/text.c
index b05581d..c53773a 100644
--- a/glib/demo/text.c
+++ b/glib/demo/text.c
@@ -262,7 +262,7 @@ pgd_text_view_query_tooltip (GtkTextView   *textview,
                 g_free (x2);
                 g_free (y2);
 
-                page = page = poppler_document_get_page (demo->doc, demo->page);
+                page = poppler_document_get_page (demo->doc, demo->page);
                 text = poppler_page_get_selected_text (page, POPPLER_SELECTION_GLYPH, &rect);
                 gtk_tooltip_set_text (tooltip, text);
                 g_free (text);
commit c6f98d62b885e1d7f6ce1f265d4a87dca36494de
Author: Hib Eris <hib at hiberis.nl>
Date:   Sat Jun 23 22:38:35 2012 +0200

    glib-demo: Remove unused variable slice_selector
    
    https://bugs.freedesktop.org/show_bug.cgi?id=57620

diff --git a/glib/demo/render.c b/glib/demo/render.c
index 48e9210..354b862 100644
--- a/glib/demo/render.c
+++ b/glib/demo/render.c
@@ -236,7 +236,7 @@ pgd_render_properties_selector_create (PgdRenderDemo *demo)
 	GtkWidget *scale_hbox, *scale_selector;
 	GtkWidget *rotate_hbox, *rotate_selector;
 	GtkWidget *printing_selector;
-	GtkWidget *slice_hbox, *slice_selector;
+	GtkWidget *slice_hbox;
 	GtkWidget *button;
 	gint       n_pages;
 	gchar     *str;
commit da56d280e2a51229c93117d8b537897ba63296cf
Author: Hib Eris <hib at hiberis.nl>
Date:   Sat Jun 23 22:36:29 2012 +0200

    glib-demo: Remove unused variable region
    
    https://bugs.freedesktop.org/show_bug.cgi?id=57620

diff --git a/glib/demo/selections.c b/glib/demo/selections.c
index 4ec5d6b..0e0d709 100644
--- a/glib/demo/selections.c
+++ b/glib/demo/selections.c
@@ -128,7 +128,6 @@ pgd_selections_update_selection_region (PgdSelectionsDemo *demo)
 static void
 pgd_selections_update_selected_text (PgdSelectionsDemo *demo)
 {
-	GList *region;
 	gchar *text;
 
 	if (demo->selected_region)
commit c792e59064018e0fd899f32080489419517f2bbe
Author: Hib Eris <hib at hiberis.nl>
Date:   Sat Jun 23 22:34:44 2012 +0200

    glib-demo: Do not use 'text' uninitialized
    
    https://bugs.freedesktop.org/show_bug.cgi?id=57620

diff --git a/glib/demo/utils.c b/glib/demo/utils.c
index f1d47c8..c7ae39d 100644
--- a/glib/demo/utils.c
+++ b/glib/demo/utils.c
@@ -411,7 +411,7 @@ pgd_action_view_set_action (GtkWidget     *action_view,
 
 		for (l = action->ocg_state.state_list; l; l = g_list_next (l)) {
 			PopplerActionLayer *action_layer = (PopplerActionLayer *)l->data;
-			gchar *text;
+			gchar *text = NULL;
 			gint   n_layers = g_list_length (action_layer->layers);
 
 			switch (action_layer->action) {
commit c5a8f7eda14030436e6905dd826e72cabbcf0e5f
Author: Hib Eris <hib at hiberis.nl>
Date:   Sat Jun 23 22:26:53 2012 +0200

    glib-demo: Fix warning on unused variable selection
    
    https://bugs.freedesktop.org/show_bug.cgi?id=57620

diff --git a/glib/demo/layers.c b/glib/demo/layers.c
index c55de42..023da20 100644
--- a/glib/demo/layers.c
+++ b/glib/demo/layers.c
@@ -373,7 +373,6 @@ pgd_layers_create_widget (PopplerDocument *document)
 	GtkWidget        *treeview;
 	GtkTreeModel     *model;
 	GtkCellRenderer  *renderer;
-	GtkTreeSelection *selection;
 	GtkWidget        *hpaned, *viewer;
 
 	demo = g_new0 (PgdLayersDemo, 1);
commit 4ceb3f4f4ca0092e79bb36723a7332b071491666
Author: Hib Eris <hib at hiberis.nl>
Date:   Sat Jun 23 18:36:12 2012 +0200

    glib-demo: Fix warnings on unused variables
    
    https://bugs.freedesktop.org/show_bug.cgi?id=57620

diff --git a/glib/demo/annots.c b/glib/demo/annots.c
index e0b5d91..4d39ba3 100644
--- a/glib/demo/annots.c
+++ b/glib/demo/annots.c
@@ -262,7 +262,6 @@ gchar *
 get_free_text_callout_line (PopplerAnnotFreeText *poppler_annot)
 {
     PopplerAnnotCalloutLine *callout;
-    gdouble x1, y1, x2, y2;
     gchar *text;
     
     if ((callout = poppler_annot_free_text_get_callout_line (poppler_annot))) {
@@ -481,9 +480,8 @@ pgd_annot_view_set_annot (PgdAnnotsDemo *demo,
     GtkWidget  *alignment;
     GtkWidget  *table;
     GtkWidget  *button;
-    GEnumValue *enum_value;
     gint        row = 0;
-    gchar      *text, *warning;
+    gchar      *text;
     time_t      timet;
 
     alignment = gtk_bin_get_child (GTK_BIN (demo->annot_view));
commit 5c5945d163fe406960ccc2e3a71882722b9e69d1
Author: Hib Eris <hib at hiberis.nl>
Date:   Tue Nov 27 19:21:34 2012 +0100

    Enable compiler warnings for C code
    
    Compilation of glib/demo uses a C compiler, thus compiler warnings
    should be enabled in the CFLAGS variable.

diff --git a/configure.ac b/configure.ac
index 762aa6b..f8b45f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -743,7 +743,8 @@ if test "x$GCC" != xyes; then
 fi
 case "$enable_compile_warnings" in
   no)	;;
-  yes)	CXXFLAGS="-Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wcast-align -fno-exceptions -fno-check-new -fno-common $CXXFLAGS" ;;
+  yes)	CXXFLAGS="-Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wcast-align -fno-exceptions -fno-check-new -fno-common $CXXFLAGS";
+        CFLAGS="-Wall $CFLAGS" ;;
   kde)	CXXFLAGS="-Wnon-virtual-dtor -Wno-long-long -Wundef \
 		-D_XOPEN_SOURCE=600 -D_BSD_SOURCE -Wcast-align \
 		-Wconversion -Wall -W -Wpointer-arith \


More information about the poppler mailing list