X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Fnp.c;h=99584a5105b75879517e4b30982e9d78280a5dd1;hb=cc57a28ef6796ae9a64ef80d453f72126956d49d;hp=e189b47091faee8304ee1a557042cd0f2cff873c;hpb=9bf1c33953f7feff2a24a06293f6fe96b75cc41a;p=pspp-builds.git diff --git a/src/math/np.c b/src/math/np.c index e189b470..99584a51 100644 --- a/src/math/np.c +++ b/src/math/np.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ static void acc (struct statistic *s, const struct ccase *cx UNUSED, double c, double cc, double y) { - struct ccase cp; + struct ccase *cp; struct np *np = (struct np *) s; double rank = np->prev_cc + (c + 1) / 2.0; @@ -56,13 +56,11 @@ acc (struct statistic *s, const struct ccase *cx UNUSED, maximize (&np->y_max, y); minimize (&np->y_min, y); - case_create (&cp, n_NP_IDX); - - case_data_rw_idx (&cp, NP_IDX_Y)->f = y; - case_data_rw_idx (&cp, NP_IDX_NS)->f = ns; - case_data_rw_idx (&cp, NP_IDX_DNS)->f = dns; - - casewriter_write (np->writer, &cp); + cp = case_create (n_NP_IDX); + case_data_rw_idx (cp, NP_IDX_Y)->f = y; + case_data_rw_idx (cp, NP_IDX_NS)->f = ns; + case_data_rw_idx (cp, NP_IDX_DNS)->f = dns; + casewriter_write (np->writer, cp); np->prev_cc = cc; }