[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] Changes to pspp/src/count.c
From: |
Ben Pfaff |
Subject: |
[Pspp-cvs] Changes to pspp/src/count.c |
Date: |
Thu, 03 Nov 2005 01:21:50 -0500 |
Index: pspp/src/count.c
diff -u pspp/src/count.c:1.23 pspp/src/count.c:1.24
--- pspp/src/count.c:1.23 Sat Oct 29 23:35:55 2005
+++ pspp/src/count.c Thu Nov 3 06:21:46 2005
@@ -80,19 +80,16 @@
struct count_trns
{
- struct trns_header h;
struct dst_var *dst_vars;
struct pool *pool;
};
-
-/* Parser. */
static trns_proc_func count_trns_proc;
static trns_free_func count_trns_free;
static bool parse_numeric_criteria (struct pool *, struct criteria *);
static bool parse_string_criteria (struct pool *, struct criteria *);
-
+
int
cmd_count (void)
{
@@ -100,10 +97,7 @@
struct count_trns *trns; /* Transformation. */
/* Parses each slash-delimited specification. */
- trns = xmalloc (sizeof *trns);
- trns->h.proc = count_trns_proc;
- trns->h.free = count_trns_free;
- trns->pool = pool_create ();
+ trns = pool_create_container (struct count_trns, pool);
trns->dst_vars = dv = pool_alloc (trns->pool, sizeof *dv);
for (;;)
{
@@ -182,11 +176,11 @@
dv->var = dict_create_var_assert (default_dict, dv->name, 0);
}
- add_transformation (&trns->h);
+ add_transformation (count_trns_proc, count_trns_free, trns);
return CMD_SUCCESS;
fail:
- count_trns_free (&trns->h);
+ count_trns_free (trns);
return CMD_FAILURE;
}
@@ -324,10 +318,10 @@
/* Performs the COUNT transformation T on case C. */
static int
-count_trns_proc (struct trns_header *trns_, struct ccase *c,
+count_trns_proc (void *trns_, struct ccase *c,
int case_num UNUSED)
{
- struct count_trns *trns = (struct count_trns *) trns_;
+ struct count_trns *trns = trns_;
struct dst_var *dv;
for (dv = trns->dst_vars; dv; dv = dv->next)
@@ -348,7 +342,7 @@
/* Destroys all dynamic data structures associated with TRNS. */
static void
-count_trns_free (struct trns_header *trns_)
+count_trns_free (void *trns_)
{
struct count_trns *trns = (struct count_trns *) trns_;
pool_destroy (trns->pool);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pspp-cvs] Changes to pspp/src/count.c,
Ben Pfaff <=