- Add inline functions for {ll,l,}abs() to libkern.

- Remove hand rolled abs() functions.
This commit is contained in:
Matthew N. Dodd 2003-01-15 02:02:33 +00:00
parent eaa6ebc44c
commit e2fdcaf285
4 changed files with 4 additions and 33 deletions

View File

@ -99,7 +99,6 @@ static void tone(unsigned int thz, unsigned int ticks);
static void rest(int ticks);
static void playinit(void);
static void playtone(int pitch, int value, int sustain);
static int abs(int n);
static void playstring(char *cp, size_t slen);
/* emit tone of frequency thz for given number of ticks */
@ -274,16 +273,6 @@ playtone(pitch, value, sustain)
}
}
static int
abs(n)
int n;
{
if (n < 0)
return(-n);
else
return(n);
}
/* interpret and play an item from a notation string */
static void
playstring(cp, slen)

View File

@ -99,7 +99,6 @@ static void tone(unsigned int thz, unsigned int ticks);
static void rest(int ticks);
static void playinit(void);
static void playtone(int pitch, int value, int sustain);
static int abs(int n);
static void playstring(char *cp, size_t slen);
/* emit tone of frequency thz for given number of ticks */
@ -274,16 +273,6 @@ playtone(pitch, value, sustain)
}
}
static int
abs(n)
int n;
{
if (n < 0)
return(-n);
else
return(n);
}
/* interpret and play an item from a notation string */
static void
playstring(cp, slen)

View File

@ -86,7 +86,6 @@ static void tone(unsigned int thz, unsigned int ticks);
static void rest(int ticks);
static void playinit(void);
static void playtone(int pitch, int value, int sustain);
static int abs(int n);
static void playstring(char *cp, size_t slen);
/* emit tone of frequency thz for given number of ticks */
@ -282,16 +281,6 @@ playtone(pitch, value, sustain)
}
}
static int
abs(n)
int n;
{
if (n < 0)
return(-n);
else
return(n);
}
/* interpret and play an item from a notation string */
static void
playstring(cp, slen)

View File

@ -63,6 +63,10 @@ static __inline quad_t qmin(quad_t a, quad_t b) { return (a < b ? a : b); }
static __inline u_long ulmax(u_long a, u_long b) { return (a > b ? a : b); }
static __inline u_long ulmin(u_long a, u_long b) { return (a < b ? a : b); }
static __inline int abs(int a) { return (((a) < 0) ? -(a) : (a)); }
static __inline long labs(long a) { return (((a) < 0) ? -(a) : (a)); }
static __inline long long llabs(long a) { return (((a) < 0) ? -(a) : (a)); }
/* Prototypes for non-quad routines. */
uint32_t arc4random(void);
void arc4rand(void *ptr, u_int len, int reseed);