DATA LIST FREE: Warn when a quoted string is not followed by a delimiter.
[pspp] / src / language / stats / examine.c
index 3288f5bd119f7441acefda3a5fc2c1e0be83d953..5d308f11abe15d287bb2507318fadd41faaaf766 100644 (file)
@@ -1461,25 +1461,6 @@ summary_report (const struct examine *cmd, int iact_idx)
   tab_submit (t);
 }
 
-
-/* Match a variable.
-   If the match succeeds, the variable will be placed in VAR.
-   Returns true if successful */
-static bool
-lex_match_variable (struct lexer *lexer, 
-                    const struct dictionary *dict, const struct variable **var)
-{
-  if (lex_token (lexer) !=  T_ID)
-
-    return false;
-
-  *var = parse_variable_const  (lexer, dict);
-
-  if ( *var == NULL)
-    return false;
-  return true;
-}
-
 /* Attempt to parse an interaction from LEXER */
 static struct interaction *
 parse_interaction (struct lexer *lexer, struct examine *ex)
@@ -1596,7 +1577,6 @@ calculate_n (const void *aux1, void *aux2 UNUSED, void *user_data)
       double imax = es[v].cc;
       struct casereader *reader;
       struct ccase *c;
-      casenumber total_cases;
 
       if (examine->histogram)
         {
@@ -1610,7 +1590,6 @@ calculate_n (const void *aux1, void *aux2 UNUSED, void *user_data)
         }
 
       es[v].sorted_reader = casewriter_make_reader (es[v].sorted_writer);
-      total_cases = casereader_count_cases (es[v].sorted_reader);
       es[v].sorted_writer = NULL;
 
       es[v].maxima = pool_calloc (examine->pool, examine->calc_extremes, sizeof (*es[v].maxima));
@@ -1803,7 +1782,8 @@ run_examine (struct examine *cmd, struct casereader *input)
   struct payload payload;
   payload.create = create_n;
   payload.update = update_n;
-  payload.destroy = calculate_n;
+  payload.calculate = calculate_n;
+  payload.destroy = NULL;
   
   cmd->wv = dict_get_weight (cmd->dict);
 
@@ -2236,6 +2216,7 @@ cmd_examine (struct lexer *lexer, struct dataset *ds)
     {
       examine.n_iacts--;
       examine.iacts = &iacts_mem[1];
+      interaction_destroy (iacts_mem[0]);
     }
 
 
@@ -2291,9 +2272,6 @@ cmd_examine (struct lexer *lexer, struct dataset *ds)
 
   caseproto_unref (examine.ex_proto);
 
-  for (i = 0; i < examine.n_iacts; ++i)
-    interaction_destroy (examine.iacts[i]);
-
   free (examine.ptiles);
   free (examine.dep_vars);
   pool_destroy (examine.pool);