From: Ben Pfaff Date: Wed, 26 Apr 2006 22:00:29 +0000 (+0000) Subject: Remove `init' member from struct variable, which was essentially X-Git-Tag: v0.6.0~941 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83141cdd4ab281da80d5dfeda05073f0cb354eab;p=pspp-builds.git Remove `init' member from struct variable, which was essentially unused. --- diff --git a/src/data/ChangeLog b/src/data/ChangeLog index 38510757..c7cd626e 100644 --- a/src/data/ChangeLog +++ b/src/data/ChangeLog @@ -1,3 +1,11 @@ +Wed Apr 26 14:55:19 2006 Ben Pfaff + + * variable.h: (struct variable) Remove `init' member and all + references to it from other files. It was initialized in several + places, but nothing really ever used it for anything worthwhile. + Thanks to Jason Stover for pointing out how confusing this + member is. + Sun Apr 23 22:04:45 2006 Ben Pfaff Continue reforming error message support. In this phase, get rid diff --git a/src/data/dictionary.c b/src/data/dictionary.c index d2d93c3b..b2fe10cf 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -282,7 +282,6 @@ dict_create_var (struct dictionary *d, const char *name, int width) v->width = width; v->fv = d->next_value_idx; v->nv = width == 0 ? 1 : DIV_RND_UP (width, 8); - v->init = 1; v->reinit = dict_class_from_id (v->name) != DC_SCRATCH; v->index = d->var_cnt; mv_init (&v->miss, width); @@ -359,7 +358,6 @@ dict_clone_var (struct dictionary *d, const struct variable *ov, short_name[] is intentionally not copied, because there is no reason to give a new variable with potentially a new name the same short name. */ - nv->init = 1; nv->reinit = ov->reinit; mv_copy (&nv->miss, &ov->miss); nv->print = ov->print; diff --git a/src/data/variable.h b/src/data/variable.h index 181d70c8..3a5015be 100644 --- a/src/data/variable.h +++ b/src/data/variable.h @@ -64,7 +64,6 @@ struct variable /* Case information. */ int fv, nv; /* Index into `value's, number of values. */ - bool init; /* True if needs init and possibly reinit. */ bool reinit; /* True: reinitialize; false: leave. */ /* Data for use by containing dictionary. */ diff --git a/src/language/data-io/data-list.c b/src/language/data-io/data-list.c index 3a6f807c..cf8cd6bd 100644 --- a/src/language/data-io/data-list.c +++ b/src/language/data-io/data-list.c @@ -545,8 +545,6 @@ fixed_parse_compatible (struct fixed_parsing_state *fx, { convert_fmt_ItoO (&input, &v->print); v->write = v->print; - if (!in_input_program () && !in_file_type ()) - v->init = 0; } else { @@ -653,9 +651,6 @@ dump_fmt_list (struct fixed_parsing_state *fx, struct fmt_list *f, return 0; } - if (!in_input_program () && !in_file_type ()) - v->init = 0; - spec = xmalloc (sizeof *spec); spec->v = v; spec->input = f->f; @@ -862,9 +857,6 @@ parse_free (struct dls_var_spec **first, struct dls_var_spec **last) } v->print = v->write = output; - if (!in_input_program () && !in_file_type ()) - v->init = 0; - spec = xmalloc (sizeof *spec); spec->input = input; spec->v = v; diff --git a/src/language/dictionary/numeric.c b/src/language/dictionary/numeric.c index 0cc3adb9..826f0ebf 100644 --- a/src/language/dictionary/numeric.c +++ b/src/language/dictionary/numeric.c @@ -196,7 +196,6 @@ cmd_leave (void) if (!v[i]->reinit) continue; v[i]->reinit = 0; - v[i]->init = 1; } free (v); diff --git a/src/language/stats/aggregate.c b/src/language/stats/aggregate.c index 4b8bf46b..f3929815 100644 --- a/src/language/stats/aggregate.c +++ b/src/language/stats/aggregate.c @@ -591,7 +591,6 @@ parse_aggregate_functions (struct agr_proc *agr) } free (dest[i]); - destvar->init = 0; if (dest_label[i]) { destvar->label = dest_label[i]; diff --git a/src/language/stats/autorecode.c b/src/language/stats/autorecode.c index 89ac44db..8b7d9aaa 100644 --- a/src/language/stats/autorecode.c +++ b/src/language/stats/autorecode.c @@ -178,11 +178,8 @@ cmd_autorecode (void) ok = procedure (autorecode_proc_func, &arc); for (i = 0; i < arc.var_cnt; i++) - { - arc.dst_vars[i] = dict_create_var_assert (default_dict, - arc.dst_names[i], 0); - arc.dst_vars[i]->init = 0; - } + arc.dst_vars[i] = dict_create_var_assert (default_dict, + arc.dst_names[i], 0); recode (&arc); arc_free (&arc); diff --git a/src/language/stats/descriptives.c b/src/language/stats/descriptives.c index 9a90cc9f..62c0ede0 100644 --- a/src/language/stats/descriptives.c +++ b/src/language/stats/descriptives.c @@ -661,7 +661,6 @@ setup_z_trns (struct dsc_proc *dsc) struct variable *dst_var; dst_var = dict_create_var_assert (default_dict, dv->z_name, 0); - dst_var->init = 0; if (dv->v->label) { dst_var->label = xmalloc (strlen (dv->v->label) + 12); diff --git a/src/procedure.c b/src/procedure.c index 422e7c05..69665c8b 100644 --- a/src/procedure.c +++ b/src/procedure.c @@ -421,7 +421,7 @@ clear_case (struct ccase *c) for (i = 0; i < var_cnt; i++) { struct variable *v = dict_get_var (default_dict, i); - if (v->init && v->reinit) + if (v->reinit) { if (v->type == NUMERIC) case_data_rw (c, v->fv)->f = SYSMIS;