From 7a8f81259c515291126f29a0e65aff791efe16b0 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 20 Aug 2019 05:26:51 -0700 Subject: Use size_t for the NFC and biquad filters' sample count --- alc/filters/biquad.cpp | 2 +- alc/filters/biquad.h | 3 ++- alc/filters/nfc.cpp | 8 ++++---- alc/filters/nfc.h | 11 +++++++---- 4 files changed, 14 insertions(+), 10 deletions(-) (limited to 'alc/filters') diff --git a/alc/filters/biquad.cpp b/alc/filters/biquad.cpp index 871c4af4..a4d81604 100644 --- a/alc/filters/biquad.cpp +++ b/alc/filters/biquad.cpp @@ -89,7 +89,7 @@ void BiquadFilterR::setParams(BiquadType type, Real gain, Real f0norm, Rea } template -void BiquadFilterR::process(Real *dst, const Real *src, int numsamples) +void BiquadFilterR::process(Real *dst, const Real *src, const size_t numsamples) { ASSUME(numsamples > 0); diff --git a/alc/filters/biquad.h b/alc/filters/biquad.h index f8d7f0ba..9de86f2f 100644 --- a/alc/filters/biquad.h +++ b/alc/filters/biquad.h @@ -2,6 +2,7 @@ #define FILTERS_BIQUAD_H #include +#include #include #include "math_defs.h" @@ -72,7 +73,7 @@ public: } - void process(Real *dst, const Real *src, int numsamples); + void process(Real *dst, const Real *src, const size_t numsamples); /* Rather hacky. It's just here to support "manual" processing. */ std::pair getComponents() const noexcept diff --git a/alc/filters/nfc.cpp b/alc/filters/nfc.cpp index 4e36bc66..e4436b27 100644 --- a/alc/filters/nfc.cpp +++ b/alc/filters/nfc.cpp @@ -278,7 +278,7 @@ void NfcFilter::adjust(const float w0) noexcept } -void NfcFilter::process1(float *RESTRICT dst, const float *RESTRICT src, const int count) +void NfcFilter::process1(float *RESTRICT dst, const float *RESTRICT src, const size_t count) { ASSUME(count > 0); @@ -297,7 +297,7 @@ void NfcFilter::process1(float *RESTRICT dst, const float *RESTRICT src, const i first.z[0] = z1; } -void NfcFilter::process2(float *RESTRICT dst, const float *RESTRICT src, const int count) +void NfcFilter::process2(float *RESTRICT dst, const float *RESTRICT src, const size_t count) { ASSUME(count > 0); @@ -321,7 +321,7 @@ void NfcFilter::process2(float *RESTRICT dst, const float *RESTRICT src, const i second.z[1] = z2; } -void NfcFilter::process3(float *RESTRICT dst, const float *RESTRICT src, const int count) +void NfcFilter::process3(float *RESTRICT dst, const float *RESTRICT src, const size_t count) { ASSUME(count > 0); @@ -353,7 +353,7 @@ void NfcFilter::process3(float *RESTRICT dst, const float *RESTRICT src, const i third.z[2] = z3; } -void NfcFilter::process4(float *RESTRICT dst, const float *RESTRICT src, const int count) +void NfcFilter::process4(float *RESTRICT dst, const float *RESTRICT src, const size_t count) { ASSUME(count > 0); diff --git a/alc/filters/nfc.h b/alc/filters/nfc.h index b656850a..d2bf3339 100644 --- a/alc/filters/nfc.h +++ b/alc/filters/nfc.h @@ -1,6 +1,9 @@ #ifndef FILTER_NFC_H #define FILTER_NFC_H +#include + + struct NfcFilter1 { float base_gain, gain; float b1, a1; @@ -43,16 +46,16 @@ public: void adjust(const float w0) noexcept; /* Near-field control filter for first-order ambisonic channels (1-3). */ - void process1(float *RESTRICT dst, const float *RESTRICT src, const int count); + void process1(float *RESTRICT dst, const float *RESTRICT src, const size_t count); /* Near-field control filter for second-order ambisonic channels (4-8). */ - void process2(float *RESTRICT dst, const float *RESTRICT src, const int count); + void process2(float *RESTRICT dst, const float *RESTRICT src, const size_t count); /* Near-field control filter for third-order ambisonic channels (9-15). */ - void process3(float *RESTRICT dst, const float *RESTRICT src, const int count); + void process3(float *RESTRICT dst, const float *RESTRICT src, const size_t count); /* Near-field control filter for fourth-order ambisonic channels (16-24). */ - void process4(float *RESTRICT dst, const float *RESTRICT src, const int count); + void process4(float *RESTRICT dst, const float *RESTRICT src, const size_t count); }; #endif /* FILTER_NFC_H */ -- cgit v1.2.3