X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fdictionary.c;h=16809032c23e1a3d386764214d7038793e3c3e66;hb=37736728bbb526a27145a757836bd8b64e8adf6f;hp=f74ae00761dca42549cdb242865364a73c10a403;hpb=c489ad9041918ca8c80dadceade988daab1d25f8;p=pspp diff --git a/src/data/dictionary.c b/src/data/dictionary.c index f74ae00761..16809032c2 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -281,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_to_bytes(width) / MAX_SHORT_STRING ; + v->nv = width == 0 ? 1 : DIV_RND_UP (width, MAX_SHORT_STRING); v->leave = dict_class_from_id (v->name) == DC_SCRATCH; v->index = d->var_cnt; mv_init (&v->miss, width); @@ -869,7 +869,7 @@ dict_compacting_would_shrink (const struct dictionary *d) return dict_get_compacted_value_cnt (d) < dict_get_next_value_idx (d); } -/* Returns true if a case for dictionary D would be smaller after +/* Returns true if a case for dictionary D would change after compacting, false otherwise. Compacting a case eliminates "holes" between values and after the last value. Holes are created by deleting variables (or by scratch variables).