[goffice] Compilation: fix warnings.



commit c2f32b3b960c048e0fb259a45c9c2fcee3c72aeb
Author: Morten Welinder <terra gnome org>
Date:   Sat Dec 2 21:35:28 2017 -0500

    Compilation: fix warnings.
    
    This kills "unused" and "set, but unused" warnings.  Only deprecation
    warnings and #warning are left.

 NEWS                              |    1 +
 goffice/gtk/go-color-palette.c    |    1 -
 plugins/plot_barcol/gog-1.5d.c    |    3 +++
 plugins/plot_barcol/gog-barcol.c  |   14 +++++++-------
 plugins/plot_barcol/gog-dropbar.c |    3 +--
 plugins/plot_pie/gog-pie.c        |    6 ++----
 plugins/plot_radar/gog-radar.c    |    9 ++-------
 plugins/plot_xy/gog-xy.c          |    8 ++------
 8 files changed, 18 insertions(+), 27 deletions(-)
---
diff --git a/NEWS b/NEWS
index 46d6ce3..25d0b28 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ goffice 0.10.38:
 
 Morten:
        * Avoid a few dubious uses of deprecated gtk+ functions.
+       * Reduce number of compiler warnings.
 
 --------------------------------------------------------------------------
 goffice 0.10.37:
diff --git a/goffice/gtk/go-color-palette.c b/goffice/gtk/go-color-palette.c
index 75fec09..34bbc0e 100644
--- a/goffice/gtk/go-color-palette.c
+++ b/goffice/gtk/go-color-palette.c
@@ -364,7 +364,6 @@ go_color_palette_button_new (GOColorPalette *pal, GtkGrid *grid,
                             gint col, gint row)
 {
        GtkWidget *button, *swatch, *box;
-       GdkRGBA   gdk;
 
        swatch = gtk_drawing_area_new ();
        g_signal_connect (G_OBJECT (swatch), "draw", G_CALLBACK (draw_color_cb),
diff --git a/plugins/plot_barcol/gog-1.5d.c b/plugins/plot_barcol/gog-1.5d.c
index 6482f9c..b0e1a83 100644
--- a/plugins/plot_barcol/gog-1.5d.c
+++ b/plugins/plot_barcol/gog-1.5d.c
@@ -552,6 +552,9 @@ gog_series1_5d_update (GogObject *obj)
                        len = tmp;
        }
 
+       // Why did we want these?
+       (void)vals;
+
        /* queue plot for redraw */
        gog_object_request_update (GOG_OBJECT (series->plot));
        if (old_num != series->num_elements)
diff --git a/plugins/plot_barcol/gog-barcol.c b/plugins/plot_barcol/gog-barcol.c
index 317fb84..f297dfa 100644
--- a/plugins/plot_barcol/gog-barcol.c
+++ b/plugins/plot_barcol/gog-barcol.c
@@ -398,7 +398,7 @@ gog_barcol_view_get_data_at_point (GogPlotView *view, double x, double y, GogSer
        GogViewAllocation const *area;
        unsigned num_elements = gog_1_5d_model->num_elements;
        unsigned num_series = gog_1_5d_model->num_series;
-       gboolean is_vertical = ! (model->horizontal), valid;
+       gboolean is_vertical = ! (model->horizontal);
        double **vals, sum, neg_base, pos_base, tmp;
        double col_step, group_step, offset, data_scale;
        unsigned i, j, jinit, jend, jstep;
@@ -476,17 +476,17 @@ gog_barcol_view_get_data_at_point (GogPlotView *view, double x, double y, GogSer
                pos_base = neg_base = 0.0;
                for (j = jinit; j != jend; j += jstep) {
                        double x0, y0, x1, y1;
+                       gboolean valid;
+
                        work.y = (double) j * col_step + (double) i - offset + 1.0;
 
                        if (i >= lengths[j])
                                continue;
 
                        tmp = vals[j][i];
-                       valid = TRUE;
-                       if (!gog_axis_map_finite (map, tmp)) {
+                       valid = gog_axis_map_finite (map, tmp);
+                       if (!valid)
                                tmp = 0;
-                               valid = FALSE;
-                       }
                        tmp *= data_scale;
                        if (tmp >= 0.) {
                                work.x = pos_base;
@@ -524,12 +524,12 @@ gog_barcol_view_get_data_at_point (GogPlotView *view, double x, double y, GogSer
                                y1 = gog_axis_map_to_view (y_map, work.y + work.h);
                        }
                        if (x0 > x1) {
-                               tmp = x0;
+                               double tmp = x0;
                                x0 = x1;
                                x1 = tmp;
                        }
                        if (y0 > y1) {
-                               tmp = y0;
+                               double tmp = y0;
                                y0 = y1;
                                y1 = tmp;
                        }
diff --git a/plugins/plot_barcol/gog-dropbar.c b/plugins/plot_barcol/gog-dropbar.c
index 14957b0..ea12a32 100644
--- a/plugins/plot_barcol/gog-dropbar.c
+++ b/plugins/plot_barcol/gog-dropbar.c
@@ -256,7 +256,7 @@ gog_dropbar_view_render (GogView *view, GogViewAllocation const *bbox)
        double *start_vals, *end_vals;
        double x, xmapped;
        double step, offset, group_step;
-       unsigned i, j, k;
+       unsigned i, j;
        unsigned num_elements = gog_1_5d_model->num_elements;
        unsigned num_series = gog_1_5d_model->num_series;
        GSList *ptr;
@@ -327,7 +327,6 @@ gog_dropbar_view_render (GogView *view, GogViewAllocation const *bbox)
                        go_path_set_options (path2[j], GO_PATH_OPTIONS_SHARP);
                } else
                        path1[j] = NULL;
-               k = 0;
                for (i = 0; i < n; i++) {
                        x++;
                        work.x = x;
diff --git a/plugins/plot_pie/gog-pie.c b/plugins/plot_pie/gog-pie.c
index 81f54fc..3bacb7b 100644
--- a/plugins/plot_pie/gog-pie.c
+++ b/plugins/plot_pie/gog-pie.c
@@ -648,7 +648,7 @@ gog_pie_view_get_data_at_point (GogPlotView *view, double x, double y, GogSeries
        GogPieSeries const *pseries = NULL;
        double r_tot, r_cur, r_int, r_ext, cx, cy, r, th, th0, theta, scale, *vals;
        double separated_cx, separated_cy;
-       unsigned int index, elem, k;
+       unsigned int index, k;
        double center_radius;
        double center_size = 0.0;
        unsigned num_series = 0;
@@ -791,7 +791,6 @@ gog_pie_view_get_data_at_point (GogPlotView *view, double x, double y, GogSeries
        if (r < center_radius)
                return -1;
 
-       elem = model->base.index_num;
        index = 1;
        th0 = (model->initial_angle + pseries->initial_angle) * M_PI / 180. - M_PI / 2.;
        th = atan2 (y - cy, x - cx);
@@ -888,7 +887,7 @@ gog_pie_view_render (GogView *view, GogViewAllocation const *bbox)
        GogPieSeries const *series = NULL;
        double separated_cx, separated_cy, cx, cy, r, theta, len, *vals, scale;
        double default_sep;
-       unsigned elem, k;
+       unsigned k;
        GOPath *path;
        GogTheme *theme = gog_object_get_theme (GOG_OBJECT (model));
        GOStyle *style, *white_style = NULL, *elt_style = NULL;
@@ -1038,7 +1037,6 @@ gog_pie_view_render (GogView *view, GogViewAllocation const *bbox)
        center_radius = r_tot * center_size;
        r = r_tot * (1. - center_size);
 
-       elem = model->base.index_num;
        index = 1;
        for (ptr = model->base.series ; ptr != NULL ; ptr = ptr->next) {
                series = ptr->data;
diff --git a/plugins/plot_radar/gog-radar.c b/plugins/plot_radar/gog-radar.c
index 47db095..dc6a10a 100644
--- a/plugins/plot_radar/gog-radar.c
+++ b/plugins/plot_radar/gog-radar.c
@@ -805,7 +805,7 @@ gog_rt_view_render (GogView *view, GogViewAllocation const *bbox)
        GogViewAllocation const *area;
        GOPath *next_path = NULL;
        GSList   *ptr;
-       double th0, theta_min, theta_max, theta = 0;
+       double theta_min, theta_max, theta = 0;
        double rho_min, rho_max, rho;
        gboolean const is_polar = GOG_IS_PLOT_POLAR (model);
        gboolean is_map = GOG_IS_PLOT_COLOR_POLAR (model), hide_outliers = TRUE;
@@ -834,7 +834,6 @@ gog_rt_view_render (GogView *view, GogViewAllocation const *bbox)
        }
 
        gog_axis_map_get_bounds (c_map, &theta_min, &theta_max);
-       th0 = theta_min;
        gog_axis_map_get_bounds (r_map, &rho_min, &rho_max);
        /* convert theta value to radians */
        theta_min = gog_axis_map_to_view (c_map, theta_min);
@@ -910,15 +909,12 @@ gog_rt_view_render (GogView *view, GogViewAllocation const *bbox)
 
                                                next_series = ptr->next->data;
                                                if (gog_series_is_valid (GOG_SERIES (next_series))) {
-                                                       GOStyle *next_style;
                                                        const double *next_x_vals, *next_y_vals;
                                                        unsigned int next_n_points;
 
                                                        next_n_points = gog_series_get_xy_data
                                                                (GOG_SERIES (next_series),
                                                                 &next_x_vals, &next_y_vals);
-                                                       next_style = go_styled_object_get_style
-                                                               (GO_STYLED_OBJECT (next_series));
 
                                                        next_path = gog_chart_map_make_path
                                                                (chart_map, next_x_vals, next_y_vals,
@@ -1195,11 +1191,10 @@ gog_rt_series_update (GogObject *obj)
 {
        GogRTSeries *series = GOG_RT_SERIES (obj);
        unsigned old_num = series->base.num_elements;
-       double *vals;
        unsigned len = 0;
 
        if (series->base.values[1].data != NULL) {
-               vals = go_data_get_values (series->base.values[1].data);
+               //vals = go_data_get_values (series->base.values[1].data);
                len = go_data_get_vector_size (series->base.values[1].data);
        }
        if (GOG_IS_POLAR_SERIES (obj) && series->base.values[0].data != NULL)
diff --git a/plugins/plot_xy/gog-xy.c b/plugins/plot_xy/gog-xy.c
index 99a2208..3d034d9 100644
--- a/plugins/plot_xy/gog-xy.c
+++ b/plugins/plot_xy/gog-xy.c
@@ -1051,8 +1051,7 @@ gog_xy_view_render (GogView *view, GogViewAllocation const *bbox)
        double zmax, rmax = 0., x_left, y_bottom, x_right, y_top;
        double x_margin_min, x_margin_max, y_margin_min, y_margin_max, margin;
        double xerrmin, xerrmax, yerrmin, yerrmax;
-       double x_baseline, y_baseline;
-       gboolean show_marks, show_lines, show_fill, show_negatives, in_3d, size_as_area = TRUE;
+       gboolean show_marks, show_lines, show_fill, show_negatives, size_as_area = TRUE;
        gboolean is_map = GOG_IS_XY_COLOR_PLOT (model), hide_outliers = TRUE;
        GogObjectRole const *lbl_role = NULL;
        GogAxisColorMap const *color_map = NULL;
@@ -1100,9 +1099,6 @@ gog_xy_view_render (GogView *view, GogViewAllocation const *bbox)
        y_bottom = gog_axis_map_to_view (y_map, y_bottom);
        y_top = gog_axis_map_to_view (y_map, y_top);
 
-       x_baseline = gog_axis_map_get_baseline (x_map);
-       y_baseline = gog_axis_map_get_baseline (y_map);
-
        gog_renderer_push_clip_rectangle (view->renderer, view->allocation.x, view->allocation.y,
                                          view->allocation.w, view->allocation.h);
 
@@ -1289,7 +1285,7 @@ gog_xy_view_render (GogView *view, GogViewAllocation const *bbox)
                        rmax = MIN (view->residual.w, view->residual.h) / BUBBLE_MAX_RADIUS_RATIO
                                                * GOG_BUBBLE_PLOT (view->model)->bubble_scale;
                        size_as_area = GOG_BUBBLE_PLOT (view->model)->size_as_area;
-                       in_3d = GOG_BUBBLE_PLOT (view->model)->in_3d;
+                       // in_3d = GOG_BUBBLE_PLOT (view->model)->in_3d;
                        if (show_negatives) {
                                zmin = fabs (zmin);
                                if (zmin > zmax) zmax = zmin;


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