treewide: Replace <name>_cnt by n_<name>s and <name>_cap by allocated_<name>.
[pspp] / src / language / data-io / get.c
index 2440bd900b9d2ee01fcfac78342f70f88004c36b..e1bad76b93a10a108e75f8fd4f2b16d2d86cc952 100644 (file)
@@ -109,7 +109,7 @@ parse_read_command (struct lexer *lexer, struct dataset *ds,
          if (!lex_match_id (lexer, "COMM")
               && !lex_match_id (lexer, "TAPE"))
            {
-             lex_error_expecting (lexer, "COMM", "TAPE", NULL_SENTINEL);
+             lex_error_expecting (lexer, "COMM", "TAPE");
               goto error;
            }
        }
@@ -127,7 +127,7 @@ parse_read_command (struct lexer *lexer, struct dataset *ds,
   if (reader == NULL)
     goto error;
 
-  if (dict_get_var_cnt (dict) == 0)
+  if (dict_get_n_vars (dict) == 0)
     {
       msg (SE, _("%s: Data file dictionary has no variables."),
            fh_get_name (fh));
@@ -139,7 +139,7 @@ parse_read_command (struct lexer *lexer, struct dataset *ds,
   while (lex_token (lexer) != T_ENDCMD)
     {
       lex_match (lexer, T_SLASH);
-      if (!parse_dict_trim (lexer, dict))
+      if (!parse_dict_trim (lexer, dict, false))
         goto error;
     }
   dict_compact_values (dict);
@@ -161,7 +161,7 @@ parse_read_command (struct lexer *lexer, struct dataset *ds,
   fh_unref (fh);
   casereader_destroy (reader);
   if (dict != NULL)
-    dict_destroy (dict);
+    dict_unref (dict);
   free (encoding);
   return CMD_CASCADING_FAILURE;
 }