From: John Darrington Date: Tue, 23 Aug 2011 19:26:20 +0000 (+0200) Subject: Fix warnings X-Git-Tag: v0.7.9~154 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4010cd95ae15efa542a324c4c2081b19ab10b902;p=pspp-builds.git Fix warnings --- diff --git a/src/language/stats/ks-one-sample.c b/src/language/stats/ks-one-sample.c index aba2cbde..a4a2792f 100644 --- a/src/language/stats/ks-one-sample.c +++ b/src/language/stats/ks-one-sample.c @@ -130,9 +130,10 @@ static void show_results (const struct ks *, const struct ks_one_sample_test *, void ks_one_sample_execute (const struct dataset *ds, - struct casereader *input, - enum mv_class exclude, - const struct npar_test *test) + struct casereader *input, + enum mv_class exclude, + const struct npar_test *test, + bool x UNUSED, double y UNUSED) { const struct dictionary *dict = dataset_dict (ds); const struct ks_one_sample_test *kst = UP_CAST (test, const struct ks_one_sample_test, parent.parent); @@ -142,6 +143,7 @@ ks_one_sample_execute (const struct dataset *ds, const struct fmt_spec *wfmt = wvar ? var_get_print_format (wvar) : & F_8_0; bool warn = true; int v; + struct casereader *r = casereader_clone (input); struct ks *ks = xcalloc (sizeof *ks, ost->n_vars); @@ -156,8 +158,6 @@ ks_one_sample_execute (const struct dataset *ds, ks[v].ssq = 0; } - struct casereader *r = casereader_clone (input); - for (; (c = casereader_read (r)) != NULL; case_unref (c)) { const double weight = dict_get_case_weight (dict, c, &warn); @@ -182,6 +182,10 @@ ks_one_sample_execute (const struct dataset *ds, for (v = 0; v < ost->n_vars; ++v) { + const struct variable *var = ost->vars[v]; + double cc = 0; + double prev_empirical = 0; + switch (kst->dist) { case KS_UNIFORM: @@ -218,9 +222,6 @@ ks_one_sample_execute (const struct dataset *ds, NOT_REACHED (); } - const struct variable *var = ost->vars[v]; - double cc = 0; - double prev_empirical = 0; r = sort_execute_1var (casereader_clone (input), var); for (; (c = casereader_read (r)) != NULL; case_unref (c)) { diff --git a/src/language/stats/ks-one-sample.h b/src/language/stats/ks-one-sample.h index 054cce41..e1ab07a9 100644 --- a/src/language/stats/ks-one-sample.h +++ b/src/language/stats/ks-one-sample.h @@ -44,6 +44,7 @@ struct dataset; void ks_one_sample_execute (const struct dataset *ds, struct casereader *input, enum mv_class exclude, - const struct npar_test *test); + const struct npar_test *test, + bool, double); #endif diff --git a/src/language/stats/npar.c b/src/language/stats/npar.c index bfeaf8f7..fda7b0c6 100644 --- a/src/language/stats/npar.c +++ b/src/language/stats/npar.c @@ -1007,7 +1007,7 @@ npar_ks_one_sample (struct lexer *lexer, struct dataset *ds, struct npar_specs * specs->test, sizeof (*specs->test) * specs->n_tests); - specs->test[specs->n_tests - 1] = kst; + specs->test[specs->n_tests - 1] = nt; return 1; } diff --git a/src/language/stats/oneway.c b/src/language/stats/oneway.c index 8182d517..1c80c2ba 100644 --- a/src/language/stats/oneway.c +++ b/src/language/stats/oneway.c @@ -755,11 +755,12 @@ run_oneway (const struct oneway_spec *cmd, for (v = 0; v < cmd->n_vars; ++v) { + gsl_matrix *cm; struct per_var_ws *pvw = &ws.vws[v]; const struct categoricals *cats = covariance_get_categoricals (pvw->cov); categoricals_done (cats); - gsl_matrix *cm = covariance_calculate_unnormalized (pvw->cov); + cm = covariance_calculate_unnormalized (pvw->cov); moments1_calculate (ws.dd_total[v]->mom, &pvw->n, NULL, NULL, NULL, NULL); diff --git a/src/math/categoricals.c b/src/math/categoricals.c index d3aa3728..9f8215d3 100644 --- a/src/math/categoricals.c +++ b/src/math/categoricals.c @@ -73,6 +73,7 @@ struct variable_node struct hmap valmap; /* A map of value nodes */ }; +#if 0 static void dump_interaction (const struct interaction *iact) { @@ -81,6 +82,7 @@ dump_interaction (const struct interaction *iact) printf ("Interaction: %s\n", ds_cstr (&str)); ds_destroy (&str); } +#endif static struct variable_node * @@ -180,7 +182,7 @@ struct categoricals void *aux2; }; - +#if 0 static void categoricals_dump (const struct categoricals *cat) { @@ -238,7 +240,7 @@ categoricals_dump (const struct categoricals *cat) printf (")\n"); } } - +#endif void categoricals_destroy (struct categoricals *cat) diff --git a/src/ui/gui/runs-dialog.c b/src/ui/gui/runs-dialog.c index 64f50ace..2e219373 100644 --- a/src/ui/gui/runs-dialog.c +++ b/src/ui/gui/runs-dialog.c @@ -209,7 +209,7 @@ generate_syntax (const struct runs *rd) if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->cb[CB_CUSTOM]))) { - char *text = gtk_entry_get_text (GTK_ENTRY (rd->entry)); + const char *text = gtk_entry_get_text (GTK_ENTRY (rd->entry)); append_fragment (string, text, PSPPIRE_VAR_VIEW (rd->variables)); }