projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor
[pspp]
/
src
/
language
/
stats
/
autorecode.c
diff --git
a/src/language/stats/autorecode.c
b/src/language/stats/autorecode.c
index 1a74b1e4a9e4e3365e5fc77ca0fcbeb05147a654..499f149d22a14c4003f2d2ae1a9a42d368202798 100644
(file)
--- a/
src/language/stats/autorecode.c
+++ b/
src/language/stats/autorecode.c
@@
-96,8
+96,7
@@
struct autorecode_pgm
bool blank_valid;
};
bool blank_valid;
};
-static trns_proc_func autorecode_trns_proc;
-static trns_free_func autorecode_trns_free;
+static const struct trns_class autorecode_trns_class;
static int compare_arc_items (const void *, const void *, const void *aux);
static void arc_free (struct autorecode_pgm *);
static int compare_arc_items (const void *, const void *, const void *aux);
static void arc_free (struct autorecode_pgm *);
@@
-312,8
+311,8
@@
cmd_autorecode (struct lexer *lexer, struct dataset *ds)
struct arc_item *item = xmalloc (sizeof *item);
item->width = width;
value_clone (&item->from, value, width);
struct arc_item *item = xmalloc (sizeof *item);
item->width = width;
value_clone (&item->from, value, width);
- item->missing = mv_is_value_missing_varwidth (&spec->mv, value,
spec->width,
-
MV_ANY
);
+ item->missing = mv_is_value_missing_varwidth (&spec->mv, value,
+
spec->width
);
item->value_label = ds_steal_cstr (&value_label);
hmap_insert (&spec->items->ht, &item->hmap_node, hash);
item->value_label = ds_steal_cstr (&value_label);
hmap_insert (&spec->items->ht, &item->hmap_node, hash);
@@
-450,7
+449,7
@@
cmd_autorecode (struct lexer *lexer, struct dataset *ds)
/* Free array. */
free (items);
}
/* Free array. */
free (items);
}
- add_transformation (ds,
autorecode_trns_proc, autorecode_trns_free
, arc);
+ add_transformation (ds,
&autorecode_trns_class
, arc);
for (size_t i = 0; i < n_dsts; i++)
free (dst_names[i]);
for (size_t i = 0; i < n_dsts; i++)
free (dst_names[i]);
@@
-553,7
+552,7
@@
compare_arc_items (const void *a_, const void *b_, const void *direction_)
return direction == ASCENDING ? cmp : -cmp;
}
return direction == ASCENDING ? cmp : -cmp;
}
-static
in
t
+static
enum trns_resul
t
autorecode_trns_proc (void *arc_, struct ccase **c,
casenumber case_idx UNUSED)
{
autorecode_trns_proc (void *arc_, struct ccase **c,
casenumber case_idx UNUSED)
{
@@
-582,3
+581,9
@@
autorecode_trns_free (void *arc_)
arc_free (arc);
return true;
}
arc_free (arc);
return true;
}
+
+static const struct trns_class autorecode_trns_class = {
+ .name = "AUTORECODE",
+ .execute = autorecode_trns_proc,
+ .destroy = autorecode_trns_free,
+};