From 303f262acbe3a49dbcea1eb325695863c2fe3f63 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Tue, 22 Apr 2025 09:45:24 -0400 Subject: [PATCH] dsp: Silence a warning in the compressor code /* offset = -3db * (ratio - 1) / ratio */ db_curve[2].offset = (int32_t)((long long)(-3 << 16) * (ratio - 1) / ratio); Results in a warning: left shift of negative value [-Wshift-negative-value] To fix this, replace the '-3' with -3UL. (As that is effectively what is already happening) Change-Id: I5aa269ff332703d3c2d889fa032d2fdc403ff14f --- lib/rbcodec/dsp/compressor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rbcodec/dsp/compressor.c b/lib/rbcodec/dsp/compressor.c index 2a28e8b765..7789079035 100644 --- a/lib/rbcodec/dsp/compressor.c +++ b/lib/rbcodec/dsp/compressor.c @@ -276,7 +276,7 @@ static bool compressor_update(struct dsp_config *dsp, db_curve[2].db = db_curve[1].db + (3 << 16); if (ratio) /* offset = -3db * (ratio - 1) / ratio */ - db_curve[2].offset = (int32_t)((long long)(-3 << 16) + db_curve[2].offset = (int32_t)((long long)(-3UL << 16) * (ratio - 1) / ratio); else /* offset = -3db for hard limit */