From: Ben Pfaff Date: Mon, 1 May 2006 22:46:31 +0000 (+0000) Subject: Change case limit type from int to size_t. X-Git-Tag: v0.6.0~920 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=698e31dd616553a663d0b04f24d322ac47315534;p=pspp-builds.git Change case limit type from int to size_t. --- diff --git a/src/data/ChangeLog b/src/data/ChangeLog index 3d8e910e..d9cb36ce 100644 --- a/src/data/ChangeLog +++ b/src/data/ChangeLog @@ -1,3 +1,12 @@ +Mon May 1 15:45:42 2006 Ben Pfaff + + Change case limit type from int to size_t. + + * dictionary.c: (struct dictionary) Change type of case_limit + member. + (dict_get_case_limit) Change return type. + (dict_set_case_limit) Change parameter type. + Wed Apr 26 20:01:19 2006 Ben Pfaff * variable.h: (struct variable) Rename `reinit' member as `leave' diff --git a/src/data/dictionary.c b/src/data/dictionary.c index ad5b5067..161071ec 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -18,22 +18,25 @@ 02110-1301, USA. */ #include + #include "dictionary.h" + #include #include -#include -#include + #include "case.h" -#include "category.h" #include "cat-routines.h" +#include "category.h" +#include "settings.h" +#include "value-labels.h" +#include "variable.h" +#include +#include #include -#include #include +#include #include -#include "settings.h" #include -#include "value-labels.h" -#include "variable.h" #include "gettext.h" #define _(msgid) gettext (msgid) @@ -49,7 +52,7 @@ struct dictionary size_t split_cnt; /* SPLIT FILE count. */ struct variable *weight; /* WEIGHT variable. */ struct variable *filter; /* FILTER variable. */ - int case_limit; /* Current case limit (N command). */ + size_t case_limit; /* Current case limit (N command). */ char *label; /* File label. */ char *documents; /* Documents, as a string. */ struct vector **vector; /* Vectors of variables. */ @@ -748,8 +751,8 @@ dict_set_filter (struct dictionary *d, struct variable *v) } /* Returns the case limit for dictionary D, or zero if the number - of cases is unlimited (see cmd_n()). */ -int + of cases is unlimited. */ +size_t dict_get_case_limit (const struct dictionary *d) { assert (d != NULL); @@ -757,13 +760,12 @@ dict_get_case_limit (const struct dictionary *d) return d->case_limit; } -/* Sets CASE_LIMIT as the case limit for dictionary D. Zero for - CASE_LIMIT indicates no limit. */ +/* Sets CASE_LIMIT as the case limit for dictionary D. Use + 0 for CASE_LIMIT to indicate no limit. */ void -dict_set_case_limit (struct dictionary *d, int case_limit) +dict_set_case_limit (struct dictionary *d, size_t case_limit) { assert (d != NULL); - assert (case_limit >= 0); d->case_limit = case_limit; } diff --git a/src/data/dictionary.h b/src/data/dictionary.h index d0287714..50c9db57 100644 --- a/src/data/dictionary.h +++ b/src/data/dictionary.h @@ -74,8 +74,8 @@ void dict_set_weight (struct dictionary *, struct variable *); struct variable *dict_get_filter (const struct dictionary *); void dict_set_filter (struct dictionary *, struct variable *); -int dict_get_case_limit (const struct dictionary *); -void dict_set_case_limit (struct dictionary *, int); +size_t dict_get_case_limit (const struct dictionary *); +void dict_set_case_limit (struct dictionary *, size_t); int dict_get_next_value_idx (const struct dictionary *); size_t dict_get_case_size (const struct dictionary *);