From: John Darrington Date: Fri, 15 Jul 2011 10:34:51 +0000 (+0200) Subject: Constness X-Git-Tag: v0.7.9~192 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15aae7ade3a0835939d28d78f20ed1eb85500d86;p=pspp-builds.git Constness --- diff --git a/src/language/stats/oneway.c b/src/language/stats/oneway.c index e15bff74..655e1925 100644 --- a/src/language/stats/oneway.c +++ b/src/language/stats/oneway.c @@ -652,7 +652,7 @@ run_oneway (const struct oneway_spec *cmd, for (v = 0; v < cmd->n_vars; ++v) { - const struct interaction *inter = interaction_create (cmd->indep_var); + struct interaction *inter = interaction_create (cmd->indep_var); ws.vws[v].cat = categoricals_create (&inter, 1, cmd->wv, cmd->exclude, makeit, updateit, CONST_CAST (struct variable *, @@ -1537,12 +1537,13 @@ show_comparisons (const struct oneway_spec *cmd, const struct oneway_workspace * double std_err; double weight_j, mean_j, var_j; double half_range; + const struct ccase *cc; struct descriptive_data *dd_j = categoricals_get_user_data_by_category (cat, j); if (j == i) continue; ds_clear (&vstr); - const struct ccase *cc = categoricals_get_case_by_category (cat, j); + cc = categoricals_get_case_by_category (cat, j); var_append_value_name (cmd->indep_var, case_data (cc, cmd->indep_var), &vstr); tab_text (t, 2, r + rx, TAB_LEFT | TAT_TITLE, ds_cstr (&vstr)); diff --git a/src/math/categoricals.c b/src/math/categoricals.c index c955ff95..22d806b3 100644 --- a/src/math/categoricals.c +++ b/src/math/categoricals.c @@ -260,7 +260,7 @@ lookup_case (const struct hmap *map, const struct interaction *iact, const struc struct categoricals * -categoricals_create (const struct interaction **inter, size_t n_inter, +categoricals_create (struct interaction *const*inter, size_t n_inter, const struct variable *wv, enum mv_class exclude, user_data_create_func *udf, update_func *update, void *aux1, void *aux2 @@ -467,7 +467,6 @@ categoricals_done (const struct categoricals *cat_) iap->reverse_interaction_value_map = pool_calloc (cat->pool, iap->n_cats, sizeof *iap->reverse_interaction_value_map); - HMAP_FOR_EACH (ivn, struct interaction_value, node, &iap->ivmap) { iap->reverse_interaction_value_map[x++] = ivn; @@ -487,8 +486,6 @@ categoricals_done (const struct categoricals *cat_) cat->reverse_variable_map_long[idx_long++] = i; } - - assert (cat->n_vars <= cat->n_iap); } diff --git a/src/math/categoricals.h b/src/math/categoricals.h index ef9c37c2..91767270 100644 --- a/src/math/categoricals.h +++ b/src/math/categoricals.h @@ -37,7 +37,7 @@ typedef void update_func (void *user_data, typedef void *user_data_create_func (void *aux1, void *aux2); -struct categoricals *categoricals_create (const struct interaction **, size_t n_int, +struct categoricals *categoricals_create (struct interaction *const *, size_t n_int, const struct variable *wv, enum mv_class exclude, user_data_create_func *udf, update_func *update, void *aux1, void *aux2);