pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] Changes to pspp/src/formats.c


From: Ben Pfaff
Subject: [Pspp-cvs] Changes to pspp/src/formats.c
Date: Fri, 11 Mar 2005 20:08:34 -0500

Index: pspp/src/formats.c
diff -u pspp/src/formats.c:1.6 pspp/src/formats.c:1.7
--- pspp/src/formats.c:1.6      Tue Mar  1 08:16:15 2005
+++ pspp/src/formats.c  Sat Mar 12 01:08:33 2005
@@ -77,7 +77,7 @@
       if (token == '.')
        break;
 
-      if (!parse_variables (default_dict, &v, &cv, PV_SAME_TYPE))
+      if (!parse_variables (default_dict, &v, &cv, PV_NUMERIC))
        return CMD_PART_SUCCESS_MAYBE;
       type = v[0]->type;
 
@@ -86,31 +86,11 @@
          msg (SE, _("`(' expected after variable list"));
          goto fail;
        }
-      if (!parse_format_specifier (&f, 0) || !check_output_specifier (&f, 1))
+      if (!parse_format_specifier (&f, 0)
+          || !check_output_specifier (&f, true)
+          || !check_specifier_type (&f, NUMERIC, true))
        goto fail;
 
-      /* Catch type mismatch errors. */
-      if ((type == ALPHA) ^ (0 != (formats[f.type].cat & FCAT_STRING)))
-       {
-         msg (SE, _("Format %s may not be assigned to a %s variable."),
-              fmt_to_string (&f), type == NUMERIC ? _("numeric") : 
_("string"));
-         goto fail;
-       }
-
-      /* This is an additional check for string variables.  We can't
-         let the user specify an A8 format for a string variable with
-         width 4. */
-      if (type == ALPHA)
-       {
-         /* Shortest string so far. */
-         int min_len = INT_MAX;
-
-         for (i = 0; i < cv; i++)
-           min_len = min (min_len, v[i]->width);
-         if (!check_string_specifier (&f, min_len))
-           goto fail;
-       }
-
       if (!lex_match (')'))
        {
          msg (SE, _("`)' expected after output format."));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]