[gnome-utils] baobab: Fix compiler warnings from -Wall



commit 380fa319f19dd6f65144668970fa417c8d18948a
Author: Benjamin Otte <otte redhat com>
Date:   Wed Sep 1 14:05:38 2010 +0200

    baobab: Fix compiler warnings from -Wall
    
    Seriously, people...
    
    https://bugzilla.gnome.org/show_bug.cgi?id=628499

 baobab/src/baobab-cell-renderer-progress.c |    2 +-
 baobab/src/baobab-chart.c                  |   35 ++++++++++++---------------
 baobab/src/baobab-prefs.c                  |    1 +
 baobab/src/baobab-remote-connect-dialog.c  |    2 -
 baobab/src/baobab-ringschart.c             |    3 +-
 baobab/src/baobab-scan.c                   |    1 -
 baobab/src/baobab-treemap.c                |    2 -
 baobab/src/baobab-utils.c                  |    3 +-
 baobab/src/baobab.c                        |    2 +-
 9 files changed, 21 insertions(+), 30 deletions(-)
---
diff --git a/baobab/src/baobab-cell-renderer-progress.c b/baobab/src/baobab-cell-renderer-progress.c
index 8e99a7b..753d8b0 100644
--- a/baobab/src/baobab-cell-renderer-progress.c
+++ b/baobab/src/baobab-cell-renderer-progress.c
@@ -191,7 +191,7 @@ baobab_cell_renderer_progress_render (GtkCellRenderer *cell,
 				      guint            flags)
 {
   BaobabCellRendererProgress *cellprogress = BAOBAB_CELL_RENDERER_PROGRESS (cell);
-  gint x, y, w, h, perc_w, pos;
+  gint x, y, w, h, perc_w;
   gboolean is_rtl;
   cairo_t *cr;
   gint xpad;
diff --git a/baobab/src/baobab-chart.c b/baobab/src/baobab-chart.c
index b72c9d0..269d3c3 100644
--- a/baobab/src/baobab-chart.c
+++ b/baobab/src/baobab-chart.c
@@ -301,7 +301,6 @@ baobab_chart_realize (GtkWidget *widget)
   gint attributes_mask;
   GtkAllocation allocation;
   GdkWindow *window;
-  GtkStyle *style;
 
   g_return_if_fail (BAOBAB_IS_CHART (widget));
 
@@ -507,7 +506,7 @@ static void
 baobab_chart_get_items (GtkWidget *chart, GtkTreePath *root)
 {
   BaobabChartPrivate *priv;
-  BaobabChartItem *item, *child_item;
+  BaobabChartItem *item;
 
   GList *node;
   GtkTreeIter initial_iter = {0};
@@ -520,7 +519,6 @@ baobab_chart_get_items (GtkWidget *chart, GtkTreePath *root)
   GList *child_node;
   BaobabChartItem *child;
   gdouble rel_start;
-  gdouble rel_size;
 
   priv = BAOBAB_CHART_GET_PRIVATE (chart);
 
@@ -900,17 +898,19 @@ baobab_chart_get_item_color (BaobabChartColor *color,
     }
 
   if (highlighted)
-    if (depth == 0)
-      *color = level_color_hl;
-    else
-      {
-        maximum = MAX (color->red,
-                       MAX (color->green,
-                            color->blue));
-        color->red /= maximum;
-        color->green /= maximum;
-        color->blue /= maximum;
-      }
+    {
+      if (depth == 0)
+        *color = level_color_hl;
+      else
+        {
+          maximum = MAX (color->red,
+                         MAX (color->green,
+                              color->blue));
+          color->red /= maximum;
+          color->green /= maximum;
+          color->blue /= maximum;
+        }
+    }
 }
 
 static gint
@@ -948,8 +948,6 @@ static gint
 baobab_chart_scroll (GtkWidget *widget,
                      GdkEventScroll *event)
 {
-  BaobabChartPrivate * priv = BAOBAB_CHART_GET_PRIVATE (widget);
-
   switch (event->direction)
     {
     case GDK_SCROLL_LEFT :
@@ -1407,7 +1405,6 @@ baobab_chart_set_root (GtkWidget *chart,
                        GtkTreePath *root)
 {
   BaobabChartPrivate *priv;
-  GtkTreeIter iter = {0};
   GtkTreePath *current_root;
 
   g_return_if_fail (BAOBAB_IS_CHART (chart));
@@ -1835,7 +1832,7 @@ baobab_chart_can_zoom_in (GtkWidget *chart)
   BaobabChartPrivate *priv;
   BaobabChartClass *class;
 
-  g_return_if_fail (BAOBAB_IS_CHART (chart));
+  g_return_val_if_fail (BAOBAB_IS_CHART (chart), FALSE);
 
   priv = BAOBAB_CHART (chart)->priv;
   class = BAOBAB_CHART_GET_CLASS (chart);
@@ -1861,7 +1858,7 @@ baobab_chart_can_zoom_out (GtkWidget *chart)
   BaobabChartPrivate *priv;
   BaobabChartClass *class;
 
-  g_return_if_fail (BAOBAB_IS_CHART (chart));
+  g_return_val_if_fail (BAOBAB_IS_CHART (chart), FALSE);
 
   priv = BAOBAB_CHART (chart)->priv;
   class = BAOBAB_CHART_GET_CLASS (chart);
diff --git a/baobab/src/baobab-prefs.c b/baobab/src/baobab-prefs.c
index 0786ffa..1b2de02 100644
--- a/baobab/src/baobab-prefs.c
+++ b/baobab/src/baobab-prefs.c
@@ -27,6 +27,7 @@
 #include <sys/stat.h>
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
+#include <glib/gstdio.h>
 #include <gconf/gconf-client.h>
 #include <glibtop/mountlist.h>
 #include <glibtop/fsusage.h>
diff --git a/baobab/src/baobab-remote-connect-dialog.c b/baobab/src/baobab-remote-connect-dialog.c
index d7d5fc2..5ebac97 100644
--- a/baobab/src/baobab-remote-connect-dialog.c
+++ b/baobab/src/baobab-remote-connect-dialog.c
@@ -364,8 +364,6 @@ response_callback (BaobabRemoteConnectDialog *dialog,
 		   int response_id,
 		   GtkWindow *app)
 {
-	GError *error;
-
 	switch (response_id) {
 	case RESPONSE_CONNECT:
 		connect_to_server (dialog, app);
diff --git a/baobab/src/baobab-ringschart.c b/baobab/src/baobab-ringschart.c
index fda2567..4e51c01 100644
--- a/baobab/src/baobab-ringschart.c
+++ b/baobab/src/baobab-ringschart.c
@@ -432,9 +432,8 @@ baobab_ringschart_draw_subfolder_tips (GtkWidget *chart, cairo_t *cr)
 
   gdouble q_angle, q_width, q_height;
 
-  gdouble tip_angle, tip_x, tip_y;
+  gdouble tip_x, tip_y;
   gdouble middle_angle, middle_angle_n, middle_radius;
-  gdouble min_angle, max_angle;
   gdouble sector_center_x, sector_center_y;
   gdouble a;
   guint i;
diff --git a/baobab/src/baobab-scan.c b/baobab/src/baobab-scan.c
index ef06e90..8c85d85 100644
--- a/baobab/src/baobab-scan.c
+++ b/baobab/src/baobab-scan.c
@@ -181,7 +181,6 @@ loopdir (GFile *file,
 	 BaobabHardLinkArray *hla,
 	 gint current_depth)
 {
-	GList *file_list;
 	guint64 tempHLsize = 0;
 	gint elements = 0;
 	struct chan_data data;
diff --git a/baobab/src/baobab-treemap.c b/baobab/src/baobab-treemap.c
index 45cf903..7262b81 100644
--- a/baobab/src/baobab-treemap.c
+++ b/baobab/src/baobab-treemap.c
@@ -198,7 +198,6 @@ baobab_treemap_calculate_item_geometry (GtkWidget *chart,
   gdouble width, height;
   BaobabChartItem *parent = NULL;
   GtkAllocation allocation;
-  guint max_depth;
 
   priv = BAOBAB_TREEMAP (chart)->priv;
 
@@ -287,7 +286,6 @@ static void
 baobab_treemap_get_item_rectangle (GtkWidget *chart,
                                    BaobabChartItem *item)
 {
-  GdkRectangle rect;
   cairo_rectangle_t *_rect;
 
   _rect = (cairo_rectangle_t *) item->data;
diff --git a/baobab/src/baobab-utils.c b/baobab/src/baobab-utils.c
index deab561..3f09625 100644
--- a/baobab/src/baobab-utils.c
+++ b/baobab/src/baobab-utils.c
@@ -352,9 +352,8 @@ add_popupmenu_item (GtkMenu *pmenu, const gchar *label, const gchar *stock, GCal
 void
 popupmenu_list (GtkTreePath *path, GdkEventButton *event, gboolean can_trash)
 {
-	GtkWidget *pmenu, *open, *trash, *remove;
+	GtkWidget *pmenu;
 	gchar *path_to_string;
-	GtkWidget *image;
 
 	/* path_to_string is freed in callback function */
 	path_to_string = gtk_tree_path_to_string (path);
diff --git a/baobab/src/baobab.c b/baobab/src/baobab.c
index 23ab794..6048efe 100644
--- a/baobab/src/baobab.c
+++ b/baobab/src/baobab.c
@@ -1073,7 +1073,7 @@ drag_data_received_handl (GtkWidget *widget,
 	    (gtk_selection_data_get_length (selection_data) >= 0) &&
 	    (target_type == DND_TARGET_URI_LIST)) {
 		gchar **uri_list;
-		uri_list = g_uri_list_extract_uris (gtk_selection_data_get_data (selection_data));
+		uri_list = g_uri_list_extract_uris ((const gchar *) gtk_selection_data_get_data (selection_data));
 		/* check list is 1 item long */
 		if (uri_list != NULL && uri_list[0] != NULL && uri_list[1] == NULL) {
 			gf = g_file_new_for_uri (uri_list[0]);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]