From: John Darrington Date: Wed, 6 Jul 2011 08:47:19 +0000 (+0200) Subject: Fix compiler warnings X-Git-Tag: v0.7.9~221^2~1 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=178a771cd0c7cf2f4d6d08ac4b8431656aa29274;p=pspp-builds.git Fix compiler warnings --- diff --git a/src/data/ods-reader.c b/src/data/ods-reader.c index 51ee5ac3..9bbfb479 100644 --- a/src/data/ods-reader.c +++ b/src/data/ods-reader.c @@ -315,13 +315,14 @@ convert_xml_to_value (struct ccase *c, const struct variable *var, value_copy_str_rpad (v, var_get_width (var), xmv->text, ' '); else { + const char *text ; const struct fmt_spec *fmt = var_get_write_format (var); enum fmt_category fc = fmt_get_category (fmt->type); assert ( fc != FMT_CAT_STRING); - const char *text = xmv->value ? CHAR_CAST (const char *, xmv->value): - CHAR_CAST (const char *, xmv->text); + text = + xmv->value ? CHAR_CAST (const char *, xmv->value) : CHAR_CAST (const char *, xmv->text); data_in (ss_cstr (text), "UTF-8", fmt->type, @@ -344,12 +345,14 @@ ods_open_reader (struct spreadsheet_read_info *gri, struct dictionary **dict) int n_var_specs = 0; struct ods_reader *r = xzalloc (sizeof *r); + struct zip_member *content = NULL; + struct zip_reader *zreader ; + xmlChar *val_string = NULL; r->read_names = gri->read_names; ds_init_empty (&r->ods_errs); - struct zip_reader *zreader = zip_reader_create (gri->file_name, &r->ods_errs); - struct zip_member *content = NULL; + zreader = zip_reader_create (gri->file_name, &r->ods_errs); if ( NULL == zreader) { @@ -473,7 +476,6 @@ ods_open_reader (struct spreadsheet_read_info *gri, struct dictionary **dict) } } - xmlChar *val_string = NULL; /* Read in the first row of data */ while (1 == xmlTextReaderRead (r->xtr)) { diff --git a/src/language/stats/oneway.c b/src/language/stats/oneway.c index bdac117c..78bd2150 100644 --- a/src/language/stats/oneway.c +++ b/src/language/stats/oneway.c @@ -181,7 +181,7 @@ static double bonferroni_pinv (double std_err, double alpha, double df, int k, c return std_err * gsl_cdf_tdist_Pinv (1.0 - alpha / (2.0 * m), df); } -static double sidak_pinv (double std_err, double alpha, double df, int k, const struct moments1 *mom_i, const struct moments1 *mom_j) +static double sidak_pinv (double std_err, double alpha, double df, int k, const struct moments1 *mom_i UNUSED, const struct moments1 *mom_j UNUSED) { const double m = k * (k - 1) / 2; double lp = 1.0 - exp (log (1.0 - alpha) / m ) ; @@ -271,21 +271,22 @@ static double scheffe_1tailsig (double ts, double df1, double df2) } -static double tukey_test_stat (int k, const struct moments1 *mom_i, const struct moments1 *mom_j, double std_err) +static double tukey_test_stat (int k UNUSED, const struct moments1 *mom_i, const struct moments1 *mom_j, double std_err) { + double ts; double n_i, mean_i, var_i; double n_j, mean_j, var_j; moments1_calculate (mom_i, &n_i, &mean_i, &var_i, 0, 0); moments1_calculate (mom_j, &n_j, &mean_j, &var_j, 0, 0); - double ts = (mean_i - mean_j) / std_err; + ts = (mean_i - mean_j) / std_err; ts = fabs (ts) * sqrt (2.0); return ts; } -static double lsd_test_stat (int k, const struct moments1 *mom_i, const struct moments1 *mom_j, double std_err) +static double lsd_test_stat (int k UNUSED, const struct moments1 *mom_i, const struct moments1 *mom_j, double std_err) { double n_i, mean_i, var_i; double n_j, mean_j, var_j; @@ -298,32 +299,35 @@ static double lsd_test_stat (int k, const struct moments1 *mom_i, const struct m static double scheffe_test_stat (int k, const struct moments1 *mom_i, const struct moments1 *mom_j, double std_err) { + double t; double n_i, mean_i, var_i; double n_j, mean_j, var_j; moments1_calculate (mom_i, &n_i, &mean_i, &var_i, 0, 0); moments1_calculate (mom_j, &n_j, &mean_j, &var_j, 0, 0); - double t = (mean_i - mean_j) / std_err; + t = (mean_i - mean_j) / std_err; t = pow2 (t); t /= k - 1; return t; } -static double gh_test_stat (int k, const struct moments1 *mom_i, const struct moments1 *mom_j, double std_err) +static double gh_test_stat (int k UNUSED, const struct moments1 *mom_i, const struct moments1 *mom_j, double std_err UNUSED) { + double ts; + double thing; double n_i, mean_i, var_i; double n_j, mean_j, var_j; moments1_calculate (mom_i, &n_i, &mean_i, &var_i, 0, 0); moments1_calculate (mom_j, &n_j, &mean_j, &var_j, 0, 0); - double thing = var_i / n_i + var_j / n_j; + thing = var_i / n_i + var_j / n_j; thing /= 2.0; thing = sqrt (thing); - double ts = (mean_i - mean_j) / thing; + ts = (mean_i - mean_j) / thing; return fabs (ts); } @@ -1527,6 +1531,7 @@ show_comparisons (const struct oneway_spec *cmd, const struct oneway_workspace * for (j = 0 ; j < pvw->n_groups; ++j) { + double std_err; double weight_j, mean_j, var_j; double half_range; struct descriptive_data *dd_j = categoricals_get_user_data_by_category (cat, j); @@ -1542,7 +1547,7 @@ show_comparisons (const struct oneway_spec *cmd, const struct oneway_workspace * tab_double (t, 3, r + rx, 0, mean_i - mean_j, 0); - double std_err = pvw->mse; + std_err = pvw->mse; std_err *= weight_i + weight_j; std_err /= weight_i * weight_j; std_err = sqrt (std_err); diff --git a/src/libpspp/inflate.c b/src/libpspp/inflate.c index 47874784..c4ad1cff 100644 --- a/src/libpspp/inflate.c +++ b/src/libpspp/inflate.c @@ -99,6 +99,7 @@ inflate_init (struct zip_member *zm) int inflate_read (struct zip_member *zm, void *buf, size_t n) { + int r; struct inflator *inf = zm->aux; if (inf->zss.avail_in == 0) @@ -134,7 +135,7 @@ inflate_read (struct zip_member *zm, void *buf, size_t n) inf->zss.avail_out = n; inf->zss.next_out = buf; - int r = inflate (&inf->zss, Z_NO_FLUSH); + r = inflate (&inf->zss, Z_NO_FLUSH); if ( Z_OK == r) { return n - inf->zss.avail_out; diff --git a/src/libpspp/temp-file.c b/src/libpspp/temp-file.c index 0391ec9c..9d3c3926 100644 --- a/src/libpspp/temp-file.c +++ b/src/libpspp/temp-file.c @@ -55,7 +55,7 @@ static void cleanup (void) { struct hmapx_node *node; - const char *fn; + char *fn; cleanup_temp_dir (temp_dir); diff --git a/src/ui/gui/paired-dialog.c b/src/ui/gui/paired-dialog.c index 451c95f3..39a8ae91 100644 --- a/src/ui/gui/paired-dialog.c +++ b/src/ui/gui/paired-dialog.c @@ -143,16 +143,17 @@ two_sample_dialog_destroy (struct paired_samples_dialog *psd) struct paired_samples_dialog * two_sample_dialog_create (PsppireDataWindow *de) { + GtkWidget *dict_view ; + GtkWidget *selector ; struct paired_samples_dialog *tt_d = g_malloc (sizeof *tt_d); PsppireVarStore *vs = NULL; tt_d->xml = builder_new ("paired-samples.ui"); - GtkWidget *dict_view = - get_widget_assert (tt_d->xml, "paired-samples-t-test-treeview1"); + dict_view = get_widget_assert (tt_d->xml, "paired-samples-t-test-treeview1"); - GtkWidget *selector = get_widget_assert (tt_d->xml, "psppire-selector3"); + selector = get_widget_assert (tt_d->xml, "psppire-selector3"); tt_d->dialog = get_widget_assert (tt_d->xml, "t-test-paired-samples-dialog");