Changed a lot of ints to bools.
[pspp-builds.git] / src / language / xforms / compute.c
index ae2ceaf50a51eaeb7eb05aaa397eb0fdd7df2b3d..f24ecac591cbb2340086963f961174852561708d 100644 (file)
    02110-1301, USA. */
 
 #include <config.h>
-#include <libpspp/message.h>
+
 #include <stdlib.h>
-#include <libpspp/alloc.h>
+
 #include <data/case.h>
-#include <language/command.h>
 #include <data/dictionary.h>
-#include <libpspp/message.h>
+#include <data/procedure.h>
+#include <data/transformations.h>
+#include <data/variable.h>
+#include <language/command.h>
 #include <language/expressions/public.h>
 #include <language/lexer/lexer.h>
+#include <libpspp/alloc.h>
+#include <libpspp/message.h>
+#include <libpspp/message.h>
 #include <libpspp/misc.h>
 #include <libpspp/str.h>
-#include <data/variable.h>
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
@@ -106,7 +110,7 @@ cmd_compute (void)
 
 /* Handle COMPUTE or IF with numeric target variable. */
 static int
-compute_num (void *compute_, struct ccase *c, int case_num)
+compute_num (void *compute_, struct ccase *c, casenum_t case_num)
 {
   struct compute_trns *compute = compute_;
 
@@ -121,7 +125,7 @@ compute_num (void *compute_, struct ccase *c, int case_num)
 /* Handle COMPUTE or IF with numeric vector element target
    variable. */
 static int
-compute_num_vec (void *compute_, struct ccase *c, int case_num)
+compute_num_vec (void *compute_, struct ccase *c, casenum_t case_num)
 {
   struct compute_trns *compute = compute_;
 
@@ -153,7 +157,7 @@ compute_num_vec (void *compute_, struct ccase *c, int case_num)
 
 /* Handle COMPUTE or IF with string target variable. */
 static int
-compute_str (void *compute_, struct ccase *c, int case_num)
+compute_str (void *compute_, struct ccase *c, casenum_t case_num)
 {
   struct compute_trns *compute = compute_;
 
@@ -168,7 +172,7 @@ compute_str (void *compute_, struct ccase *c, int case_num)
 /* Handle COMPUTE or IF with string vector element target
    variable. */
 static int
-compute_str_vec (void *compute_, struct ccase *c, int case_num)
+compute_str_vec (void *compute_, struct ccase *c, casenum_t case_num)
 {
   struct compute_trns *compute = compute_;
 
@@ -368,7 +372,7 @@ lvalue_get_type (const struct lvalue *lvalue)
     return lvalue->vector->var[0]->type;
 }
 
-/* Returns nonzero if LVALUE has a vector as its target. */
+/* Returns true if LVALUE has a vector as its target. */
 static bool
 lvalue_is_vector (const struct lvalue *lvalue) 
 {
@@ -392,7 +396,7 @@ lvalue_finalize (struct lvalue *lvalue, struct compute_trns *compute)
 
       /* Goofy behavior, but compatible: Turn off LEAVE. */
       if (dict_class_from_id (compute->variable->name) != DC_SCRATCH)
-        compute->variable->reinit = 1;
+        compute->variable->leave = false;
     }
   else 
     {