/* Have we seen these subcommands? */
unsigned seen = 0;
- agr.writer = NULL;
- agr.sink = NULL;
+ memset(&agr, 0 , sizeof (agr));
agr.missing = ITEMWISE;
- agr.sort = NULL;
- agr.break_vars = NULL;
- agr.agr_vars = NULL;
- agr.dict = NULL;
- agr.case_cnt = 0;
- agr.prev_break = NULL;
agr.dict = dict_create ();
dict_set_label (agr.dict, dict_get_label (default_dict));
lex_error (_("expecting `('"));
goto error;
}
- } else {
+ }
+ else
+ {
/* Parse list of source variables. */
{
int pv_opts = PV_NO_SCRATCH;
if (src)
{
- int output_width;
-
v->src = src[i];
if (src[i]->type == ALPHA)
v->function |= FSTRING;
v->string = xmalloc (src[i]->width);
}
-
- if (v->src->type == NUMERIC || function->alpha_type == NUMERIC)
- output_width = 0;
- else
- output_width = v->src->width;
if (function->alpha_type == ALPHA)
destvar = dict_clone_var (agr->dict, v->src, dest[i]);
- else
- {
- destvar = dict_create_var (agr->dict, dest[i], output_width);
- if (output_width == 0)
- destvar->print = destvar->write = function->format;
- if (output_width == 0 && dict_get_weight (default_dict) != NULL
- && (func_index == N || func_index == N_NO_VARS
- || func_index == NU || func_index == NU_NO_VARS))
- {
- struct fmt_spec f = {FMT_F, 8, 2};
-
- destvar->print = destvar->write = f;
- }
- }
+ else if (v->src->type == NUMERIC
+ || function->alpha_type == NUMERIC)
+ {
+ destvar = dict_create_var (agr->dict, dest[i], 0);
+
+ if ((func_index == N
+ || func_index == N_NO_VARS
+ || func_index == NMISS)
+ && dict_get_weight (default_dict) != NULL)
+ {
+ static const struct fmt_spec f8_2 = {FMT_F, 8, 2};
+
+ destvar->print = destvar->write = f8_2;
+ }
+ else
+ destvar->print = destvar->write = function->format;
+ }
+ else
+ destvar = dict_create_var (agr->dict, dest[i],
+ v->src->width);
} else {
v->src = NULL;
destvar = dict_create_var (agr->dict, dest[i], 0);
destvar->label = dest_label[i];
dest_label[i] = NULL;
}
- else if (function->alpha_type == ALPHA)
- destvar->print = destvar->write = function->format;
v->dest = destvar;
}
}
if (agr->dict != NULL)
dict_destroy (agr->dict);
+
case_destroy (&agr->agr_case);
}
\f