From d1f9113c5157c293f18e849cbb8f7de6b3f301ad Mon Sep 17 00:00:00 2001 From: Jason Heeris Date: Fri, 5 Apr 2019 19:08:00 +1100 Subject: [PATCH] Include stdint.h only where fixed point types are used. Use min/max values from stdint.h. --- _kiss_fft_guts.h | 12 ++++++------ kiss_fft.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/_kiss_fft_guts.h b/_kiss_fft_guts.h index 739330f..7bf5762 100644 --- a/_kiss_fft_guts.h +++ b/_kiss_fft_guts.h @@ -12,7 +12,6 @@ typedef struct { kiss_fft_scalar r; kiss_fft_scalar i; }kiss_fft_cpx; */ #include "kiss_fft.h" #include -#include #define MAXFACTORS 32 /* e.g. an fft of length 128 has 4 factors @@ -37,18 +36,19 @@ struct kiss_fft_state{ C_ADDTO( res , a) : res += a * */ #ifdef FIXED_POINT +#include #if (FIXED_POINT==32) # define FRACBITS 31 # define SAMPPROD int64_t -#define SAMP_MAX 2147483647 +#define SAMP_MAX INT32_MAX +#define SAMP_MIN INT32_MIN #else # define FRACBITS 15 -# define SAMPPROD int32_t -#define SAMP_MAX 32767 +# define SAMPPROD int32_t +#define SAMP_MAX INT16_MAX +#define SAMP_MIN INT16_MIN #endif -#define SAMP_MIN -SAMP_MAX - #if defined(CHECK_OVERFLOW) # define CHECK_OVERFLOW_OP(a,op,b) \ if ( (SAMPPROD)(a) op (SAMPPROD)(b) > SAMP_MAX || (SAMPPROD)(a) op (SAMPPROD)(b) < SAMP_MIN ) { \ diff --git a/kiss_fft.h b/kiss_fft.h index 45c3a6a..1ca0b45 100644 --- a/kiss_fft.h +++ b/kiss_fft.h @@ -43,7 +43,7 @@ extern "C" { #ifdef FIXED_POINT -#include +#include # if (FIXED_POINT == 32) # define kiss_fft_scalar int32_t # else