From cdc268f681ff333c9775563f158e4336e339c373 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 26 Jul 2015 00:05:27 -0400 Subject: [PATCH] Bug 1097: Fix unsafe macro definitions which caused display bugs --- src/Audacity.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Audacity.h b/src/Audacity.h index 536ba922d..1ad029cbb 100644 --- a/src/Audacity.h +++ b/src/Audacity.h @@ -153,10 +153,10 @@ void QuitAudacity(); #endif // These macros are used widely, so declared here. -#define QUANTIZED_TIME(time, rate) ((double)((sampleCount)floor(((double)(time) * (rate)) + 0.5))) / (rate) +#define QUANTIZED_TIME(time, rate) (((double)((sampleCount)floor(((double)(time) * (rate)) + 0.5))) / (rate)) // dB - linear amplitude convesions -#define DB_TO_LINEAR(x) pow(10.0, x / 20.0) -#define LINEAR_TO_DB(x) 20.0 * log10(x) +#define DB_TO_LINEAR(x) (pow(10.0, (x) / 20.0)) +#define LINEAR_TO_DB(x) (20.0 * log10(x)) // Marks strings for extraction only...must use wxGetTranslation() to translate. #define XO(s) wxT(s)