X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fcase-map.c;h=ed32db0d3fc940cf9d14cd74de02889b9a6721a0;hb=4504e04f97804a96914ba12d9e450ddda49a7bab;hp=131e4078796eb8c8c7d4f812499857b03e6ba031;hpb=3dd0f6ae0d5eb73a2270a243e443c4ae03c2c16e;p=pspp diff --git a/src/data/case-map.c b/src/data/case-map.c index 131e407879..ed32db0d3f 100644 --- a/src/data/case-map.c +++ b/src/data/case-map.c @@ -189,7 +189,7 @@ struct case_map * case_map_to_compact_dict (const struct dictionary *d, unsigned int exclude_classes) { - size_t n_vars = dict_get_var_cnt (d); + size_t n_vars = dict_get_n_vars (d); struct caseproto *proto; struct case_map *map; size_t n_values; @@ -234,7 +234,7 @@ struct case_map_stage struct case_map_stage * case_map_stage_create (const struct dictionary *dict) { - size_t n_vars = dict_get_var_cnt (dict); + size_t n_vars = dict_get_n_vars (dict); struct case_map_stage *stage; size_t i; @@ -305,7 +305,7 @@ struct case_map * case_map_stage_get_case_map (const struct case_map_stage *stage) { struct case_map *map; - size_t n_vars = dict_get_var_cnt (stage->dict); + size_t n_vars = dict_get_n_vars (stage->dict); size_t n_values; size_t i; bool identity_map = true; @@ -343,12 +343,9 @@ struct case_map * case_map_by_name (const struct dictionary *old, const struct dictionary *new) { - struct case_map *map; - size_t var_cnt = dict_get_var_cnt (new); - size_t i; - - map = create_case_map (dict_get_proto (new)); - for (i = 0; i < var_cnt; i++) + size_t n_vars = dict_get_n_vars (new); + struct case_map *map = create_case_map (dict_get_proto (new)); + for (size_t i = 0; i < n_vars; i++) { struct variable *nv = dict_get_var (new, i); struct variable *ov = dict_lookup_var_assert (old, var_get_name (nv)); @@ -364,6 +361,6 @@ void case_map_dump (const struct case_map *cm) { int i; - for (i = 0 ; i < caseproto_get_n_widths (cm->proto); ++i ) + for (i = 0 ; i < caseproto_get_n_widths (cm->proto); ++i) printf ("%d -> %d\n", i, cm->map[i]); }