/* PSPP - computes sample statistics.
Copyright (C) 2006 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@gnu.org>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
pattern_pred (const void *element_, void *pattern_)
{
const struct element *element = element_;
- unsigned *pattern = pattern_;
+ unsigned int *pattern = pattern_;
return (*pattern & (1u << element->x)) != 0;
}
}
/* Returns N!. */
-static unsigned
-factorial (unsigned n)
+static unsigned int
+factorial (unsigned int n)
{
- unsigned value = 1;
+ unsigned int value = 1;
while (n > 1)
value *= n--;
return value;
/* Returns the number of permutations of the CNT values in
VALUES. If VALUES contains duplicates, they must be
adjacent. */
-static unsigned
+static unsigned int
expected_perms (int *values, size_t cnt)
{
size_t i, j;
- unsigned perm_cnt;
+ unsigned int perm_cnt;
perm_cnt = factorial (cnt);
for (i = 0; i < cnt; i = j)
int *old_values = xnmalloc (max_elems, sizeof *values);
int *new_values = xnmalloc (max_elems, sizeof *values);
- unsigned permutation_cnt;
+ unsigned int permutation_cnt;
int left = cnt;
int value = 0;
const int max_elems = 10;
int cnt;
- unsigned pbase;
+ unsigned int pbase;
int r0, r1;
for (cnt = 0; cnt < max_elems; cnt++)
struct llx **elemp;
int *values;
- unsigned pattern = pbase << r0;
+ unsigned int pattern = pbase << r0;
int i, j;
int first_false;
struct llx *part_llx;