-/* Ascending numeric compare of values. */
-static int
-compare_value_numeric_a (const void *a_, const void *b_, const void *aux UNUSED)
-{
- const struct freq_mutable *a = a_;
- const struct freq_mutable *b = b_;
-
- if (a->value.f > b->value.f)
- return 1;
- else if (a->value.f < b->value.f)
- return -1;
- else
- return 0;
-}
-
-/* Ascending string compare of values. */
-static int
-compare_value_alpha_a (const void *a_, const void *b_, const void *v_)
-{
- const struct freq_mutable *a = a_;
- const struct freq_mutable *b = b_;
- const struct variable *v = v_;
- struct var_freqs *vf = get_var_freqs (v);
-
- return value_compare_3way (&a->value, &b->value, vf->width);
-}
-
-/* Descending numeric compare of values. */
-static int
-compare_value_numeric_d (const void *a, const void *b, const void *aux UNUSED)
-{
- return -compare_value_numeric_a (a, b, aux);
-}
-
-/* Descending string compare of values. */
-static int
-compare_value_alpha_d (const void *a, const void *b, const void *v)
-{
- return -compare_value_alpha_a (a, b, v);
-}
-
-/* Ascending numeric compare of frequency;
- secondary key on ascending numeric value. */
-static int
-compare_freq_numeric_a (const void *a_, const void *b_, const void *aux UNUSED)
-{
- const struct freq_mutable *a = a_;
- const struct freq_mutable *b = b_;
-
- if (a->count > b->count)
- return 1;
- else if (a->count < b->count)
- return -1;
-
- if (a->value.f > b->value.f)
- return 1;
- else if (a->value.f < b->value.f)
- return -1;
- else
- return 0;
-}
-
-/* Ascending numeric compare of frequency;
- secondary key on ascending string value. */
-static int
-compare_freq_alpha_a (const void *a_, const void *b_, const void *v_)
-{
- const struct freq_mutable *a = a_;
- const struct freq_mutable *b = b_;
- const struct variable *v = v_;
- struct var_freqs *vf = get_var_freqs (v);
-
- if (a->count > b->count)
- return 1;
- else if (a->count < b->count)
- return -1;
- else
- return value_compare_3way (&a->value, &b->value, vf->width);
-}
-
-/* Descending numeric compare of frequency;
- secondary key on ascending numeric value. */
-static int
-compare_freq_numeric_d (const void *a_, const void *b_, const void *aux UNUSED)
-{
- const struct freq_mutable *a = a_;
- const struct freq_mutable *b = b_;
-
- if (a->count > b->count)
- return -1;
- else if (a->count < b->count)
- return 1;
-
- if (a->value.f > b->value.f)
- return 1;
- else if (a->value.f < b->value.f)
- return -1;
- else
- return 0;
-}
-
-/* Descending numeric compare of frequency;
- secondary key on ascending string value. */
-static int
-compare_freq_alpha_d (const void *a_, const void *b_, const void *v_)
-{
- const struct freq_mutable *a = a_;
- const struct freq_mutable *b = b_;
- const struct variable *v = v_;
- struct var_freqs *vf = get_var_freqs (v);
-
- if (a->count > b->count)
- return -1;
- else if (a->count < b->count)
- return 1;
- else
- return value_compare_3way (&a->value, &b->value, vf->width);
-}