X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dict.c;h=8560c223f1236b0b7de9d4904b55c4e1b0358b3e;hb=2bdde1cd21cd58349cf4bd852fddf40524854288;hp=31761136f8654601906ccd050aec107e8f59280f;hpb=f514231dd2fc0c2adc1ebab5c46a4b55d2bd9c2b;p=pspp-builds.git diff --git a/src/ui/gui/psppire-dict.c b/src/ui/gui/psppire-dict.c index 31761136..8560c223 100644 --- a/src/ui/gui/psppire-dict.c +++ b/src/ui/gui/psppire-dict.c @@ -411,6 +411,17 @@ psppire_dict_get_var_cnt (const PsppireDict *d) } +/* Return the number of `union value's in the dictionary */ +size_t +psppire_dict_get_value_cnt (const PsppireDict *d) +{ + g_return_val_if_fail (d, -1); + g_return_val_if_fail (d->dict, -1); + + return dict_get_next_value_idx (d->dict); +} + + /* Return a variable by name. Return NULL if it doesn't exist */ @@ -781,17 +792,14 @@ psppire_dict_dump (const PsppireDict *dict) gint i; const struct dictionary *d = dict->dict; - int *map = dict_get_compacted_dict_index_to_case_index (d); - for (i = 0; i < dict_get_var_cnt (d); ++i) { const struct variable *v = psppire_dict_get_variable (dict, i); int di = var_get_dict_index (v); - g_print ("\"%s\" idx=%d, fv=%d(%d), size=%d\n", + g_print ("\"%s\" idx=%d, fv=%d, size=%d\n", var_get_name(v), di, var_get_case_index(v), - map[di], value_cnt_from_width(var_get_width(v))); }