X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fdescriptives.c;h=e26eadf93e064f5b48a3654ab95b24a9552bf617;hb=46a7a7b189e2df740043496c16d9f7c665b7a828;hp=70751495024e6f9767943a25d8349449ee981273;hpb=c3bd77adba5746aae895e6a354aada4e694c0e3f;p=pspp diff --git a/src/language/stats/descriptives.c b/src/language/stats/descriptives.c index 7075149502..e26eadf93e 100644 --- a/src/language/stats/descriptives.c +++ b/src/language/stats/descriptives.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -39,6 +38,8 @@ #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) #define N_(msgid) msgid @@ -122,7 +123,7 @@ static const struct dsc_statistic_info dsc_info[DSC_N_STATS] = struct dsc_var { const struct variable *v; /* Variable to calculate on. */ - char z_name[LONG_NAME_LEN + 1]; /* Name for z-score variable. */ + char z_name[VAR_NAME_LEN + 1]; /* Name for z-score variable. */ double valid, missing; /* Valid, missing counts. */ struct moments *moments; /* Moments. */ double min, max; /* Maximum and mimimum values. */ @@ -494,7 +495,7 @@ static bool generate_z_varname (const struct dictionary *dict, struct dsc_proc *dsc, char *z_name, const char *var_name, int *z_cnt) { - char name[LONG_NAME_LEN + 1]; + char name[VAR_NAME_LEN + 1]; /* Try a name based on the original variable name. */ name[0] = 'Z'; @@ -905,9 +906,10 @@ display (struct dsc_proc *dsc) tab_text (t, nc++, i + 1, TAT_PRINTF, "%g", dv->valid); if (dsc->format == DSC_SERIAL) tab_text (t, nc++, i + 1, TAT_PRINTF, "%g", dv->missing); + for (j = 0; j < DSC_N_STATS; j++) if (dsc->show_stats & (1ul << j)) - tab_float (t, nc++, i + 1, TAB_NONE, dv->stats[j], 10, 3); + tab_double (t, nc++, i + 1, TAB_NONE, dv->stats[j], NULL); } tab_title (t, _("Valid cases = %g; cases with missing value(s) = %g."),