/* Returns non-zero if the value is changed, zero if not changed.  */
void snd_range_mulkdiv(const snd_interval_t *a, unsigned int k, const snd_interval_t *b, snd_interval_t *c)
/* Returns non-zero if the value is changed, zero if not changed.  */
void snd_range_mulkdiv(const snd_interval_t *a, unsigned int k, const snd_interval_t *b, snd_interval_t *c)
{
    unsigned int r;
    if (a->range.empty || b->range.empty) {
        snd_range_none(c);
        return;
    }
    c->range.empty = 0;
    c->range.min = muldiv32(a->range.min, k, b->range.max, &r);
    c->range.openmin = (r || a->range.openmin || b->range.openmax);
    if (b->range.min > 0) {
        c->range.max = muldiv32(a->range.max, k, b->range.min, &r);
        if (r) {
            c->range.max++;
            c->range.openmax = 1;
        } else {
            c->range.openmax = (a->range.openmax || b->range.openmin);
        }
    } else {
        c->range.max = UINT_MAX;
        c->range.openmax = 0;
    }
    c->range.integer = 0;
}