Fri Dec 19 23:35:04 2003 Ben Pfaff <blp@gnu.org>
[pspp] / src / vfm.c
index 331f287f8c4d1de47283e8da46d909ee62d83c4f..3fdefb5db2940dd609ab813133d95207d0a8263f 100644 (file)
--- a/src/vfm.c
+++ b/src/vfm.c
@@ -54,6 +54,7 @@ char *alloca ();
 #include "tab.h"
 #include "var.h"
 #include "vector.h"
+#include "value-labels.h"
 #include "vfm.h"
 #include "vfmP.h"
 
@@ -65,8 +66,6 @@ char *alloca ();
    (the data sink).  The data source is then deleted and the data sink
    becomes the data source for the next procedure. */
 
-#undef DEBUGGING
-/*#define DEBUGGING 1 */
 #include "debug-print.h"
 
 /* This is used to read from the active file. */
@@ -370,7 +369,7 @@ index_to_varname (int ccase_index)
 
   for (i = 0; i < default_dict.nvar; i++)
     {
-      variable *v = default_dict.var[i];
+      struct variable *v = default_dict.var[i];
       
       if (ccase_index >= v->fv && ccase_index < v->fv + v->nv)
        return default_dict.var[i]->name;
@@ -516,7 +515,6 @@ open_active_file (void)
   arrange_compaction ();
   make_temp_case ();
   vector_initialization ();
-  setup_randomize ();
   discard_ctl_stack ();
   setup_filter ();
   setup_lag ();
@@ -944,7 +942,6 @@ struct case_stream vfm_memory_stream =
     "memory",
   };
 \f
-#undef DEBUGGING
 #include "debug-print.h"
 
 /* Add temp_case to the lag queue. */
@@ -1120,7 +1117,7 @@ dump_splits (struct ccase *c)
     {
       struct variable *v = *iter;
       char temp_buf[80];
-      char *val_lab;
+      const char *val_lab;
 
       assert (v->type == NUMERIC || v->type == ALPHA);
       tab_text (t, 0, i + 1, TAB_LEFT | TAT_PRINTF, "%s", v->name);
@@ -1135,7 +1132,7 @@ dump_splits (struct ccase *c)
       temp_buf[v->print.w] = 0;
       tab_text (t, 1, i + 1, TAT_PRINTF, "%.*s", v->print.w, temp_buf);
 
-      val_lab = get_val_lab (v, c->data[v->fv], 0);
+      val_lab = val_labs_find (v->val_labs, c->data[v->fv]);
       if (val_lab)
        tab_text (t, 2, i + 1, TAB_LEFT, val_lab);
     }