Constness
authorJohn Darrington <john@darrington.wattle.id.au>
Fri, 15 Jul 2011 10:34:51 +0000 (12:34 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 26 Jul 2011 10:36:38 +0000 (12:36 +0200)
src/language/stats/oneway.c
src/math/categoricals.c
src/math/categoricals.h

index e15bff7446337d61c1df2eb0dd3ae1e039aadca7..655e1925f8fa7f20be8b62e4e47bce00adbb4e27 100644 (file)
@@ -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));
 
index c955ff9586efb97b0883bee98174200a23d4715e..22d806b347a1d4fd85c725a3b0fe6dd5d3aaa707 100644 (file)
@@ -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);
 }
 
index ef9c37c2c8f1f26ad9aa3d5e1b14431cd27c3912..91767270de599218a6f8eddf46de65952672628f 100644 (file)
@@ -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);