X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Fcategoricals.c;h=b57851d368ca3a91d47cd1f63943122df44836e7;hb=7b043a3bdd0a3f24e5836f25de51cd17ce6ff255;hp=033b6a18a07c8bdb705c0bfb3ec44f9270f80cb5;hpb=e0c2b55526074967dc11fd25183a464e4752e571;p=pspp-builds.git diff --git a/src/math/categoricals.c b/src/math/categoricals.c index 033b6a18..b57851d3 100644 --- a/src/math/categoricals.c +++ b/src/math/categoricals.c @@ -27,6 +27,7 @@ #include #include +#include struct value_node { @@ -104,16 +105,25 @@ categoricals_dump (const struct categoricals *cat) printf ("Reverse map\n"); for (x = 0 ; x < vp->n_cats; ++x) { + struct string s; const struct value_node *vn = vp->reverse_value_map[x]; - printf ("Value for %d is %s\n", x, value_str (&vn->value, width)); + ds_init_empty (&s); + var_append_value_name (cat->vars[v], &vn->value, &s); + printf ("Value for %d is %s\n", x, ds_cstr(&s)); + ds_destroy (&s); } printf ("\nForward map\n"); for (node = hmap_first (m); node; node = hmap_next (m, node)) { + struct string s; + ds_init_empty (&s); const struct value_node *vn = HMAP_DATA (node, struct value_node, node); + var_append_value_name (cat->vars[v], &vn->value, &s); printf ("Value: %s; Index %d; CC %g\n", - value_str (&vn->value, width), vn->subscript, vn->cc); + ds_cstr (&s), + vn->subscript, vn->cc); + ds_destroy (&s); } } }