projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changed po/POTFILES.in to be a generated file.
[pspp]
/
src
/
frequencies.q
diff --git
a/src/frequencies.q
b/src/frequencies.q
index 52f23357473e628f85839a9aca55d57da507ae61..44393a89bbe765ad473afaa63a1af1a4cc72a9f5 100644
(file)
--- a/
src/frequencies.q
+++ b/
src/frequencies.q
@@
-160,9
+160,9
@@
static struct pool *gen_pool; /* General mode. */
static void determine_charts (void);
static void determine_charts (void);
-static void precalc (void);
-static int calc (struct ccase *);
-static void postcalc (void);
+static void precalc (void
*
);
+static int calc (struct ccase *
, void *
);
+static void postcalc (void
*
);
static void postprocess_freq_tab (struct variable *);
static void dump_full (struct variable *);
static void postprocess_freq_tab (struct variable *);
static void dump_full (struct variable *);
@@
-246,7
+246,7
@@
internal_cmd_frequencies (void)
cmd.sort = FRQ_AVALUE;
/* Do it! */
cmd.sort = FRQ_AVALUE;
/* Do it! */
- procedure (precalc, calc, postcalc);
+ procedure (precalc, calc, postcalc
, NULL
);
return CMD_SUCCESS;
}
return CMD_SUCCESS;
}
@@
-355,7
+355,7
@@
determine_charts (void)
/* Add data from case C to the frequency table. */
static int
/* Add data from case C to the frequency table. */
static int
-calc (struct ccase *c)
+calc (struct ccase *c
, void *aux UNUSED
)
{
double weight;
int i;
{
double weight;
int i;
@@
-408,7
+408,7
@@
calc (struct ccase *c)
/* Prepares each variable that is the target of FREQUENCIES by setting
up its hash table. */
static void
/* Prepares each variable that is the target of FREQUENCIES by setting
up its hash table. */
static void
-precalc (void)
+precalc (void
*aux UNUSED
)
{
int i;
{
int i;
@@
-451,7
+451,7
@@
precalc (void)
/* Finishes up with the variables after frequencies have been
calculated. Displays statistics, percentiles, ... */
static void
/* Finishes up with the variables after frequencies have been
calculated. Displays statistics, percentiles, ... */
static void
-postcalc (void)
+postcalc (void
*aux UNUSED
)
{
int i;
{
int i;
@@
-514,6
+514,8
@@
get_freq_comparator (int frq_sort, int var_type)
case FRQ_DFREQ | (ALPHA << 16): return compare_freq_alpha_d;
default: assert (0);
}
case FRQ_DFREQ | (ALPHA << 16): return compare_freq_alpha_d;
default: assert (0);
}
+
+ return 0;
}
static int
}
static int
@@
-583,7
+585,7
@@
cleanup_freq_tab (struct variable *v)
/* Parses the VARIABLES subcommand, adding to
{n_variables,v_variables}. */
static int
/* Parses the VARIABLES subcommand, adding to
{n_variables,v_variables}. */
static int
-frq_custom_variables (struct cmd_frequencies *cmd
unused
)
+frq_custom_variables (struct cmd_frequencies *cmd
UNUSED
)
{
int mode;
int min, max;
{
int mode;
int min, max;
@@
-669,7
+671,7
@@
frq_custom_variables (struct cmd_frequencies *cmd unused)
/* Parses the GROUPED subcommand, setting the frq.{n_grouped,grouped}
fields of specified variables. */
static int
/* Parses the GROUPED subcommand, setting the frq.{n_grouped,grouped}
fields of specified variables. */
static int
-frq_custom_grouped (struct cmd_frequencies *cmd
unused
)
+frq_custom_grouped (struct cmd_frequencies *cmd
UNUSED
)
{
lex_match ('=');
if ((token == T_ID && dict_lookup_var (default_dict, tokid) != NULL)
{
lex_match ('=');
if ((token == T_ID && dict_lookup_var (default_dict, tokid) != NULL)
@@
-777,7
+779,7
@@
add_percentile (double x)
/* Parses the PERCENTILES subcommand, adding user-specified
percentiles to the list. */
static int
/* Parses the PERCENTILES subcommand, adding user-specified
percentiles to the list. */
static int
-frq_custom_percentiles (struct cmd_frequencies *cmd
unused
)
+frq_custom_percentiles (struct cmd_frequencies *cmd
UNUSED
)
{
lex_match ('=');
if (token != T_NUM)
{
lex_match ('=');
if (token != T_NUM)
@@
-806,7
+808,7
@@
frq_custom_percentiles (struct cmd_frequencies *cmd unused)
/* Parses the NTILES subcommand, adding the percentiles that
correspond to the specified evenly-distributed ntiles. */
static int
/* Parses the NTILES subcommand, adding the percentiles that
correspond to the specified evenly-distributed ntiles. */
static int
-frq_custom_ntiles (struct cmd_frequencies *cmd
unused
)
+frq_custom_ntiles (struct cmd_frequencies *cmd
UNUSED
)
{
int i;
{
int i;
@@
-823,7
+825,7
@@
frq_custom_ntiles (struct cmd_frequencies *cmd unused)
/* Hash of numeric values. */
static unsigned
/* Hash of numeric values. */
static unsigned
-hash_value_numeric (const void *value_, void *foo
unused
)
+hash_value_numeric (const void *value_, void *foo
UNUSED
)
{
const struct freq *value = value_;
return hsh_hash_double (value->v.f);
{
const struct freq *value = value_;
return hsh_hash_double (value->v.f);
@@
-831,17
+833,17
@@
hash_value_numeric (const void *value_, void *foo unused)
/* Hash of string values. */
static unsigned
/* Hash of string values. */
static unsigned
-hash_value_alpha (const void *value_, void *
len
_)
+hash_value_alpha (const void *value_, void *
v
_)
{
const struct freq *value = value_;
{
const struct freq *value = value_;
-
int *len = len
_;
+
struct variable *v = v
_;
- return hsh_hash_bytes (value->v.s,
*len
);
+ return hsh_hash_bytes (value->v.s,
v->width
);
}
/* Ascending numeric compare of values. */
static int
}
/* Ascending numeric compare of values. */
static int
-compare_value_numeric_a (const void *a_, const void *b_, void *foo
unused
)
+compare_value_numeric_a (const void *a_, const void *b_, void *foo
UNUSED
)
{
const struct freq *a = a_;
const struct freq *b = b_;
{
const struct freq *a = a_;
const struct freq *b = b_;
@@
-867,7
+869,7
@@
compare_value_alpha_a (const void *a_, const void *b_, void *v_)
/* Descending numeric compare of values. */
static int
/* Descending numeric compare of values. */
static int
-compare_value_numeric_d (const void *a, const void *b, void *foo
unused
)
+compare_value_numeric_d (const void *a, const void *b, void *foo
UNUSED
)
{
return -compare_value_numeric_a (a, b, foo);
}
{
return -compare_value_numeric_a (a, b, foo);
}
@@
-882,14
+884,14
@@
compare_value_alpha_d (const void *a, const void *b, void *v)
/* Ascending numeric compare of frequency;
secondary key on ascending numeric value. */
static int
/* Ascending numeric compare of frequency;
secondary key on ascending numeric value. */
static int
-compare_freq_numeric_a (const void *a_, const void *b_, void *foo
unused
)
+compare_freq_numeric_a (const void *a_, const void *b_, void *foo
UNUSED
)
{
const struct freq *a = a_;
const struct freq *b = b_;
{
const struct freq *a = a_;
const struct freq *b = b_;
- if (a->
v.c > b->v.
c)
+ if (a->
c > b->
c)
return 1;
return 1;
- else if (a->
v.c < b->v.
c)
+ else if (a->
c < b->
c)
return -1;
if (a->v.f > b->v.f)
return -1;
if (a->v.f > b->v.f)
@@
-909,9
+911,9
@@
compare_freq_alpha_a (const void *a_, const void *b_, void *v_)
const struct freq *b = b_;
const struct variable *v = v_;
const struct freq *b = b_;
const struct variable *v = v_;
- if (a->
v.c > b->v.
c)
+ if (a->
c > b->
c)
return 1;
return 1;
- else if (a->
v.c < b->v.
c)
+ else if (a->
c < b->
c)
return -1;
else
return memcmp (a->v.s, b->v.s, v->width);
return -1;
else
return memcmp (a->v.s, b->v.s, v->width);
@@
-920,14
+922,14
@@
compare_freq_alpha_a (const void *a_, const void *b_, void *v_)
/* Descending numeric compare of frequency;
secondary key on ascending numeric value. */
static int
/* Descending numeric compare of frequency;
secondary key on ascending numeric value. */
static int
-compare_freq_numeric_d (const void *a_, const void *b_, void *foo
unused
)
+compare_freq_numeric_d (const void *a_, const void *b_, void *foo
UNUSED
)
{
const struct freq *a = a_;
const struct freq *b = b_;
{
const struct freq *a = a_;
const struct freq *b = b_;
- if (a->
v.c > b->v.
c)
+ if (a->
c > b->
c)
return -1;
return -1;
- else if (a->
v.c < b->v.
c)
+ else if (a->
c < b->
c)
return 1;
if (a->v.f > b->v.f)
return 1;
if (a->v.f > b->v.f)
@@
-947,9
+949,9
@@
compare_freq_alpha_d (const void *a_, const void *b_, void *v_)
const struct freq *b = b_;
const struct variable *v = v_;
const struct freq *b = b_;
const struct variable *v = v_;
- if (a->
v.c > b->v.
c)
+ if (a->
c > b->
c)
return -1;
return -1;
- else if (a->
v.c < b->v.
c)
+ else if (a->
c < b->
c)
return 1;
else
return memcmp (a->v.s, b->v.s, v->width);
return 1;
else
return memcmp (a->v.s, b->v.s, v->width);