projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix memory leaks.
[pspp-builds.git]
/
src
/
autorecode.c
diff --git
a/src/autorecode.c
b/src/autorecode.c
index 9a9b3a0728f0ecc19bbce3b9b16bfc460831cc43..5bf12bc0a58f70248541f66d026bc33c2a709da1 100644
(file)
--- a/
src/autorecode.c
+++ b/
src/autorecode.c
@@
-21,6
+21,7
@@
#include "error.h"
#include <stdlib.h>
#include "alloc.h"
#include "error.h"
#include <stdlib.h>
#include "alloc.h"
+#include "case.h"
#include "command.h"
#include "error.h"
#include "hash.h"
#include "command.h"
#include "error.h"
#include "hash.h"
@@
-262,7
+263,7
@@
recode (const struct autorecode_pgm *arc)
static int
autorecode_trns_proc (struct trns_header * trns, struct ccase * c,
static int
autorecode_trns_proc (struct trns_header * trns, struct ccase * c,
- int case_
num
UNUSED)
+ int case_
idx
UNUSED)
{
struct autorecode_trns *t = (struct autorecode_trns *) trns;
int i;
{
struct autorecode_trns *t = (struct autorecode_trns *) trns;
int i;
@@
-271,17
+272,15
@@
autorecode_trns_proc (struct trns_header * trns, struct ccase * c,
{
struct arc_spec *spec = &t->specs[i];
struct arc_item *item;
{
struct arc_spec *spec = &t->specs[i];
struct arc_item *item;
+ union value v;
if (spec->src->type == NUMERIC)
if (spec->src->type == NUMERIC)
-
item = hsh_force_find (spec->items, &c->data[spec->src->fv].f
);
+
v.f = case_num (c, spec->src->fv
);
else
else
- {
- union value v;
- v.c = c->data[spec->src->fv].s;
- item = hsh_force_find (spec->items, &v);
- }
+ v.c = (char *) case_str (c, spec->src->fv);
+ item = hsh_force_find (spec->items, &v);
- c
->data[spec->dest->fv].
f = item->to;
+ c
ase_data_rw (c, spec->dest->fv)->
f = item->to;
}
return -1;
}
}
return -1;
}
@@
-346,9
+345,9
@@
autorecode_proc_func (struct ccase *c, void *arc_)
union value v, *vp, **vpp;
if (arc->src_vars[i]->type == NUMERIC)
union value v, *vp, **vpp;
if (arc->src_vars[i]->type == NUMERIC)
- v.f = c
->data[arc->src_vars[i]->fv].f
;
+ v.f = c
ase_num (c, arc->src_vars[i]->fv)
;
else
else
- v.c =
c->data[arc->src_vars[i]->fv].s
;
+ v.c =
(char *) case_str (c, arc->src_vars[i]->fv)
;
vpp = (union value **) hsh_probe (arc->src_values[i], &v);
if (*vpp == NULL)
vpp = (union value **) hsh_probe (arc->src_values[i], &v);
if (*vpp == NULL)