From 46044ed0da3641ca33700203145baa73bf6aa041 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 25 Sep 2009 23:03:34 +0200 Subject: [PATCH] src/types.h: add some documentation, use HAVE_AUBIO_DOUBLE, not AUBIO_SINGLE_PRECISION --- ext/jackio.c | 2 +- src/aubio_priv.h | 4 ++-- src/types.h | 15 +++++++-------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/ext/jackio.c b/ext/jackio.c index ebd7b43e..b63f68a2 100644 --- a/ext/jackio.c +++ b/ext/jackio.c @@ -26,7 +26,7 @@ typedef jack_default_audio_sample_t jack_sample_t; -#if !AUBIO_SINGLE_PRECISION +#if HAVE_AUBIO_DOUBLE #define AUBIO_JACK_MAX_FRAMES 4096 #define AUBIO_JACK_NEEDS_CONVERSION #endif diff --git a/src/aubio_priv.h b/src/aubio_priv.h index ad8ec3d0..803df2e6 100644 --- a/src/aubio_priv.h +++ b/src/aubio_priv.h @@ -124,7 +124,7 @@ typedef enum { #define TWO_PI (PI*2.) /* aliases to math.h functions */ -#if AUBIO_SINGLE_PRECISION +#if !HAVE_AUBIO_DOUBLE #define EXP expf #define COS cosf #define SIN sinf @@ -150,7 +150,7 @@ typedef enum { #define ROUND(x) FLOOR(x+.5) /* aliases to complex.h functions */ -#if !defined(AUBIO_SINGLE_PRECISION) || !defined(HAVE_COMPLEX_H) || defined(WIN32) +#if HAVE_AUBIO_DOUBLE || !defined(HAVE_COMPLEX_H) || defined(WIN32) /* mingw32 does not know about c*f functions */ #define EXPC cexp /** complex = CEXPC(complex) */ diff --git a/src/types.h b/src/types.h index 9a387617..e38fabe3 100644 --- a/src/types.h +++ b/src/types.h @@ -33,29 +33,28 @@ extern "C" { #include "config.h" #ifndef HAVE_AUBIO_DOUBLE +/** defined to 1 if aubio is compiled in double precision */ #define HAVE_AUBIO_DOUBLE 0 #endif -#if HAVE_AUBIO_DOUBLE -#define AUBIO_SINGLE_PRECISION 0 -#else -#define AUBIO_SINGLE_PRECISION 1 -#endif - /** short sample format (32 or 64 bits) */ -#if AUBIO_SINGLE_PRECISION +#if !HAVE_AUBIO_DOUBLE typedef float smpl_t; +/** print format for sample in single precision */ #define AUBIO_SMPL_FMT "%f" #else typedef double smpl_t; +/** print format for double in single precision */ #define AUBIO_SMPL_FMT "%lf" #endif /** long sample format (64 bits or more) */ -#if AUBIO_SINGLE_PRECISION +#if !HAVE_AUBIO_DOUBLE typedef double lsmp_t; +/** print format for sample in double precision */ #define AUBIO_LSMP_FMT "%lf" #else typedef long double lsmp_t; +/** print format for double in double precision */ #define AUBIO_LSMP_FMT "%Lf" #endif /** unsigned integer */ -- 2.26.2