X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fnpar-summary.c;h=04c83e1a0ed694456d3518e5c9ccad30101a2abb;hb=3c52a21736b3777ced3e47148fa2fc8f9eff59c8;hp=5eee57d562a057e8020e9f95a70abebc411624ca;hpb=f5c108becd49d78f4898cab11352291f5689d24e;p=pspp diff --git a/src/language/stats/npar-summary.c b/src/language/stats/npar-summary.c index 5eee57d562..04c83e1a0e 100644 --- a/src/language/stats/npar-summary.c +++ b/src/language/stats/npar-summary.c @@ -1,20 +1,18 @@ -/* PSPP - computes sample statistics. - Copyright (C) 2006 Free Software Foundation, Inc. +/* PSPP - a program for statistical analysis. + Copyright (C) 2006, 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 the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + 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 + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + along with this program. If not, see . */ #include #include @@ -47,23 +45,23 @@ npar_summary_calc_descriptives (struct descriptives *desc, double maximum = -DBL_MAX; double var; struct moments1 *moments = moments1_create (MOMENT_VARIANCE); - struct ccase c; + struct ccase *c; const struct variable *v = *vv++; struct casereader *pass; pass = casereader_clone (input); pass = casereader_create_filter_missing (pass, &v, 1, - filter, NULL); + filter, NULL, NULL); pass = casereader_create_filter_weight (pass, dict, NULL, NULL); - while (casereader_read(pass, &c)) + while ((c = casereader_read (pass)) != NULL) { - double val = case_num (&c, v); - double w = dict_get_case_weight (dict, &c, NULL); + double val = case_num (c, v); + double w = dict_get_case_weight (dict, c, NULL); minimum = MIN (minimum, val); maximum = MAX (maximum, val); moments1_add (moments, val, w); - case_destroy (&c); + case_unref (c); } casereader_destroy (pass);