From 2dfff104007ace5dc4d947d6524747e932ef7ba9 Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Fri, 14 Mar 2025 18:54:29 +0100 Subject: [PATCH] i do hate c with a passion --- src/modulator.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/modulator.c b/src/modulator.c index a0417e2..d49bb80 100644 --- a/src/modulator.c +++ b/src/modulator.c @@ -3,13 +3,6 @@ #include "waveforms.h" #include "modulator.h" -#ifndef max -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#endif -#ifndef min -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#endif - static struct rds_t rds; static float waveform[2][FILTER_SIZE]; @@ -34,7 +27,7 @@ void set_rds_level(float _level) { level = fminf(1.0f, fmaxf(0.0f, _level)); } void set_rds_gen(uint8_t rdsgen) { - rdsgen = min(1U, max(0U, rdsgen)); + rdsgen = rdsgen > 1 ? 1 : rdsgen; } /* Get an RDS sample. This generates the envelope of the waveform using