int v;
struct casereader *r = casereader_clone (input);
- struct ks *ks = xcalloc (sizeof *ks, ost->n_vars);
+ struct ks *ks = xcalloc (ost->n_vars, sizeof *ks);
for (v = 0; v < ost->n_vars; ++v)
{
struct casereader *r = input;
- struct mcnemar *mc = xcalloc (sizeof *mc, t2s->n_pairs);
+ struct mcnemar *mc = xcalloc (t2s->n_pairs, sizeof *mc);
for (i = 0 ; i < t2s->n_pairs; ++i )
{
const struct two_sample_test *t2s = UP_CAST (test, const struct two_sample_test, parent);
struct ccase *c;
- struct sign_test_params *stp = xcalloc (sizeof *stp, t2s->n_pairs);
+ struct sign_test_params *stp = xcalloc (t2s->n_pairs, sizeof *stp);
struct casereader *r = input;
struct ccase *c;
struct casereader *r;
- struct pair_stats *ps = xcalloc (sizeof (*ps), tt->n_vars);
+ struct pair_stats *ps = xcalloc (tt->n_vars, sizeof *ps);
int v;
else
n_pairs = n_v1 * n_v2;
- pairs = xcalloc (sizeof *pairs, n_pairs);
-
+ pairs = xcalloc (n_pairs, sizeof *pairs);
if ( with)
{
const struct dictionary *dict = dataset_dict (ds);
const struct two_sample_test *t2s = UP_CAST (test, const struct two_sample_test, parent);
- struct wilcoxon_state *ws = xcalloc (sizeof (*ws), t2s->n_pairs);
+ struct wilcoxon_state *ws = xcalloc (t2s->n_pairs, sizeof *ws);
const struct variable *weight = dict_get_weight (dict);
struct variable *weightx = dict_create_internal_var (WEIGHT_IDX, 0);
struct caseproto *proto;
cov->n_cm = (n_vars * (n_vars - 1) ) / 2;
- if (cov->n_cm > 0)
- cov->cm = xcalloc (sizeof *cov->cm, cov->n_cm);
+
+ cov->cm = xcalloc (cov->n_cm, sizeof *cov->cm);
cov->categoricals = NULL;
return cov;
ptl->w = W;
os->n_k = 2;
- os->k = xcalloc (sizeof (*os->k), 2);
+ os->k = xcalloc (2, sizeof (*os->k));
os->k[0].tc = W * p;
os->k[1].tc = (W + 1.0) * p;
struct statistic *stat = &os->parent;
os->n_k = 2;
- os->k = xcalloc (sizeof (*os->k), 2);
+ os->k = xcalloc (2, sizeof (*os->k));
assert (tail >= 0);
assert (tail <= 1);
assert (c_min >= 0);
os->n_k = 3;
- os->k = xcalloc (sizeof (*os->k), 3);
+ os->k = xcalloc (3, sizeof (*os->k));
if ( c_min >= 1.0)
{
else if (n == 1)
return 1;
- array = xcalloc (sizeof *array, w + 1);
+ array = xcalloc (w + 1, sizeof *array);
array[w] = 1;
max = w;
g_return_if_fail (0 == printf_parse (scanf->format, &scanf->d, &a));
if ( scanf->d.count > 0)
- scanf->widgets = xcalloc (sizeof (*scanf->widgets), scanf->d.count);
+ scanf->widgets = xcalloc (scanf->d.count, sizeof (*scanf->widgets));
/* A is not used, so get rid of it */
if (a.arg != a.direct_alloc_arg)
if ( 0 != printf_parse (fmt, &d, &a) )
return NULL;
- widgets = xcalloc (sizeof (*widgets), d.count);
+ widgets = xcalloc (d.count, sizeof (*widgets));
va_start (ap, fmt);
for (i = 0 ; i < d.count ; ++i )
{