Memory leak patrol.
[pspp-builds.git] / src / language / stats / t-test.q
index 5584df7d6031cf0eb3367f65f752001402ecb2cb..1f182ec8a1dedbc9d91e6a2638e63130485f46f0 100644 (file)
@@ -36,6 +36,7 @@
 #include <language/dictionary/split-file.h>
 #include <language/lexer/lexer.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <libpspp/hash.h>
 #include <libpspp/magic.h>
    "T-TEST" (tts_):
      +groups=custom;
      testval=double;
-     variables=varlist("PV_NO_SCRATCH | PV_NUMERIC");
-     pairs=custom;
-     +missing=miss:!analysis/listwise,
-             incl:include/!exclude;
-     format=fmt:!labels/nolabels;
+     +variables=varlist("PV_NO_SCRATCH | PV_NUMERIC");
+     +pairs=custom;
+     missing=miss:!analysis/listwise,
+            incl:include/!exclude;
+     +format=fmt:!labels/nolabels;
      criteria=:cin(d:criteria,"%s > 0. && %s < 1.").
 */
 /* (declarations) */
@@ -241,7 +242,7 @@ static  int mode;
 
 static struct cmd_t_test cmd;
 
-static int bad_weight_warn;
+static bool bad_weight_warn = false;
 
 
 static int compare_group_binary(const struct group_statistics *a, 
@@ -342,7 +343,7 @@ cmd_t_test(void)
   else
     value_is_missing = mv_is_value_missing;
 
-  bad_weight_warn = 1;
+  bad_weight_warn = true;
 
   ok = multipass_procedure_with_splits (calculate, &cmd);
 
@@ -623,7 +624,7 @@ ssbox_create(struct ssbox *ssb, struct cmd_t_test *cmd, int mode)
        ssbox_paired_init(ssb,cmd);
        break;
       default:
-       assert(0);
+       NOT_REACHED ();
       }
 }
 
@@ -937,7 +938,7 @@ trbox_create(struct trbox *trb,
        trbox_paired_init(trb,cmd);
        break;
       default:
-       assert(0);
+        NOT_REACHED ();
       }
 }
 
@@ -1415,7 +1416,7 @@ common_calc (const struct ccase *c, void *_cmd)
   int i;
   struct cmd_t_test *cmd = (struct cmd_t_test *)_cmd;  
 
-  double weight = dict_get_case_weight(default_dict,c,&bad_weight_warn);
+  double weight = dict_get_case_weight (default_dict, c, &bad_weight_warn);
 
 
   /* Skip the entire case if /MISSING=LISTWISE is set */
@@ -1515,7 +1516,7 @@ one_sample_calc (const struct ccase *c, void *cmd_)
   struct cmd_t_test *cmd = (struct cmd_t_test *)cmd_;
 
 
-  double weight = dict_get_case_weight(default_dict,c,&bad_weight_warn);
+  double weight = dict_get_case_weight (default_dict, c, &bad_weight_warn);
 
   /* Skip the entire case if /MISSING=LISTWISE is set */
   if ( cmd->miss == TTS_LISTWISE ) 
@@ -1605,7 +1606,7 @@ paired_calc (const struct ccase *c, void *cmd_)
 
   struct cmd_t_test *cmd  = (struct cmd_t_test *) cmd_;
 
-  double weight = dict_get_case_weight(default_dict,c,&bad_weight_warn);
+  double weight = dict_get_case_weight (default_dict, c, &bad_weight_warn);
 
   /* Skip the entire case if /MISSING=LISTWISE is set , 
    AND one member of a pair is missing */
@@ -1750,7 +1751,8 @@ group_calc (const struct ccase *c, struct cmd_t_test *cmd)
 
   const union value *gv = case_data (c, indep_var->fv);
 
-  const double weight = dict_get_case_weight(default_dict,c,&bad_weight_warn);
+  const double weight = 
+    dict_get_case_weight (default_dict, c, &bad_weight_warn);
 
   if ( value_is_missing(&indep_var->miss, gv) )
     {
@@ -1970,7 +1972,7 @@ hash_group_binary(const struct group_statistics *g,
       flag = which_group(g,p);
     }
   else
-    assert(0);
+    NOT_REACHED ();
 
   return flag;
 }