projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implemented support for very long strings a la spss v13/v14
[pspp-builds.git]
/
src
/
data
/
dictionary.c
diff --git
a/src/data/dictionary.c
b/src/data/dictionary.c
index 161071ec159a038555da3467ef8586a07a143fa3..c8840f302beebc06d8ccc0ec8abc37aeb502550e 100644
(file)
--- a/
src/data/dictionary.c
+++ b/
src/data/dictionary.c
@@
-270,7
+270,7
@@
dict_create_var (struct dictionary *d, const char *name, int width)
assert (d != NULL);
assert (name != NULL);
assert (d != NULL);
assert (name != NULL);
- assert (width >= 0 && width <
256
);
+ assert (width >= 0 && width <
= MAX_STRING
);
assert (var_is_plausible_name(name,0));
assert (var_is_plausible_name(name,0));
@@
-284,7
+284,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->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);
v->leave = dict_class_from_id (v->name) == DC_SCRATCH;
v->index = d->var_cnt;
mv_init (&v->miss, width);