From 55c908714010fec10687d43e5b13de659779cfdb Mon Sep 17 00:00:00 2001 From: Antoine SOULIER Date: Thu, 21 Apr 2022 15:49:58 +0200 Subject: [PATCH] Improvement: Add warning on double promotion and remove one the last that remains --- Makefile | 2 +- src/spec.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 515cbb5..99c8660 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ AS := $(if $(AS)=as,$(CC),$(AS)) LD := $(if $(LD)=ld,$(CC),$(LD)) CFLAGS := $(if $(DEBUG),-O0 -g,-O3) -CFLAGS += -std=c11 -Wall -Wextra +CFLAGS += -std=c11 -Wall -Wextra -Wdouble-promotion # diff --git a/src/spec.c b/src/spec.c index a2c94f8..67cd4ac 100644 --- a/src/spec.c +++ b/src/spec.c @@ -646,12 +646,12 @@ static int estimate_noise(enum lc3_dt dt, enum lc3_bandwidth bw, for (i = 6*(3 + dt) - w; i < LC3_MIN(nq, bw_stop); i++) { z = xq[i] ? 0 : z + 1; if (z > 2*w) - sum += fabs(x[i - w]), n++; + sum += fabsf(x[i - w]), n++; } for ( ; i < bw_stop + w; i++) if (++z > 2*w) - sum += fabs(x[i - w]), n++; + sum += fabsf(x[i - w]), n++; int nf = n ? 8 - (int)((16 * sum) / n + 0.5f) : 0;