docuemntation and refacotring
[pspp] / src / language / stats / ctables.c
index 7e899d1b668a640355ead9e7ccf83fd8c340490f..e38c64d30e9c3fa88bbac7908e64279931bf7bf9 100644 (file)
@@ -2535,8 +2535,6 @@ union ctables_summary
         double ovalid;
         double ovalue;
       };
-
-    /* XXX multiple response */
   };
 
 static void
@@ -3226,8 +3224,6 @@ ctables_cell_insert__ (struct ctables_section *s, const struct ccase *c,
                   || cat->type == CCT_SUBTOTAL
                   || cat->type == CCT_POSTCOMPUTE)
                 {
-                  /* XXX these should be more encompassing I think.*/
-
                   switch (a)
                     {
                     case PIVOT_AXIS_COLUMN:
@@ -3341,18 +3337,15 @@ ctables_cell_add__ (struct ctables_section *s, const struct ccase *c,
           {
             add_weight (a->valid, weight);
 
-            for (size_t i = 0; i < s->table->n_sum_vars; i++)
-              {
-                /* XXX listwise_missing??? */
-                const struct variable *var = s->table->sum_vars[i];
-                double addend = case_num (c, var);
-                if (!var_is_num_missing (var, addend))
-                  {
-                    struct ctables_sum *sum = &a->sums[i];
+            if (!scale_missing)
+              for (size_t i = 0; i < s->table->n_sum_vars; i++)
+                {
+                  const struct variable *var = s->table->sum_vars[i];
+                  double addend = case_num (c, var);
+                  if (!var_is_num_missing (var, addend))
                     for (enum ctables_weighting wt = 0; wt < N_CTWS; wt++)
-                      sum->sum[wt] += addend * weight[wt];
-                  }
-              }
+                      a->sums[i].sum[wt] += addend * weight[wt];
+                }
           }
       }
 }