mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
libpcm: fix buggy use of clip macro (evaluates its arg twice)
This commit is contained in:
parent
b9955e29d1
commit
0676a1ba51
1 changed files with 9 additions and 1 deletions
|
@ -52,7 +52,15 @@ enum {
|
||||||
#define MAXINT ((int)(~0UL>>1))
|
#define MAXINT ((int)(~0UL>>1))
|
||||||
#define MININT (MAXINT+1)
|
#define MININT (MAXINT+1)
|
||||||
|
|
||||||
#define clip(v) ((v) > MAXINT ? MAXINT : ((v) < MININT ? MININT : (v)))
|
static int
|
||||||
|
clip(vlong v)
|
||||||
|
{
|
||||||
|
if(v > MAXINT)
|
||||||
|
return MAXINT;
|
||||||
|
if(v < MININT)
|
||||||
|
return MININT;
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
chaninit(Chan *c, int irate, int orate, int count, uintptr caller)
|
chaninit(Chan *c, int irate, int orate, int count, uintptr caller)
|
||||||
|
|
Loading…
Reference in a new issue