+Mon May 1 15:45:42 2006 Ben Pfaff <blp@gnu.org>
+
+ 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 <blp@gnu.org>
* variable.h: (struct variable) Rename `reinit' member as `leave'
02110-1301, USA. */
#include <config.h>
+
#include "dictionary.h"
+
#include <stdlib.h>
#include <ctype.h>
-#include <libpspp/array.h>
-#include <libpspp/alloc.h>
+
#include "case.h"
-#include "category.h"
#include "cat-routines.h"
+#include "category.h"
+#include "settings.h"
+#include "value-labels.h"
+#include "variable.h"
+#include <libpspp/alloc.h>
+#include <libpspp/array.h>
#include <libpspp/compiler.h>
-#include <libpspp/message.h>
#include <libpspp/hash.h>
+#include <libpspp/message.h>
#include <libpspp/misc.h>
-#include "settings.h"
#include <libpspp/str.h>
-#include "value-labels.h"
-#include "variable.h"
#include "gettext.h"
#define _(msgid) gettext (msgid)
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. */
}
/* 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);
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;
}
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 *);