From e947f08aea815968ef993d572977e271fa3ad4da Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 16 Apr 2006 01:05:14 +0000 Subject: [PATCH] Fix some warnings. --- src/data/ChangeLog | 5 +++++ src/language/data-io/ChangeLog | 5 +++++ src/language/data-io/data-list.c | 2 ++ src/language/dictionary/apply-dictionary.c | 1 + src/language/dictionary/sys-file-info.c | 1 + src/language/stats/ChangeLog | 4 ++++ src/language/stats/aggregate.c | 2 ++ src/language/stats/correlations.q | 1 + src/language/stats/examine.q | 19 +++++++++++-------- src/language/stats/frequencies.q | 1 + src/language/stats/rank.q | 1 + src/language/stats/sort-criteria.h | 1 + src/language/tests/moments-test.c | 4 ++-- src/math/ChangeLog | 4 ++++ src/math/factor-stats.c | 6 ++++-- src/math/linreg/ChangeLog | 17 +++++++++++++++++ src/math/linreg/coefficient.c | 2 +- src/math/linreg/linreg.h | 4 ++-- src/math/linreg/predict.c | 6 ++++-- src/math/sort.c | 1 + 20 files changed, 70 insertions(+), 17 deletions(-) diff --git a/src/data/ChangeLog b/src/data/ChangeLog index 35a8ed1e..b87a9395 100644 --- a/src/data/ChangeLog +++ b/src/data/ChangeLog @@ -1,3 +1,8 @@ +Mon Apr 3 13:22:39 2006 Ben Pfaff + + * variable.c (var_is_valid_name): Move declarations before code + for C90 compliance. + Tue Apr 4 15:28:40 WST 2006 John Darrington * filename.ch (fn_interp_vars): Fixed small buglet. diff --git a/src/language/data-io/ChangeLog b/src/language/data-io/ChangeLog index 4a96aeb9..256cc20c 100644 --- a/src/language/data-io/ChangeLog +++ b/src/language/data-io/ChangeLog @@ -1,3 +1,8 @@ +Sat Apr 15 18:00:32 2006 Ben Pfaff + + * data-list.c: Add prototype to suppress warning for + cmd_repeating_data(). + Thu Mar 2 08:40:33 WST 2006 John Darrington * Moved files from src directory diff --git a/src/language/data-io/data-list.c b/src/language/data-io/data-list.c index db67a367..db7fc3bf 100644 --- a/src/language/data-io/data-list.c +++ b/src/language/data-io/data-list.c @@ -1348,6 +1348,8 @@ static int parse_repeating_data (struct dls_var_spec **, static void find_variable_input_spec (struct variable *v, struct fmt_spec *spec); +int cmd_repeating_data (void); + /* Parses the REPEATING DATA command. */ int cmd_repeating_data (void) diff --git a/src/language/dictionary/apply-dictionary.c b/src/language/dictionary/apply-dictionary.c index 00025ead..6aaada8e 100644 --- a/src/language/dictionary/apply-dictionary.c +++ b/src/language/dictionary/apply-dictionary.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/src/language/dictionary/sys-file-info.c b/src/language/dictionary/sys-file-info.c index 1f9bc7e4..5421a3c1 100644 --- a/src/language/dictionary/sys-file-info.c +++ b/src/language/dictionary/sys-file-info.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/src/language/stats/ChangeLog b/src/language/stats/ChangeLog index 89829de2..ffdee8ac 100644 --- a/src/language/stats/ChangeLog +++ b/src/language/stats/ChangeLog @@ -1,3 +1,7 @@ +Sat Apr 15 18:01:03 2006 Ben Pfaff + + * examine.q (output_examine): Add casts to fix warnings. + 2006-04-07 Jason Stover * regression.q (subcommand_save): New function. diff --git a/src/language/stats/aggregate.c b/src/language/stats/aggregate.c index 793a7256..4b8bf46b 100644 --- a/src/language/stats/aggregate.c +++ b/src/language/stats/aggregate.c @@ -28,7 +28,9 @@ #include #include #include +#include #include +#include #include #include #include diff --git a/src/language/stats/correlations.q b/src/language/stats/correlations.q index 10818591..830ae37b 100644 --- a/src/language/stats/correlations.q +++ b/src/language/stats/correlations.q @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/src/language/stats/examine.q b/src/language/stats/examine.q index aad3baa1..4f8e45de 100644 --- a/src/language/stats/examine.q +++ b/src/language/stats/examine.q @@ -285,12 +285,13 @@ output_examine(void) { if ( cmd.cmp == XMN_GROUPS ) { - box_plot_group(0, dependent_vars, n_dependent_vars, - cmd.v_id); + box_plot_group (0, (const struct variable **) dependent_vars, + n_dependent_vars, cmd.v_id); } else - box_plot_variables(0, dependent_vars, n_dependent_vars, - cmd.v_id); + box_plot_variables (0, + (const struct variable **) dependent_vars, + n_dependent_vars, cmd.v_id); } if ( cmd.a_plot[XMN_PLT_HISTOGRAM] ) @@ -342,11 +343,13 @@ output_examine(void) if ( cmd.a_plot[XMN_PLT_BOXPLOT] ) { if ( cmd.cmp == XMN_VARIABLES ) - box_plot_variables(fctr, dependent_vars, n_dependent_vars, - cmd.v_id); + box_plot_variables (fctr, + (const struct variable **) dependent_vars, + n_dependent_vars, cmd.v_id); else - box_plot_group(fctr, dependent_vars, n_dependent_vars, - cmd.v_id); + box_plot_group (fctr, + (const struct variable **) dependent_vars, + n_dependent_vars, cmd.v_id); } for ( v = 0 ; v < n_dependent_vars; ++v ) diff --git a/src/language/stats/frequencies.q b/src/language/stats/frequencies.q index b3429932..375530bc 100644 --- a/src/language/stats/frequencies.q +++ b/src/language/stats/frequencies.q @@ -54,6 +54,7 @@ #include #include #include +#include #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/stats/rank.q b/src/language/stats/rank.q index 92667f1c..67e182a0 100644 --- a/src/language/stats/rank.q +++ b/src/language/stats/rank.q @@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA #include #include +#include #include #include #include diff --git a/src/language/stats/sort-criteria.h b/src/language/stats/sort-criteria.h index 8ee3dbaa..0c804a8c 100644 --- a/src/language/stats/sort-criteria.h +++ b/src/language/stats/sort-criteria.h @@ -22,6 +22,7 @@ #include #include +#include struct variable; struct dictionary; diff --git a/src/language/tests/moments-test.c b/src/language/tests/moments-test.c index c3412e04..619f797e 100644 --- a/src/language/tests/moments-test.c +++ b/src/language/tests/moments-test.c @@ -23,9 +23,9 @@ #include #include #include -#include "xalloc.h" -#include #include +#include +#include "xalloc.h" #define _(msgid) gettext (msgid) diff --git a/src/math/ChangeLog b/src/math/ChangeLog index 4a96aeb9..4ace1080 100644 --- a/src/math/ChangeLog +++ b/src/math/ChangeLog @@ -1,3 +1,7 @@ +Sat Apr 15 18:01:22 2006 Ben Pfaff + + * factor-stats.c (metrics_postcalc): Add casts to fix warnings. + Thu Mar 2 08:40:33 WST 2006 John Darrington * Moved files from src directory diff --git a/src/math/factor-stats.c b/src/math/factor-stats.c index 47d17706..fde6abe1 100644 --- a/src/math/factor-stats.c +++ b/src/math/factor-stats.c @@ -185,9 +185,11 @@ metrics_postcalc(struct metrics *m) /* Calculate the percentiles */ - ptiles(m->ptile_hash, m->wvp, m->n_data, m->n, m->ptile_alg); + ptiles (m->ptile_hash, (const struct weighted_value **) m->wvp, + m->n_data, m->n, m->ptile_alg); - tukey_hinges(m->wvp, m->n_data, m->n, m->hinge); + tukey_hinges ((const struct weighted_value **) m->wvp, + m->n_data, m->n, m->hinge); /* Special case here */ if ( k1 + 1 == k2 ) diff --git a/src/math/linreg/ChangeLog b/src/math/linreg/ChangeLog index c31f24a5..ca3a647c 100644 --- a/src/math/linreg/ChangeLog +++ b/src/math/linreg/ChangeLog @@ -1,3 +1,20 @@ +Sat Apr 15 18:03:01 2006 Ben Pfaff + + * predict.c (pspp_linreg_predict): Change prototype to match + struct pspp_linreg_cache_struct's predict member. + * predict.c (pspp_linreg_residual): Change prototype to match + struct pspp_linreg_cache_struct's residual member. + +Sat Apr 15 18:01:39 2006 Ben Pfaff + + * coefficient.c (pspp_linreg_get_coeff): Compare n_indeps against + 0, instead of NULL, because it's an integer type. + +Mon Apr 3 13:20:54 2006 Ben Pfaff + + * linreg.c (pspp_linreg): Move declaration before code for C90 + compliance. + 2006-04-09 Jason Stover * predict.c (pspp_linreg_predict): Do something sensible even with diff --git a/src/math/linreg/coefficient.c b/src/math/linreg/coefficient.c index 2154ffe4..2cca9f54 100644 --- a/src/math/linreg/coefficient.c +++ b/src/math/linreg/coefficient.c @@ -196,7 +196,7 @@ pspp_linreg_get_coeff (const pspp_linreg_cache * c, { return NULL; } - if (c->coeff == NULL || c->n_indeps == NULL || v == NULL) + if (c->coeff == NULL || c->n_indeps == 0 || v == NULL) { return NULL; } diff --git a/src/math/linreg/linreg.h b/src/math/linreg/linreg.h index 771236a8..727d764c 100644 --- a/src/math/linreg/linreg.h +++ b/src/math/linreg/linreg.h @@ -191,8 +191,8 @@ pspp_linreg (const gsl_vector * Y, const gsl_matrix * X, double pspp_linreg_predict (const struct variable **, const union value **, - const pspp_linreg_cache *, int); + const void *, int); double pspp_linreg_residual (const struct variable **, const union value **, - const union value *, const pspp_linreg_cache *, int); + const union value *, const void *, int); #endif diff --git a/src/math/linreg/predict.c b/src/math/linreg/predict.c index 49e24434..34e709c8 100644 --- a/src/math/linreg/predict.c +++ b/src/math/linreg/predict.c @@ -31,8 +31,9 @@ double pspp_linreg_predict (const struct variable **predictors, const union value **vals, - const pspp_linreg_cache * c, int n_vals) + const void *c_, int n_vals) { + const pspp_linreg_cache *c = c_; int i; int j; const struct pspp_linreg_coeff **found; @@ -86,8 +87,9 @@ double pspp_linreg_residual (const struct variable **predictors, const union value **vals, const union value *obs, - const pspp_linreg_cache * c, int n_vals) + const void *c_, int n_vals) { + const pspp_linreg_cache *c = c_; double pred; double result; diff --git a/src/math/sort.c b/src/math/sort.c index 20d8dde7..4d64b324 100644 --- a/src/math/sort.c +++ b/src/math/sort.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include -- 2.30.2