commit 0357e4f1296b9aa911fda3f5ed58d1583b5a8270
parent 25527829651273ea7aeb3ae7d73f51db34431368
Author: Christos Margiolis <christos@margiolis.net>
Date: Wed, 25 Aug 2021 17:00:17 +0300
removed math dependency
Diffstat:
4 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/mixer_lib/Makefile b/mixer_lib/Makefile
@@ -5,6 +5,5 @@ SRCS= ${LIB}.c
INCS= ${LIB}.h
MAN= ${LIB}.3
CFLAGS+= -pedantic -Wall -Wunused
-LDFLAGS+= -lm
.include <bsd.lib.mk>
diff --git a/mixer_lib/mixer.c b/mixer_lib/mixer.c
@@ -26,7 +26,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/mixer_lib/mixer.h b/mixer_lib/mixer.h
@@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$");
#include <sys/soundcard.h>
#include <limits.h>
-#include <math.h>
#define MIX_ISSET(n,f) (((1 << (n)) & (f)) ? 1 : 0)
#define MIX_ISDEV(m,n) MIX_ISSET(n, (m)->devmask)
@@ -65,7 +64,7 @@ struct mix_dev {
#define MIX_VOLMIN 0.0f
#define MIX_VOLMAX 1.0f
#define MIX_VOLNORM(v) ((v) / 100.0f)
-#define MIX_VOLDENORM(v) ((int)roundf((v) * 100.0f))
+#define MIX_VOLDENORM(v) ((int)((v) * 100.0f + 0.5f))
float left; /* left volume */
float right; /* right volume */
} vol;
diff --git a/mixer_prog/Makefile b/mixer_prog/Makefile
@@ -5,6 +5,6 @@ BINDIR= /usr/sbin
SRCS= ${PROG}.c
MAN= ${PROG}.8
CFLAGS+= -pedantic -Wall -Wunused
-LDFLAGS+= -lmixer -lm
+LDFLAGS+= -lmixer
.include <bsd.prog.mk>