mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
PCM API cleaning. silencing implementation. xfer_min removal
This commit is contained in:
parent
684703b387
commit
8f1b27dfb8
29 changed files with 1189 additions and 853 deletions
|
|
@ -20,6 +20,7 @@
|
|||
*/
|
||||
|
||||
#define INTERVAL_C
|
||||
#define INTERVAL_INLINE
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <limits.h>
|
||||
|
|
@ -215,6 +216,30 @@ int interval_refine_set(interval_t *i, unsigned int val)
|
|||
return interval_refine(i, &t);
|
||||
}
|
||||
|
||||
/* a <- b + c */
|
||||
int interval_add(interval_t *a, const interval_t *b, const interval_t *c)
|
||||
{
|
||||
interval_t t;
|
||||
assert(!a->empty && !b->empty && !c->empty);
|
||||
t.min = add(b->min, c->min);
|
||||
t.openmin = (b->openmin || c->openmin);
|
||||
t.max = add(b->max, c->max);
|
||||
t.openmax = (b->openmax || c->openmax);
|
||||
return interval_refine(a, &t);
|
||||
}
|
||||
|
||||
/* a <- b - c */
|
||||
int interval_sub(interval_t *a, const interval_t *b, const interval_t *c)
|
||||
{
|
||||
interval_t t;
|
||||
assert(!a->empty && !b->empty && !c->empty);
|
||||
t.min = sub(b->min, c->max);
|
||||
t.openmin = (b->openmin || c->openmax);
|
||||
t.max = add(b->max, c->min);
|
||||
t.openmax = (b->openmax || c->openmin);
|
||||
return interval_refine(a, &t);
|
||||
}
|
||||
|
||||
/* a <- b * c */
|
||||
int interval_mul(interval_t *a, const interval_t *b, const interval_t *c)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue