Mercurial > hg > svcore
diff data/fft/FFTMemoryCache.h @ 1038:cc27f35aa75c cxx11
Introducing the signed 64-bit frame index type, and fixing build failures from inclusion of -Wconversion with -Werror. Not finished yet.
author | Chris Cannam |
---|---|
date | Tue, 03 Mar 2015 15:18:24 +0000 |
parents | 59e7fe1b1003 |
children |
line wrap: on
line diff
--- a/data/fft/FFTMemoryCache.h Tue Mar 03 09:33:59 2015 +0000 +++ b/data/fft/FFTMemoryCache.h Tue Mar 03 15:18:24 2015 +0000 @@ -66,7 +66,7 @@ float getNormalizedMagnitudeAt(int x, int y) const { if (m_storageType == FFTCache::Rectangular) return getMagnitudeAt(x, y) / m_factor[x]; else if (m_storageType == FFTCache::Polar) return m_fmagnitude[x][y]; - else return float(m_magnitude[x][y]) / 65535.0; + else return float(m_magnitude[x][y]) / 65535.f; } float getMaximumMagnitudeAt(int x) const { @@ -81,7 +81,7 @@ return m_fphase[x][y]; } else { int16_t i = (int16_t)m_phase[x][y]; - return (float(i) / 32767.0) * M_PI; + return float(i / 32767.0 * M_PI); } } @@ -114,7 +114,7 @@ } else { for (int i = 0; i < count; ++i) { int y = i * step + minbin; - values[i] = (float(m_magnitude[x][y]) * m_factor[x]) / 65535.0; + values[i] = float(double(m_magnitude[x][y]) * m_factor[x] / 65535.0); } } } @@ -132,7 +132,7 @@ void allColumnsWritten() { } - static int getCacheSize(int width, int height, + static size_t getCacheSize(int width, int height, FFTCache::StorageType type); FFTCache::StorageType getStorageType() const { return m_storageType; }