X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmis-val.c;h=ce32625532c00d69b541472270d8b2fa021850a9;hb=d8528fd919d1cebe194121ba267faa0f4ee48c94;hp=23d803fcf05e884ed33286d534625eb22caf9718;hpb=fcb9e49b2a2d57af7c001ae5d2eda9ac443ba36b;p=pspp diff --git a/src/mis-val.c b/src/mis-val.c index 23d803fcf0..ce32625532 100644 --- a/src/mis-val.c +++ b/src/mis-val.c @@ -18,7 +18,7 @@ 02111-1307, USA. */ #include -#include +#include "error.h" #include #include "command.h" #include "error.h" @@ -29,10 +29,6 @@ #include "debug-print.h" -#if DEBUGGING -static void debug_print (); -#endif - /* Variables on MIS VAL. */ static struct variable **v; static int nv; @@ -56,8 +52,6 @@ cmd_missing_values (void) { int i; - lex_match_id ("MISSING"); - lex_match_id ("VALUES"); while (token != '.') { if (!parse_varnames ()) @@ -88,10 +82,6 @@ cmd_missing_values (void) free (v); } -#if 0 && DEBUGGING - debug_print (); -#endif - return lex_end_of_command (); fail: @@ -104,7 +94,7 @@ parse_varnames (void) { int i; - if (!parse_variables (NULL, &v, &nv, PV_SAME_TYPE)) + if (!parse_variables (default_dict, &v, &nv, PV_SAME_TYPE)) return 0; if (!lex_match ('(')) { @@ -317,7 +307,7 @@ parse_alpha (void) msg (SE, _("String is not of proper length.")); return 0; } - strncpy (missing[miss_type].s, ds_value (&tokstr), MAX_SHORT_STRING); + strncpy (missing[miss_type].s, ds_c_str (&tokstr), MAX_SHORT_STRING); lex_get (); lex_match (','); } @@ -353,51 +343,3 @@ copy_missing_values (struct variable *dest, const struct variable *src) memcpy (dest->missing[i].s, src->missing[i].s, src->width); } } - - -/* Debug output. */ - -#if 0 && DEBUGGING -static void -debug_print (void) -{ - int i, j; - - puts (_("Missing value:")); - for (i = 0; i < nvar; i++) - { - printf (" %8s: ", var[i]->name); - if (var[i]->type == ALPHA && var[i]->nv > 1) - puts (_("(long string variable)")); - else - switch (var[i]->miss_type) - { - case MISSING_NONE: - printf (_("(no missing values)\n")); - break; - case MISSING_1: - case MISSING_2: - case MISSING_3: - printf ("(MISSING_%d)", var[i]->miss_type); - for (j = 0; j < var[i]->miss_type; j++) - if (var[i]->type == ALPHA) - printf (" \"%.*s\"", var[i]->width, var[i]->missing[j].s); - else - printf (" %.2g", var[i]->missing[j].f); - printf ("\n"); - break; - case MISSING_RANGE: - printf ("(MISSING_RANGE) %.2g THRU %.2g\n", - var[i]->missing[0].f, var[i]->missing[1].f); - break; - case MISSING_RANGE_1: - printf ("(MISSING_RANGE_1) %.2g THRU %.2g, %.2g\n", - var[i]->missing[0].f, var[i]->missing[1].f, - var[i]->missing[2].f); - break; - default: - printf (_("(!!!INTERNAL ERROR--%d!!!)\n"), var[i]->miss_type); - } - } -} -#endif /* DEBUGGING */