Fix compiler warning
[pspp] / src / language / stats / median.c
index 9cba44dfd556bcd50db351cabb42db13be2a2dea..a27375a802a464597472521b64505fe0aaad3736 100644 (file)
@@ -118,7 +118,7 @@ median_execute (const struct dataset *ds,
   const bool n_sample_test = (value_compare_3way (&nst->val2, &nst->val1,
                                       var_get_width (nst->indep_var)) > 0);
 
-  struct results *results = xcalloc (nst->n_vars, sizeof (*results));
+  struct results *results = XCALLOC (nst->n_vars,  struct results);
   int n_vals = 0;
   for (v = 0; v < nst->n_vars; ++v)
     {
@@ -134,7 +134,7 @@ median_execute (const struct dataset *ds,
 
       if (n_sample_test == false)
        {
-         struct val_node *vn = xzalloc (sizeof *vn);
+         struct val_node *vn = XZALLOC (struct val_node);
          value_clone (&vn->val,  &nst->val1, var_get_width (nst->indep_var));
          hmap_insert (&map, &vn->node, value_hash (&nst->val1,
                                            var_get_width (nst->indep_var), 0));
@@ -253,7 +253,7 @@ median_execute (const struct dataset *ds,
          }
 
        results[v].n = count;
-       results[v].sorted_array = xcalloc (hmap_count (&map), sizeof (void*));
+       results[v].sorted_array = XCALLOC (hmap_count (&map), struct val_node *);
        results[v].var = var;
 
        HMAP_FOR_EACH (vn, struct val_node, node, &map)