From: John Darrington Date: Sat, 14 Jan 2012 12:21:55 +0000 (+0100) Subject: Fix warnings X-Git-Tag: v0.7.9~36 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1f410c3ad34e83d60eb8c038946d8a0c72ce0d3;p=pspp-builds.git Fix warnings --- diff --git a/src/language/stats/means.c b/src/language/stats/means.c index 5312ace3..e7a4f584 100644 --- a/src/language/stats/means.c +++ b/src/language/stats/means.c @@ -16,7 +16,6 @@ #include - #include "data/case.h" #include "data/casegrouper.h" #include "data/casereader.h" @@ -104,7 +103,7 @@ harmonic_update (const struct means *means UNUSED, void *stat, double w, double static double -harmonic_get (const struct means *means UNUSED, struct per_var_data *pvd, void *stat) +harmonic_get (const struct means *means UNUSED, struct per_var_data *pvd UNUSED, void *stat) { struct harmonic_mean *hm = stat; @@ -142,7 +141,7 @@ geometric_update (const struct means *means UNUSED, void *stat, double w, double static double -geometric_get (const struct means *means UNUSED, struct per_var_data *pvd, void *stat) +geometric_get (const struct means *means UNUSED, struct per_var_data *pvd UNUSED, void *stat) { struct geometric_mean *gm = stat; @@ -151,14 +150,8 @@ geometric_get (const struct means *means UNUSED, struct per_var_data *pvd, void -static void * -sum_create (const struct means *means UNUSED, struct pool *pool) -{ - return NULL; -} - static double -sum_get (const struct means *means UNUSED, struct per_var_data *pvd, void *stat) +sum_get (const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED) { double n, mean; @@ -168,14 +161,8 @@ sum_get (const struct means *means UNUSED, struct per_var_data *pvd, void *stat) } -static void * -n_create (const struct means *means UNUSED, struct pool *pool) -{ - return NULL; -} - static double -n_get (const struct means *means UNUSED, struct per_var_data *pvd, void *stat) +n_get (const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED) { double n; @@ -184,14 +171,8 @@ n_get (const struct means *means UNUSED, struct per_var_data *pvd, void *stat) return n; } -static void * -arithmean_create (const struct means *means UNUSED, struct pool *pool) -{ - return NULL; -} - static double -arithmean_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat) +arithmean_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED) { double n, mean; @@ -200,14 +181,8 @@ arithmean_get (const const struct means *means UNUSED, struct per_var_data *pvd, return mean; } -static void * -stddev_create (const struct means *means UNUSED, struct pool *pool) -{ - return NULL; -} - static double -variance_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat) +variance_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED) { double n, mean, variance; @@ -226,14 +201,8 @@ stddev_get (const const struct means *means UNUSED, struct per_var_data *pvd, vo -static void * -skew_create (const struct means *means UNUSED, struct pool *pool) -{ - return NULL; -} - static double -skew_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat) +skew_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED) { double skew; @@ -243,7 +212,7 @@ skew_get (const const struct means *means UNUSED, struct per_var_data *pvd, void } static double -sekurt_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat) +sekurt_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED) { double n; @@ -255,7 +224,7 @@ sekurt_get (const const struct means *means UNUSED, struct per_var_data *pvd, vo static double -seskew_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat) +seskew_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED) { double n; @@ -266,15 +235,8 @@ seskew_get (const const struct means *means UNUSED, struct per_var_data *pvd, vo -static void * -kurt_create (const struct means *means UNUSED, struct pool *pool) -{ - return NULL; -} - - static double -kurt_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat) +kurt_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED) { double kurt; @@ -285,7 +247,7 @@ kurt_get (const const struct means *means UNUSED, struct per_var_data *pvd, void static double -semean_get (const struct means *means, struct per_var_data *pvd, void *stat) +semean_get (const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED) { double n, var; @@ -318,7 +280,7 @@ min_update (const struct means *means UNUSED, void *stat, double w UNUSED, doubl } static double -min_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat) +min_get (const const struct means *means UNUSED, struct per_var_data *pvd UNUSED, void *stat) { double *r = stat; @@ -345,7 +307,7 @@ max_update (const struct means *means UNUSED, void *stat, double w UNUSED, doubl } static double -max_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat) +max_get (const const struct means *means UNUSED, struct per_var_data *pvd UNUSED, void *stat) { double *r = stat; @@ -384,7 +346,7 @@ range_update (const struct means *means UNUSED, void *stat, double w UNUSED, dou } static double -range_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat) +range_get (const const struct means *means UNUSED, struct per_var_data *pvd UNUSED, void *stat) { struct range *r = stat; @@ -410,7 +372,7 @@ last_update (const struct means *means UNUSED, void *stat, double w UNUSED, doub } static double -last_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat) +last_get (const const struct means *means UNUSED, struct per_var_data *pvd UNUSED, void *stat) { double *l = stat; @@ -438,7 +400,7 @@ first_update (const struct means *means UNUSED, void *stat, double w UNUSED, dou } static double -first_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat) +first_get (const const struct means *means UNUSED, struct per_var_data *pvd UNUSED, void *stat) { double *f = stat; @@ -963,7 +925,7 @@ calculate_n (const void *aux1, void *aux2, void *user_data) static void run_means (struct means *cmd, struct casereader *input, - const struct dataset *ds) + const struct dataset *ds UNUSED) { int i,t; const struct variable *wv = dict_get_weight (cmd->dict); diff --git a/src/language/stats/oneway.c b/src/language/stats/oneway.c index 480bbb91..2c401f56 100644 --- a/src/language/stats/oneway.c +++ b/src/language/stats/oneway.c @@ -586,8 +586,7 @@ makeit (const void *aux1, void *aux2 UNUSED) static void updateit (const void *aux1, void *aux2, void *user_data, - const struct ccase *c, enum mv_class exclude, - const struct variable *wv) + const struct ccase *c, double weight) { struct descriptive_data *dd = user_data; @@ -597,13 +596,6 @@ updateit (const void *aux1, void *aux2, void *user_data, struct descriptive_data *dd_total = aux2; - double weight; - - if ( var_is_value_missing (varp, valx, exclude)) - return; - - weight = wv != NULL ? case_data (c, wv)->f : 1.0; - moments1_add (dd->mom, valx->f, weight); if (valx->f < dd->minimum) dd->minimum = valx->f; diff --git a/src/math/categoricals.c b/src/math/categoricals.c index b78fe9bf..ba616be3 100644 --- a/src/math/categoricals.c +++ b/src/math/categoricals.c @@ -414,7 +414,10 @@ categoricals_update (struct categoricals *cat, const struct ccase *c) cat->iap[i].cc += weight; if (cat->payload) - cat->payload->update (cat->aux1, cat->aux2, node->user_data, c, cat->exclude, cat->wv); + { + double weight = cat->wv ? case_data (c, cat->wv)->f : 1.0; + cat->payload->update (cat->aux1, cat->aux2, node->user_data, c, weight); + } } } diff --git a/src/math/categoricals.h b/src/math/categoricals.h index 4826227e..c221cd56 100644 --- a/src/math/categoricals.h +++ b/src/math/categoricals.h @@ -103,8 +103,7 @@ const struct ccase * categoricals_get_case_by_category (const struct categorical struct payload { void* (*create) (const void *aux1, void *aux2); - void (*update) (const void *aux1, void *aux2, void *user_data, - const struct ccase *, enum mv_class, const struct variable *wv); + void (*update) (const void *aux1, void *aux2, void *user_data, const struct ccase *, double weight); void (*destroy) (const void *aux1, void *aux2, void *user_data); };