X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fsign.c;h=32a74b20e07cc60004ac55923718181cace2eee6;hb=ffca729efecaa224bf1d71ba4b43af9222d7e8e3;hp=30de7d1e9bdfdaccf18c01772c387c2ee9ea463e;hpb=5cab4cf3322f29c0ed7134d23740e07382914f20;p=pspp diff --git a/src/language/stats/sign.c b/src/language/stats/sign.c index 30de7d1e9b..32a74b20e0 100644 --- a/src/language/stats/sign.c +++ b/src/language/stats/sign.c @@ -138,7 +138,7 @@ sign_execute (const struct dataset *ds, const struct two_sample_test *t2s = UP_CAST (test, const struct two_sample_test, parent); struct ccase *c; - struct sign_test_params *stp = xcalloc (t2s->n_pairs, sizeof *stp); + struct sign_test_params *stp = XCALLOC (t2s->n_pairs, struct sign_test_params); struct casereader *r = input; @@ -146,20 +146,20 @@ sign_execute (const struct dataset *ds, { const double weight = dict_get_case_weight (dict, c, &warn); - for (i = 0 ; i < t2s->n_pairs; ++i ) + for (i = 0 ; i < t2s->n_pairs; ++i) { variable_pair *vp = &t2s->pairs[i]; const union value *value0 = case_data (c, (*vp)[0]); const union value *value1 = case_data (c, (*vp)[1]); const double diff = value0->f - value1->f; - if (var_is_value_missing ((*vp)[0], value0, exclude)) + if (var_is_value_missing ((*vp)[0], value0) & exclude) continue; - if (var_is_value_missing ((*vp)[1], value1, exclude)) + if (var_is_value_missing ((*vp)[1], value1) & exclude) continue; - if ( diff > 0) + if (diff > 0) stp[i].pos += weight; else if (diff < 0) stp[i].neg += weight; @@ -170,7 +170,7 @@ sign_execute (const struct dataset *ds, casereader_destroy (r); - for (i = 0 ; i < t2s->n_pairs; ++i ) + for (i = 0 ; i < t2s->n_pairs; ++i) { int r = MIN (stp[i].pos, stp[i].neg); stp[i].one_tailed_sig = gsl_cdf_binomial_P (r,