summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/speaker/spkr.c11
-rw-r--r--sys/i386/isa/spkr.c11
-rw-r--r--sys/pc98/pc98/spkr.c11
-rw-r--r--sys/sys/libkern.h4
4 files changed, 4 insertions, 33 deletions
diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c
index 4c8966e..de4c5ca 100644
--- a/sys/dev/speaker/spkr.c
+++ b/sys/dev/speaker/spkr.c
@@ -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)
diff --git a/sys/i386/isa/spkr.c b/sys/i386/isa/spkr.c
index 4c8966e..de4c5ca 100644
--- a/sys/i386/isa/spkr.c
+++ b/sys/i386/isa/spkr.c
@@ -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)
diff --git a/sys/pc98/pc98/spkr.c b/sys/pc98/pc98/spkr.c
index 2e4978c..3e3f437 100644
--- a/sys/pc98/pc98/spkr.c
+++ b/sys/pc98/pc98/spkr.c
@@ -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)
diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h
index 65ab341..26947e1 100644
--- a/sys/sys/libkern.h
+++ b/sys/sys/libkern.h
@@ -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);
OpenPOWER on IntegriCloud