struct dataset *
dataset_create (struct session *session, const char *name)
{
- struct dataset *ds;
-
- ds = xzalloc (sizeof *ds);
+ struct dataset *ds = XZALLOC (struct dataset);
ds->name = xstrdup (name);
ds->display = DATASET_FRONT;
ds->dict = dict_create (get_default_encoding ());
dataset_set_session (ds, NULL);
dataset_clear (ds);
dict_unref (ds->dict);
+ dict_unref (ds->permanent_dict);
caseinit_destroy (ds->caseinit);
trns_chain_destroy (ds->permanent_trns_chain);
dataset_transformations_changed__ (ds, false);
dataset_clear (ds);
dict_unref (ds->dict);
- ds->dict = dict_ref (dict);
+ ds->dict = dict;
dict_set_change_callback (ds->dict, dict_callback, ds);
}
if (!ds->discard_output)
{
struct dictionary *pd = ds->permanent_dict;
- size_t compacted_value_cnt = dict_count_values (pd, 1u << DC_SCRATCH);
- if (compacted_value_cnt < dict_get_next_value_idx (pd))
+ size_t compacted_n_values = dict_count_values (pd, 1u << DC_SCRATCH);
+ if (compacted_n_values < dict_get_next_value_idx (pd))
{
struct caseproto *compacted_proto;
compacted_proto = dict_get_compacted_proto (pd, 1u << DC_SCRATCH);
struct variable *var = var_;
*cc = case_unshare (*cc);
- case_data_rw (*cc, var)->f = case_num;
+ *case_num_rw (*cc, var) = case_num;
return TRNS_CONTINUE;
}