[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] pspp/src data/dictionary.c data/dictionary.h la...
From: |
John Darrington |
Subject: |
[Pspp-cvs] pspp/src data/dictionary.c data/dictionary.h la... |
Date: |
Sat, 23 Sep 2006 00:15:58 +0000 |
CVSROOT: /sources/pspp
Module name: pspp
Changes by: John Darrington <jmd> 06/09/23 00:15:58
Modified files:
src/data : dictionary.c dictionary.h
src/language/stats: aggregate.c crosstabs.q descriptives.c
examine.q frequencies.q oneway.q t-test.q
src/math : levene.c sort.c sort.h
Log message:
Changed int to bool in dict_get_weight and sort_active_file_in_place
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/dictionary.c?cvsroot=pspp&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/dictionary.h?cvsroot=pspp&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/aggregate.c?cvsroot=pspp&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/crosstabs.q?cvsroot=pspp&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/descriptives.c?cvsroot=pspp&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/examine.q?cvsroot=pspp&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/frequencies.q?cvsroot=pspp&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/oneway.q?cvsroot=pspp&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/t-test.q?cvsroot=pspp&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/pspp/src/math/levene.c?cvsroot=pspp&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/pspp/src/math/sort.c?cvsroot=pspp&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/pspp/src/math/sort.h?cvsroot=pspp&r1=1.1&r2=1.2
Patches:
Index: data/dictionary.c
===================================================================
RCS file: /sources/pspp/pspp/src/data/dictionary.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- data/dictionary.c 2 Jul 2006 06:19:24 -0000 1.13
+++ data/dictionary.c 23 Sep 2006 00:15:58 -0000 1.14
@@ -687,11 +687,11 @@
/* Returns the value of D's weighting variable in case C, except that a
negative weight is returned as 0. Returns 1 if the dictionary is
unweighted. Will warn about missing, negative, or zero values if
- warn_on_invalid is nonzero. The function will set warn_on_invalid to zero
+ warn_on_invalid is true. The function will set warn_on_invalid to false
if an invalid weight is found. */
double
dict_get_case_weight (const struct dictionary *d, const struct ccase *c,
- int *warn_on_invalid)
+ bool *warn_on_invalid)
{
assert (d != NULL);
assert (c != NULL);
@@ -704,7 +704,7 @@
if (w < 0.0 || mv_is_num_missing (&d->weight->miss, w))
w = 0.0;
if ( w == 0.0 && *warn_on_invalid ) {
- *warn_on_invalid = 0;
+ *warn_on_invalid = false;
msg (SW, _("At least one case in the data file had a weight value "
"that was user-missing, system-missing, zero, or "
"negative. These case(s) were ignored."));
Index: data/dictionary.h
===================================================================
RCS file: /sources/pspp/pspp/src/data/dictionary.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- data/dictionary.h 6 May 2006 22:37:30 -0000 1.3
+++ data/dictionary.h 23 Sep 2006 00:15:58 -0000 1.4
@@ -68,7 +68,7 @@
struct ccase;
struct variable *dict_get_weight (const struct dictionary *);
double dict_get_case_weight (const struct dictionary *,
- const struct ccase *, int *);
+ const struct ccase *, bool *);
void dict_set_weight (struct dictionary *, struct variable *);
struct variable *dict_get_filter (const struct dictionary *);
Index: language/stats/aggregate.c
===================================================================
RCS file: /sources/pspp/pspp/src/language/stats/aggregate.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- language/stats/aggregate.c 8 Jul 2006 03:05:51 -0000 1.13
+++ language/stats/aggregate.c 23 Sep 2006 00:15:58 -0000 1.14
@@ -743,7 +743,7 @@
{
struct agr_var *iter;
double weight;
- int bad_warn = 1;
+ bool bad_warn = true;
weight = dict_get_case_weight (default_dict, input, &bad_warn);
Index: language/stats/crosstabs.q
===================================================================
RCS file: /sources/pspp/pspp/src/language/stats/crosstabs.q,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- language/stats/crosstabs.q 8 Jul 2006 03:05:51 -0000 1.13
+++ language/stats/crosstabs.q 23 Sep 2006 00:15:58 -0000 1.14
@@ -564,7 +564,7 @@
static bool
calc_general (const struct ccase *c, void *aux UNUSED)
{
- int bad_warn = 1;
+ bool bad_warn = true;
/* Case weight. */
double weight = dict_get_case_weight (default_dict, c, &bad_warn);
@@ -638,7 +638,7 @@
static bool
calc_integer (const struct ccase *c, void *aux UNUSED)
{
- int bad_warn = 1;
+ bool bad_warn = true;
/* Case weight. */
double weight = dict_get_case_weight (default_dict, c, &bad_warn);
Index: language/stats/descriptives.c
===================================================================
RCS file: /sources/pspp/pspp/src/language/stats/descriptives.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- language/stats/descriptives.c 27 Jun 2006 19:09:22 -0000 1.9
+++ language/stats/descriptives.c 23 Sep 2006 00:15:58 -0000 1.10
@@ -159,7 +159,7 @@
/* Accumulated results. */
double missing_listwise; /* Sum of weights of cases missing listwise. */
double valid; /* Sum of weights of valid cases. */
- int bad_warn; /* Warn if bad weight found. */
+ bool bad_warn; /* Warn if bad weight found. */
enum dsc_statistic sort_by_stat; /* Statistic to sort by; -1: name. */
int sort_ascending; /* !0: ascending order; 0: descending. */
unsigned long show_stats; /* Statistics to display. */
Index: language/stats/examine.q
===================================================================
RCS file: /sources/pspp/pspp/src/language/stats/examine.q,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- language/stats/examine.q 5 Jul 2006 05:14:31 -0000 1.9
+++ language/stats/examine.q 23 Sep 2006 00:15:58 -0000 1.10
@@ -618,7 +618,7 @@
-static int bad_weight_warn = 1;
+static bool bad_weight_warn = true;
/* Perform calculations for the sub factors */
Index: language/stats/frequencies.q
===================================================================
RCS file: /sources/pspp/pspp/src/language/stats/frequencies.q,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- language/stats/frequencies.q 8 Jul 2006 03:05:51 -0000 1.13
+++ language/stats/frequencies.q 23 Sep 2006 00:15:58 -0000 1.14
@@ -509,7 +509,7 @@
{
double weight;
size_t i;
- int bad_warn = 1;
+ bool bad_warn = true;
weight = dict_get_case_weight (default_dict, c, &bad_warn);
Index: language/stats/oneway.q
===================================================================
RCS file: /sources/pspp/pspp/src/language/stats/oneway.q,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- language/stats/oneway.q 5 Jul 2006 05:14:31 -0000 1.9
+++ language/stats/oneway.q 23 Sep 2006 00:15:58 -0000 1.10
@@ -67,7 +67,7 @@
-static int bad_weight_warn = 1;
+static bool bad_weight_warn = true;
static struct cmd_oneway cmd;
@@ -917,7 +917,7 @@
size_t i;
const double weight =
- dict_get_case_weight(default_dict,&c,&bad_weight_warn);
+ dict_get_case_weight (default_dict, &c, &bad_weight_warn);
const union value *indep_val = case_data (&c, indep_var->fv);
Index: language/stats/t-test.q
===================================================================
RCS file: /sources/pspp/pspp/src/language/stats/t-test.q,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- language/stats/t-test.q 8 Jul 2006 03:05:51 -0000 1.10
+++ language/stats/t-test.q 23 Sep 2006 00:15:58 -0000 1.11
@@ -242,7 +242,7 @@
static struct cmd_t_test cmd;
-static int bad_weight_warn;
+static bool bad_weight_warn = false;
static int compare_group_binary(const struct group_statistics *a,
@@ -343,7 +343,7 @@
else
value_is_missing = mv_is_value_missing;
- bad_weight_warn = 1;
+ bad_weight_warn = true;
ok = multipass_procedure_with_splits (calculate, &cmd);
@@ -1416,7 +1416,7 @@
int i;
struct cmd_t_test *cmd = (struct cmd_t_test *)_cmd;
- double weight = dict_get_case_weight(default_dict,c,&bad_weight_warn);
+ double weight = dict_get_case_weight (default_dict, c, &bad_weight_warn);
/* Skip the entire case if /MISSING=LISTWISE is set */
@@ -1516,7 +1516,7 @@
struct cmd_t_test *cmd = (struct cmd_t_test *)cmd_;
- double weight = dict_get_case_weight(default_dict,c,&bad_weight_warn);
+ double weight = dict_get_case_weight (default_dict, c, &bad_weight_warn);
/* Skip the entire case if /MISSING=LISTWISE is set */
if ( cmd->miss == TTS_LISTWISE )
@@ -1606,7 +1606,7 @@
struct cmd_t_test *cmd = (struct cmd_t_test *) cmd_;
- double weight = dict_get_case_weight(default_dict,c,&bad_weight_warn);
+ double weight = dict_get_case_weight (default_dict, c, &bad_weight_warn);
/* Skip the entire case if /MISSING=LISTWISE is set ,
AND one member of a pair is missing */
@@ -1751,7 +1751,8 @@
const union value *gv = case_data (c, indep_var->fv);
- const double weight = dict_get_case_weight(default_dict,c,&bad_weight_warn);
+ const double weight =
+ dict_get_case_weight (default_dict, c, &bad_weight_warn);
if ( value_is_missing(&indep_var->miss, gv) )
{
Index: math/levene.c
===================================================================
RCS file: /sources/pspp/pspp/src/math/levene.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- math/levene.c 5 May 2006 04:53:13 -0000 1.3
+++ math/levene.c 23 Sep 2006 00:15:58 -0000 1.4
@@ -187,11 +187,11 @@
levene_calc (const struct ccase *c, void *_l)
{
size_t i;
- int warn = 0;
+ bool warn = false;
struct levene_info *l = (struct levene_info *) _l;
const union value *gv = case_data (c, l->v_indep->fv);
struct group_statistics key;
- double weight = dict_get_case_weight(default_dict,c,&warn);
+ double weight = dict_get_case_weight (default_dict, c, &warn);
/* Skip the entire case if /MISSING=LISTWISE is set */
if ( l->missing == LEV_LISTWISE )
@@ -291,11 +291,11 @@
levene2_calc (const struct ccase *c, void *_l)
{
size_t i;
- int warn = 0;
+ bool warn = false;
struct levene_info *l = (struct levene_info *) _l;
- double weight = dict_get_case_weight(default_dict,c,&warn);
+ double weight = dict_get_case_weight (default_dict, c, &warn);
const union value *gv = case_data (c, l->v_indep->fv);
struct group_statistics key;
Index: math/sort.c
===================================================================
RCS file: /sources/pspp/pspp/src/math/sort.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- math/sort.c 17 Jul 2006 10:45:43 -0000 1.12
+++ math/sort.c 23 Sep 2006 00:15:58 -0000 1.13
@@ -67,23 +67,23 @@
}
/* Sorts the active file in-place according to CRITERIA.
- Returns nonzero if successful. */
-int
+ Returns true if successful. */
+bool
sort_active_file_in_place (const struct sort_criteria *criteria)
{
struct casefile *in, *out;
prepare_to_sort_active_file ();
if (!procedure (NULL, NULL))
- return 0;
+ return false;
in = proc_capture_output ();
out = sort_execute (casefile_get_destructive_reader (in), criteria);
if (out == NULL)
- return 0;
+ return false;
proc_set_source (storage_source_create (out));
- return 1;
+ return true;
}
/* Data passed to sort_to_casefile_callback(). */
Index: math/sort.h
===================================================================
RCS file: /sources/pspp/pspp/src/math/sort.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- math/sort.h 4 Mar 2006 01:11:57 -0000 1.1
+++ math/sort.h 23 Sep 2006 00:15:58 -0000 1.2
@@ -60,7 +60,7 @@
struct casefile *sort_execute (struct casereader *,
const struct sort_criteria *);
-int sort_active_file_in_place (const struct sort_criteria *);
+bool sort_active_file_in_place (const struct sort_criteria *);
struct casefile *sort_active_file_to_casefile (const struct sort_criteria *);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pspp-cvs] pspp/src data/dictionary.c data/dictionary.h la...,
John Darrington <=