From 5f68c60b8283f6a410de20f927e9b12792ea58b3 Mon Sep 17 00:00:00 2001
From: John Darrington <john@darrington.wattle.id.au>
Date: Mon, 24 May 2010 15:19:29 +0200
Subject: [PATCH] Fix compiler warnings

---
 lib/gtk-contrib/psppire-sheet.c | 24 ------------------------
 src/language/stats/factor.c     |  2 ++
 src/math/categoricals.c         |  4 +++-
 src/math/covariance.c           |  3 ++-
 src/math/linreg.c               |  4 ++--
 src/ui/gui/recode-dialog.c      | 25 -------------------------
 6 files changed, 9 insertions(+), 53 deletions(-)

diff --git a/lib/gtk-contrib/psppire-sheet.c b/lib/gtk-contrib/psppire-sheet.c
index b4861713..760b0fd1 100644
--- a/lib/gtk-contrib/psppire-sheet.c
+++ b/lib/gtk-contrib/psppire-sheet.c
@@ -545,9 +545,6 @@ static void draw_row_title_buttons 	 (PsppireSheet *sheet);
 
 
 static void size_allocate_global_button 	 (PsppireSheet *sheet);
-static void psppire_sheet_button_size_request	 (PsppireSheet *sheet,
-						  const PsppireSheetButton *button,
-						  GtkRequisition *requisition);
 
 static void psppire_sheet_real_cell_clear 		 (PsppireSheet *sheet,
 							  gint row,
@@ -4678,27 +4675,6 @@ psppire_sheet_get_attributes (const PsppireSheet *sheet, gint row, gint col,
   return TRUE;
 }
 
-static void
-psppire_sheet_button_size_request	 (PsppireSheet *sheet,
-					  const PsppireSheetButton *button,
-					  GtkRequisition *button_requisition)
-{
-  GtkRequisition requisition;
-  GtkRequisition label_requisition;
-
-  label_requisition.height = DEFAULT_ROW_HEIGHT;
-  label_requisition.width = COLUMN_MIN_WIDTH;
-
-  requisition.height = DEFAULT_ROW_HEIGHT;
-  requisition.width = COLUMN_MIN_WIDTH;
-
-
-  *button_requisition = requisition;
-  button_requisition->width = MAX (requisition.width, label_requisition.width);
-  button_requisition->height = MAX (requisition.height, label_requisition.height);
-
-}
-
 static void
 psppire_sheet_forall (GtkContainer *container,
 		      gboolean include_internals,
diff --git a/src/language/stats/factor.c b/src/language/stats/factor.c
index 1043173b..a2a8e5df 100644
--- a/src/language/stats/factor.c
+++ b/src/language/stats/factor.c
@@ -211,6 +211,7 @@ idata_free (struct idata *id)
 }
 
 
+#if 0
 static void
 dump_matrix (const gsl_matrix *m)
 {
@@ -249,6 +250,7 @@ dump_vector (const gsl_vector *v)
     }
   printf ("\n");
 }
+#endif
 
 
 static int 
diff --git a/src/math/categoricals.c b/src/math/categoricals.c
index 33e3b51c..5aba65b7 100644
--- a/src/math/categoricals.c
+++ b/src/math/categoricals.c
@@ -102,6 +102,7 @@ categoricals_destroy ( struct categoricals *cat)
 }
 
 
+#if 0
 void
 categoricals_dump (const struct categoricals *cat)
 {
@@ -132,8 +133,8 @@ categoricals_dump (const struct categoricals *cat)
       for (node = hmap_first (m); node; node = hmap_next (m, node))
 	{
 	  struct string s;
-	  ds_init_empty (&s);
 	  const struct value_node *vn = HMAP_DATA (node, struct value_node, node);
+	  ds_init_empty (&s);
 	  var_append_value_name (vp->var, &vn->value, &s);
 	  printf ("Value: %s; Index %d; CC %g\n",
 		  ds_cstr (&s),
@@ -155,6 +156,7 @@ categoricals_dump (const struct categoricals *cat)
     printf ("%d ", cat->reverse_variable_map[v]);
   printf ("\n");
 }
+#endif
 
 
 
diff --git a/src/math/covariance.c b/src/math/covariance.c
index d03f6ad0..61f54f50 100644
--- a/src/math/covariance.c
+++ b/src/math/covariance.c
@@ -267,6 +267,7 @@ get_val (const struct covariance *cov, int i, const struct ccase *c)
   return categoricals_get_binary_by_subscript (cov->categoricals, i - cov->n_vars, c);
 }
 
+#if 0
 void
 dump_matrix (const gsl_matrix *m)
 {
@@ -279,6 +280,7 @@ dump_matrix (const gsl_matrix *m)
       printf ("\n");
     }
 }
+#endif
 
 /* Call this function for every case in the data set */
 void
@@ -643,7 +645,6 @@ static const gsl_matrix *
 covariance_calculate_single_pass_unnormalized (struct covariance *cov)
 {
   size_t i, j;
-  size_t m;
 
   for (i = 0 ; i < cov->dim; ++i)
     {
diff --git a/src/math/linreg.c b/src/math/linreg.c
index 8bf1ad62..e74646b9 100644
--- a/src/math/linreg.c
+++ b/src/math/linreg.c
@@ -268,6 +268,8 @@ void linreg_set_indep_variable_mean (linreg *c, size_t j, double m)
 static void
 linreg_fit_qr (const gsl_matrix *cov, linreg *l)
 {
+  double intcpt_coef = 0.0;
+  double intercept_variance = 0.0;
   gsl_matrix *xtx;
   gsl_matrix *q;
   gsl_matrix *r;
@@ -312,7 +314,6 @@ linreg_fit_qr (const gsl_matrix *cov, linreg *l)
   gsl_blas_dtrsm (CblasLeft, CblasLower, CblasNoTrans, CblasNonUnit, linreg_mse (l),
 		  r, q);
   /* Copy the lower triangle into the upper triangle. */
-  double intercept_variance = 0.0;
   for (i = 0; i < q->size1; i++)
     {
       gsl_matrix_set (l->cov, i + 1, i + 1, gsl_matrix_get (q, i, i));
@@ -336,7 +337,6 @@ linreg_fit_qr (const gsl_matrix *cov, linreg *l)
   /* Covariances related to the intercept. */
   intercept_variance += linreg_mse (l) / linreg_n_obs (l);
   gsl_matrix_set (l->cov, 0, 0, intercept_variance);  
-  double intcpt_coef = 0.0;
   for (i = 0; i < q->size1; i++)
     {
       for (j = 0; j < q->size2; j++)
diff --git a/src/ui/gui/recode-dialog.c b/src/ui/gui/recode-dialog.c
index 0a3ab0da..27f69725 100644
--- a/src/ui/gui/recode-dialog.c
+++ b/src/ui/gui/recode-dialog.c
@@ -801,30 +801,6 @@ on_change_clicked (GObject *obj, gpointer data)
 }
 
 
-/* If there's nothing selected in the variable treeview,
-   then automatically select the first item */
-static void
-select_something (GtkTreeModel *treemodel,
-		  GtkTreePath  *arg1,
-		  GtkTreeIter  *arg2,
-		  gpointer      data)
-{
-  struct recode_dialog *rd = data;
-  GtkTreeSelection *sel;
-
-  sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (rd->variable_treeview));
-
-  if ( gtk_tree_selection_count_selected_rows (sel) < 1)
-    {
-      GtkTreeIter iter;
-
-      gtk_tree_model_get_iter_first   (treemodel, &iter);
-
-      gtk_tree_selection_select_iter  (sel, &iter);
-    }
-}
-
-
 /* Callback for the new_value_entry and new_value_togglebutton widgets.
    It's used to enable/disable the acr. */
 static void
@@ -921,7 +897,6 @@ recode_dialog (PsppireDataWindow *de, gboolean diff)
 
   if (rd.different)
     {
-      GtkTreeModel *model = GTK_TREE_MODEL (PSPPIRE_VAR_VIEW (rd.variable_treeview)->list);
       GtkTreeSelection *sel;
 
       GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
-- 
2.30.2