X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fautorecode.c;h=0b6857ddefbced95684e0e57e983c976956124d8;hb=e23e34e76e7e63fdfddf8a7dd22b963cd9e48cc1;hp=9a9b3a0728f0ecc19bbce3b9b16bfc460831cc43;hpb=205ac3afa4c2b19c85819d8695abf3975bb11807;p=pspp-builds.git diff --git a/src/autorecode.c b/src/autorecode.c index 9a9b3a07..0b6857dd 100644 --- a/src/autorecode.c +++ b/src/autorecode.c @@ -14,14 +14,16 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ #include #include "error.h" #include #include "alloc.h" +#include "case.h" #include "command.h" +#include "dictionary.h" #include "error.h" #include "hash.h" #include "lexer.h" @@ -149,7 +151,7 @@ cmd_autorecode (void) goto lossage; } for (j = 0; j < i; j++) - if (!strcmp (arc.dst_names[i], arc.dst_names[j])) + if (!strcasecmp (arc.dst_names[i], arc.dst_names[j])) { msg (SE, _("Duplicate variable name %s among target variables."), arc.dst_names[i]); @@ -262,7 +264,7 @@ recode (const struct autorecode_pgm *arc) 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; @@ -271,17 +273,15 @@ autorecode_trns_proc (struct trns_header * trns, struct ccase * c, { struct arc_spec *spec = &t->specs[i]; struct arc_item *item; + union value v; 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 - { - 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; + case_data_rw (c, spec->dest->fv)->f = item->to; } return -1; } @@ -346,9 +346,9 @@ autorecode_proc_func (struct ccase *c, void *arc_) union value v, *vp, **vpp; if (arc->src_vars[i]->type == NUMERIC) - v.f = c->data[arc->src_vars[i]->fv].f; + v.f = case_num (c, arc->src_vars[i]->fv); 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)