X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fdictionary.c;h=e9a5a01450363bbdc8055abf7a760731de12facf;hb=ea37b218562bd9c02c23d2669c70b2509e0588ea;hp=161071ec159a038555da3467ef8586a07a143fa3;hpb=698e31dd616553a663d0b04f24d322ac47315534;p=pspp diff --git a/src/data/dictionary.c b/src/data/dictionary.c index 161071ec15..e9a5a01450 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -59,9 +59,6 @@ struct dictionary size_t vector_cnt; /* Number of vectors. */ }; -/* Active file dictionary. */ -struct dictionary *default_dict; - /* Creates and returns a new dictionary. */ struct dictionary * dict_create (void) @@ -270,7 +267,7 @@ dict_create_var (struct dictionary *d, const char *name, int width) assert (d != NULL); assert (name != NULL); - assert (width >= 0 && width < 256); + assert (width >= 0 && width <= MAX_STRING); assert (var_is_plausible_name(name,0)); @@ -284,7 +281,7 @@ dict_create_var (struct dictionary *d, const char *name, int width) v->type = width == 0 ? NUMERIC : ALPHA; v->width = width; v->fv = d->next_value_idx; - v->nv = width == 0 ? 1 : DIV_RND_UP (width, 8); + v->nv = width_to_bytes(width) / MAX_SHORT_STRING ; v->leave = dict_class_from_id (v->name) == DC_SCRATCH; v->index = d->var_cnt; mv_init (&v->miss, width);