Eliminate temp_case, and a few other cleanups.
[pspp] / src / count.c
index cf8d0676737710ce1eeb3bed34f876c0404b50e5..4cdf90ecbd083e85e88d8477240e70c68f409936 100644 (file)
@@ -21,7 +21,6 @@
 #include <assert.h>
 #include <stdlib.h>
 #include "alloc.h"
-#include "approx.h"
 #include "command.h"
 #include "error.h"
 #include "lexer.h"
@@ -129,8 +128,8 @@ static struct cnt_var_info *head;
 \f
 /* Parser. */
 
-static int count_trns_proc (struct trns_header *, struct ccase *);
-static void count_trns_free (struct trns_header *);
+static trns_proc_func count_trns_proc;
+static trns_free_func count_trns_free;
 
 static int parse_numeric_criteria (struct counting *);
 static int parse_string_criteria (struct counting *);
@@ -418,22 +417,22 @@ count_numeric (struct counting * cnt, struct ccase * c)
            assert (0);
            break;
          case CNT_SINGLE:
-           if (approx_ne (cmp, num->a))
+           if (cmp != num->a)
              break;
            counter++;
            goto done;
          case CNT_HIGH:
-           if (approx_lt (cmp, num->a))
+           if (cmp < num->a)
              break;
            counter++;
            goto done;
          case CNT_LOW:
-           if (approx_gt (cmp, num->a))
+           if (cmp > num->a)
              break;
            counter++;
            goto done;
          case CNT_RANGE:
-           if (approx_lt (cmp, num->a) || approx_gt (cmp, num->b))
+           if (cmp < num->a || cmp > num->b)
              break;
            counter++;
            goto done;
@@ -491,7 +490,8 @@ count_string (struct counting * cnt, struct ccase * c)
 
 /* Performs the COUNT transformation T on case C. */
 static int
-count_trns_proc (struct trns_header * trns, struct ccase * c)
+count_trns_proc (struct trns_header * trns, struct ccase * c,
+                 int case_num UNUSED)
 {
   struct cnt_var_info *info;
   struct counting *cnt;