* If throwing InvalidSize, at least print out why

This commit is contained in:
Chris Cannam
2008-01-28 17:26:37 +00:00
parent 458cbf343d
commit a08d138309

View File

@@ -741,8 +741,11 @@ FFT::m_method = -1;
FFT::FFT(unsigned int size) FFT::FFT(unsigned int size)
{ {
if (size < 2) throw InvalidSize; if ((size < 2) ||
if (size & (size-1)) throw InvalidSize; (size & (size-1))) {
std::cerr << "FFT::FFT(" << size << "): power-of-two sizes only supported, minimum size 2" << std::endl;
throw InvalidSize;
}
if (m_method == -1) { if (m_method == -1) {
m_method = 1; m_method = 1;