Avoid forcing an int into a void *
[pspp-builds.git] / src / language / stats / t-test.q
index 116f04b40403cd27dc09afd201cba76781181c22..3d27874362050247f3ab55f534312d4bdfc217ee 100644 (file)
@@ -80,8 +80,8 @@ struct group_properties
   /* The comparison criterion */
   enum comparison criterion;
 
-  /* The width of the independent variable */
-  int indep_width ;
+  /* The independent variable */
+  struct variable *indep_var;
 
   union {
     /* The value of the independent variable at which groups are determined to
@@ -1676,7 +1676,7 @@ group_precalc (struct cmd_t_test *cmd )
       /* There's always 2 groups for a T - TEST */
       ttpr->n_groups = 2;
 
-      gp.indep_width = var_get_width (indep_var);
+      gp.indep_var = indep_var;
 
       ttpr->group_hash = hsh_create (2,
                                    (hsh_compare_func *) compare_group_binary,
@@ -1888,10 +1888,6 @@ compare_group_binary (const struct group_statistics *a,
 
   if ( p->criterion == CMP_LE )
     {
-      /* less-than comparision is not meaningfull for
-        alpha variables, so we shouldn't ever arrive here */
-      assert (p->indep_width == 0 ) ;
-
       flag_a = ( a->id.f < p->v.critical_value ) ;
       flag_b = ( b->id.f < p->v.critical_value ) ;
     }
@@ -1918,8 +1914,6 @@ hash_group_binary (const struct group_statistics *g,
 
   if ( p->criterion == CMP_LE )
     {
-      /* Not meaningfull to do a less than compare for alpha values ? */
-      assert (p->indep_width == 0 ) ;
       flag = ( g->id.f < p->v.critical_value ) ;
     }
   else if ( p->criterion == CMP_EQ)
@@ -1939,10 +1933,10 @@ short
 which_group (const struct group_statistics *g,
            const struct group_properties *p)
 {
-  if ( 0 == compare_values (&g->id, &p->v.g_value[0], p->indep_width))
+  if ( 0 == compare_values (&g->id, &p->v.g_value[0], p->indep_var))
     return 0;
 
-  if ( 0 == compare_values (&g->id, &p->v.g_value[1], p->indep_width))
+  if ( 0 == compare_values (&g->id, &p->v.g_value[1], p->indep_var))
     return 1;
 
   return 2;